1212 */
1313package com .labs64 .netlicensing .service ;
1414
15- import static org .junit .Assert .assertEquals ;
16- import static org .junit .Assert .assertTrue ;
15+ import java .util .Base64 ;
1716
1817import javax .ws .rs .GET ;
1918import javax .ws .rs .HeaderParam ;
2019import javax .ws .rs .HttpMethod ;
2120import javax .ws .rs .Path ;
2221import javax .ws .rs .core .Response ;
2322
24- import org .glassfish .jersey .internal .util .Base64 ;
2523import org .junit .Test ;
2624
2725import com .labs64 .netlicensing .domain .vo .Context ;
3028import com .labs64 .netlicensing .schema .context .Netlicensing ;
3129import com .labs64 .netlicensing .schema .context .ObjectFactory ;
3230
31+ import static org .junit .Assert .assertEquals ;
32+ import static org .junit .Assert .assertTrue ;
33+
3334/**
3435 * Tests for checking the ability to connect to services using different security modes
3536 */
@@ -51,7 +52,7 @@ public void testBasicAuthentication() throws Exception {
5152
5253 assertTrue (authHeader .startsWith ("Basic " ));
5354
54- final String [] userAndPassword = Base64 .decodeAsString ( authHeader .substring (6 )).split (":" );
55+ final String [] userAndPassword = new String ( Base64 .getDecoder (). decode ( authHeader .substring (6 ) )).split (":" );
5556 assertEquals ("user1" , userAndPassword [0 ]);
5657 assertEquals ("pswrd" , userAndPassword [1 ]);
5758 }
@@ -69,7 +70,7 @@ public void testApiKeyIdentification() throws Exception {
6970
7071 assertTrue (authHeader .startsWith ("Basic " ));
7172
72- final String [] headerArray = Base64 .decodeAsString ( authHeader .substring (6 )).split (":" );
73+ final String [] headerArray = new String ( Base64 .getDecoder (). decode ( authHeader .substring (6 ) )).split (":" );
7374 assertEquals ("apiKey" , headerArray [0 ]);
7475 assertEquals ("TEST_API_KEY" , headerArray [1 ]);
7576
0 commit comments