### Question:
SessionConfigurator extends ClientEndpointConfig.Configurator { @Override public void beforeRequest( Map<String, List<String>> headers ) { if ( withAuth ) { Header authenticationHeader = getAuthenticationHeader( url ); if ( authenticationHeader != null ) { headers .put( authenticationHeader.getName(), Collections.singletonList( authenticationHeader.getValue() ) ); } } } SessionConfigurator( URI url, String keytab, String principal ); @Override void beforeRequest( Map<String, List<String>> headers ); @Override void afterResponse( HandshakeResponse hr );  }### Answer:
@Test public void testNoAuthentication() throws URISyntaxException { sessionConfigurator = new SessionConfigurator( new URI( "ws: sessionConfigurator.beforeRequest( headers ); verify( headers, times( 0 ) ).put( any(), any() ); }
@Test public void testPrincipal() throws URISyntaxException, RuntimeException { sessionConfigurator = new SessionConfigurator( new URI( "ws: expectedException.expect( RuntimeException.class ); sessionConfigurator.beforeRequest( headers ); }
@Test public void testPrincipalKeytab() throws URISyntaxException, RuntimeException { sessionConfigurator = new SessionConfigurator( new URI( "ws: expectedException.expect( RuntimeException.class ); sessionConfigurator.beforeRequest( headers ); }