Skip to content

Commit f4ad6bc

Browse files
authored
Merge pull request #52 from companieshouse/fix-interceptor-order
Make transactionInterceptor run after authentication
2 parents 55b2c1b + 27cd6cd commit f4ad6bc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/uk/gov/companieshouse/limitedpartnershipsapi/config/InterceptorConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ public InterceptorConfig(LoggingInterceptor loggingInterceptor,
3737
@Override
3838
public void addInterceptors(@NonNull InterceptorRegistry registry) {
3939
registry.addInterceptor(loggingInterceptor);
40-
registry.addInterceptor(transactionInterceptor())
41-
.addPathPatterns(FILINGS, TRANSACTIONS);
4240
registry.addInterceptor(new TokenPermissionsInterceptor())
4341
.addPathPatterns(PARTNERSHIP);
4442
registry.addInterceptor(customUserAuthenticationInterceptor)
4543
.addPathPatterns(PARTNERSHIP);
44+
registry.addInterceptor(transactionInterceptor())
45+
.addPathPatterns(FILINGS, TRANSACTIONS);
4646
}
4747

4848
@Bean

src/test/java/uk/gov/companieshouse/limitedpartnershipsapi/config/InterceptorConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ void addInterceptorsTest() {
4545

4646
InOrder inOrder = inOrder(interceptorRegistry, interceptorRegistration);
4747
inOrder.verify(interceptorRegistry).addInterceptor(loggingInterceptor);
48-
inOrder.verify(interceptorRegistry).addInterceptor(any(TransactionInterceptor.class));
4948
inOrder.verify(interceptorRegistry).addInterceptor(any(TokenPermissionsInterceptor.class));
5049
inOrder.verify(interceptorRegistry).addInterceptor(customUserAuthenticationInterceptor);
50+
inOrder.verify(interceptorRegistry).addInterceptor(any(TransactionInterceptor.class));
5151

5252
verify(interceptorRegistry, times(4)).addInterceptor(any());
5353
}

0 commit comments

Comments
 (0)