18
18
import com .nimbusds .jose .jwk .gen .RSAKeyGenerator ;
19
19
import com .nimbusds .jwt .JWTClaimsSet ;
20
20
import com .nimbusds .jwt .SignedJWT ;
21
- import org .junit . jupiter .api .Assertions ;
21
+ import org .assertj . core .api .WithAssertions ;
22
22
import org .junit .jupiter .api .BeforeEach ;
23
23
import org .junit .jupiter .api .Test ;
24
24
import org .springframework .beans .factory .annotation .Autowired ;
73
73
"allowed-issuers=http://localhost:${wiremock.server.port}"
74
74
})
75
75
@ AutoConfigureWireMock (port = 0 )
76
- class TokenValidationTest {
76
+ class TokenValidationTest implements WithAssertions {
77
77
78
78
@ Value ("${wiremock.server.port}" )
79
79
int port ;
@@ -186,11 +186,11 @@ private void testWebsocket(String name) throws InterruptedException {
186
186
}
187
187
}
188
188
if (!done ) {
189
- Assertions . fail ("Wiremock didn't receive the websocket connection" );
189
+ fail ("Wiremock didn't receive the websocket connection" );
190
190
}
191
191
try {
192
192
wsconnection .timeout (Duration .ofMillis (100 )).block ();
193
- Assertions . fail ("websocket client was closed but should remain open" );
193
+ fail ("websocket client was closed but should remain open" );
194
194
} catch (Exception ignored ) {
195
195
//should timeout
196
196
}
@@ -550,7 +550,7 @@ void invalidToken() {
550
550
.exchange ()
551
551
.expectStatus ().isEqualTo (401 );
552
552
553
- //test with a incorrect Authorization value
553
+ //test with an incorrect Authorization value
554
554
webClient
555
555
.get ().uri ("case/v1/cases" )
556
556
.header ("Authorization" , token )
@@ -559,9 +559,8 @@ void invalidToken() {
559
559
560
560
// test without a token
561
561
WebSocketClient client = new StandardWebSocketClient ();
562
- client .execute (URI .create ("ws://localhost:" +
563
- this .localServerPort + "/study-notification/notify" ),
564
- ws -> ws .receive ().then ()).doOnSuccess (s -> Assertions .fail ("Should have thrown" ));
562
+ client .execute (URI .create ("ws://localhost:" + this .localServerPort + "/study-notification/notify" ), ws -> ws .receive ().then ())
563
+ .doOnSuccess (s -> fail ("Should have thrown" ));
565
564
}
566
565
567
566
@ Test
0 commit comments