### Question:
CompoundAuthProvider implements AuthenticationProvider { public void setLoginAuthProvider(String provider) { if ((environment != null) && Arrays.asList(environment.getActiveProfiles()).contains("diag")) { LoginProvider newProvider = LoginProvider.getLoginProvider(provider); if (newProvider == null) { newProvider = defaultProvider; } this.loginProvider = newProvider; warnForDummyProvider(newProvider.getValue()); } else { log.warn("Login Authentication provider can't be changed at runtime in the current profile."); } } CompoundAuthProvider(Map<String, AuthenticationProvider> authProvidersMap, Environment environment, @Value("${apiml.security.auth.provider:zosmf}") String defaultProviderName); String getLoginAuthProviderName(); void setLoginAuthProvider(String provider); @Override Authentication authenticate(Authentication authentication); @Override boolean supports(Class<?> authentication); static final String ORG_ZOWE_APIML_SECURITY_INVALID_AUTHENTICATION_PROVIDER; static final String ORG_ZOWE_APIML_SECURITY_LOGIN_ENDPOINT_IN_DUMMY_MODE; static final String DUMMY; }### Answer:
@Test void testSetLoginAuthProvider() { when(environment.getActiveProfiles()).thenReturn(new String[]{"diag"}); compoundAuthProvider.setLoginAuthProvider(LoginProvider.SAF.getValue()); String loginAuthProviderName = compoundAuthProvider.getLoginAuthProviderName(); assertEquals("saf", loginAuthProviderName); }