### Question:
ZosmfAuthenticationProvider implements AuthenticationProvider { @Override public boolean supports(Class<?> auth) { return auth == UsernamePasswordAuthenticationToken.class; }  @Override Authentication authenticate(Authentication authentication); @Override boolean supports(Class<?> auth);  }### Answer:
@Test void shouldReturnTrueWhenSupportMethodIsCalledWithCorrectClass() { authConfigurationProperties.setZosmfServiceId(ZOSMF); final Application application = createApplication(zosmfInstance); when(discovery.getApplication(ZOSMF)).thenReturn(application); ZosmfService zosmfService = createZosmfService(); ZosmfAuthenticationProvider zosmfAuthenticationProvider = new ZosmfAuthenticationProvider(authenticationService, zosmfService); boolean supports = zosmfAuthenticationProvider.supports(usernamePasswordAuthentication.getClass()); assertTrue(supports); }
@Test void testSupports() { ZosmfAuthenticationProvider mock = new ZosmfAuthenticationProvider(null, null); assertTrue(mock.supports(UsernamePasswordAuthenticationToken.class)); assertFalse(mock.supports(Object.class)); assertFalse(mock.supports(AbstractAuthenticationToken.class)); assertFalse(mock.supports(JaasAuthenticationToken.class)); assertFalse(mock.supports(null)); }