MfaProviderEndpoints implements ApplicationEventPublisherAware { @RequestMapping(method = GET) public ResponseEntity<List<MfaProvider>> retrieveMfaProviders() { String zoneId = IdentityZoneHolder.get().getId(); List<MfaProvider> providers = mfaProviderProvisioning.retrieveAll(zoneId); return new ResponseEntity<>(providers, HttpStatus.OK); }  @Override void setApplicationEventPublisher(ApplicationEventPublisher publisher); @RequestMapping(method = POST) ResponseEntity<MfaProvider> createMfaProvider(@RequestBody MfaProvider body); @RequestMapping(value = "{id}", method = PUT) ResponseEntity<MfaProvider> updateMfaProvider(); @RequestMapping(method = GET) ResponseEntity<List<MfaProvider>> retrieveMfaProviders(); @RequestMapping(value = "{id}", method = GET) ResponseEntity<MfaProvider> retrieveMfaProviderById(@PathVariable String id); @RequestMapping(value = "{id}", method = DELETE) ResponseEntity<MfaProvider> deleteMfaProviderById(@PathVariable String id); @ExceptionHandler(InvalidMfaProviderException.class) ResponseEntity<InvalidMfaProviderException> handleInvalidMfaProviderException(InvalidMfaProviderException e); @ExceptionHandler(MfaAlreadyExistsException.class) ResponseEntity<InvalidMfaProviderException> handleInvalidMfaProviderException(MfaAlreadyExistsException e); @ExceptionHandler(EmptyResultDataAccessException.class) ResponseEntity<EmptyResultDataAccessException> handleEmptyResultDataAccessException(EmptyResultDataAccessException e); @ExceptionHandler(MfaProviderUpdateIsNotAllowed.class) ResponseEntity<MfaProviderUpdateIsNotAllowed> handleMfaUpdatingNameOfActiveProvider(MfaProviderUpdateIsNotAllowed e); MfaProviderProvisioning getMfaProviderProvisioning(); void setMfaProviderProvisioning(MfaProviderProvisioning mfaProviderProvisioning); void setMfaProviderValidator(MfaProviderValidator mfaProviderValidator);  }
@Test public void testGetMfaProviders() { MfaProvider<GoogleMfaProviderConfig> mockProviderResponse = constructGoogleProvider(); when(provisioning.retrieveAll(anyString())).thenReturn(Collections.singletonList(mockProviderResponse)); ResponseEntity<List<MfaProvider>> mfaGetResponse = endpoint.retrieveMfaProviders(); assertEquals(mfaGetResponse.getBody().get(0), mockProviderResponse); verify(provisioning, times(1)).retrieveAll(IdentityZoneHolder.get().getId()); assertTrue("got response", mfaGetResponse.getStatusCode().is2xxSuccessful()); }