2020 */
2121package eu .openanalytics .containerproxy .test .proxy ;
2222
23- import static org .junit .Assert .assertEquals ;
24-
25- import java .util .HashSet ;
26- import java .util .Set ;
27-
28- import javax .inject .Inject ;
29-
30- import org .junit .Before ;
31- import org .junit .Test ;
32- import org .junit .runner .RunWith ;
23+ import eu .openanalytics .containerproxy .ContainerProxyApplication ;
24+ import eu .openanalytics .containerproxy .model .runtime .Proxy ;
25+ import eu .openanalytics .containerproxy .model .runtime .RuntimeSetting ;
26+ import org .junit .jupiter .api .Assertions ;
27+ import org .junit .jupiter .api .BeforeEach ;
28+ import org .junit .jupiter .api .Test ;
29+ import org .junit .jupiter .api .extension .ExtendWith ;
3330import org .springframework .boot .test .context .SpringBootTest ;
3431import org .springframework .boot .test .context .SpringBootTest .WebEnvironment ;
3532import org .springframework .boot .test .web .client .TestRestTemplate ;
4239import org .springframework .http .ResponseEntity ;
4340import org .springframework .test .context .ActiveProfiles ;
4441import org .springframework .test .context .ContextConfiguration ;
45- import org .springframework .test .context .junit4 . SpringRunner ;
42+ import org .springframework .test .context .junit . jupiter . SpringExtension ;
4643
47- import eu . openanalytics . containerproxy . ContainerProxyApplication ;
48- import eu . openanalytics . containerproxy . model . runtime . Proxy ;
49- import eu . openanalytics . containerproxy . model . runtime . RuntimeSetting ;
44+ import javax . inject . Inject ;
45+ import java . util . HashSet ;
46+ import java . util . Set ;
5047
5148@ SpringBootTest (classes = { ContainerProxyApplication .class }, webEnvironment = WebEnvironment .RANDOM_PORT )
52- @ RunWith ( SpringRunner .class )
49+ @ ExtendWith ( SpringExtension .class )
5350@ ActiveProfiles ("test" )
5451@ ContextConfiguration (initializers = PropertyOverrideContextInitializer .class )
5552public class TestConcurrentUsers {
@@ -67,7 +64,7 @@ public class TestConcurrentUsers {
6764 private String [] user2 ;
6865 private String [] specIds ;
6966
70- @ Before
67+ @ BeforeEach
7168 public void init () {
7269 user1 = new String [] { environment .getProperty ("proxy.users[0].name" ),
7370 environment .getProperty ("proxy.users[0].password" ) };
@@ -124,7 +121,7 @@ private String loginAndLaunchProxy(String username, String password, String spec
124121
125122 ResponseEntity <Proxy > createProxyResponse = this .restTemplate .withBasicAuth (username , password ).postForEntity (
126123 "http://localhost:" + port + "/api/proxy/{proxySpecId}" , createProxyRequest , Proxy .class , specId );
127- assertEquals (201 , createProxyResponse .getStatusCodeValue ());
124+ Assertions . assertEquals (201 , createProxyResponse .getStatusCodeValue ());
128125
129126 Proxy createdProxy = createProxyResponse .getBody ();
130127 Thread .sleep (1000 );
@@ -141,8 +138,8 @@ private void doDeleteProxy(String proxyId, String username, String password) {
141138 ResponseEntity <String > deleteProxyResponse = this .restTemplate
142139 .withBasicAuth (username , password )
143140 .exchange ("http://localhost:" + port + "/api/proxy/{proxyId}" , HttpMethod .DELETE , null , String .class , proxyId );
144-
145- assertEquals (200 , deleteProxyResponse .getStatusCodeValue ());
141+
142+ Assertions . assertEquals (200 , deleteProxyResponse .getStatusCodeValue ());
146143 }
147144
148145 private byte [] doGetEndpoint (String endpoint , String username , String password ) {
@@ -151,7 +148,7 @@ private byte[] doGetEndpoint(String endpoint, String username, String password)
151148
152149 ResponseEntity <String > getEndpointResponse = this .restTemplate .withBasicAuth (username , password )
153150 .getForEntity ("http://localhost:" + port + "/api/route/" + endpoint , String .class );
154- assertEquals (200 , getEndpointResponse .getStatusCodeValue ());
151+ Assertions . assertEquals (200 , getEndpointResponse .getStatusCodeValue ());
155152
156153 return getEndpointResponse .getBody ().getBytes ();
157154 }
0 commit comments