@Test void testGetSchema() { AuthenticationSchemeFactory asf = new AuthenticationSchemeFactory( mock(AuthenticationService.class), Arrays.asList( createScheme(AuthenticationScheme.BYPASS, true), createScheme(AuthenticationScheme.HTTP_BASIC_PASSTICKET, false), createScheme(AuthenticationScheme.ZOWE_JWT, false) ) ); assertEquals(AuthenticationScheme.BYPASS, asf.getSchema(AuthenticationScheme.BYPASS).getScheme()); assertEquals(AuthenticationScheme.HTTP_BASIC_PASSTICKET, asf.getSchema(AuthenticationScheme.HTTP_BASIC_PASSTICKET).getScheme()); assertEquals(AuthenticationScheme.ZOWE_JWT, asf.getSchema(AuthenticationScheme.ZOWE_JWT).getScheme()); assertEquals(AuthenticationScheme.BYPASS, asf.getSchema(null).getScheme()); }
public AbstractAuthenticationScheme getSchema(AuthenticationScheme scheme) { if (scheme == null) return defaultScheme; final AbstractAuthenticationScheme output = map.get(scheme); if (output == null) { throw new IllegalArgumentException("Unknown scheme : " + scheme); } return output; }
AuthenticationSchemeFactory { public AbstractAuthenticationScheme getSchema(AuthenticationScheme scheme) { if (scheme == null) return defaultScheme; final AbstractAuthenticationScheme output = map.get(scheme); if (output == null) { throw new IllegalArgumentException("Unknown scheme : " + scheme); } return output; } }
AuthenticationSchemeFactory { public AbstractAuthenticationScheme getSchema(AuthenticationScheme scheme) { if (scheme == null) return defaultScheme; final AbstractAuthenticationScheme output = map.get(scheme); if (output == null) { throw new IllegalArgumentException("Unknown scheme : " + scheme); } return output; } AuthenticationSchemeFactory(@Autowired AuthenticationService authenticationService, @Autowired List<AbstractAuthenticationScheme> schemes); }
AuthenticationSchemeFactory { public AbstractAuthenticationScheme getSchema(AuthenticationScheme scheme) { if (scheme == null) return defaultScheme; final AbstractAuthenticationScheme output = map.get(scheme); if (output == null) { throw new IllegalArgumentException("Unknown scheme : " + scheme); } return output; } AuthenticationSchemeFactory(@Autowired AuthenticationService authenticationService, @Autowired List<AbstractAuthenticationScheme> schemes); AbstractAuthenticationScheme getSchema(AuthenticationScheme scheme); AuthenticationCommand getAuthenticationCommand(Authentication authentication); }
AuthenticationSchemeFactory { public AbstractAuthenticationScheme getSchema(AuthenticationScheme scheme) { if (scheme == null) return defaultScheme; final AbstractAuthenticationScheme output = map.get(scheme); if (output == null) { throw new IllegalArgumentException("Unknown scheme : " + scheme); } return output; } AuthenticationSchemeFactory(@Autowired AuthenticationService authenticationService, @Autowired List<AbstractAuthenticationScheme> schemes); AbstractAuthenticationScheme getSchema(AuthenticationScheme scheme); AuthenticationCommand getAuthenticationCommand(Authentication authentication);  }