### Question:
Oauth2Controller implements Oauth2Api { @Override public HrefType getAuthorizationUrl(Map<String, String> headers, Map<String, String> parameters) throws IOException { URI authorizationUrl = oauth2Service.getAuthorizationRequestUri(headers, new Parameters(parameters)); HrefType hrefTypeTO = new HrefType(); hrefTypeTO.setHref(authorizationUrl.toString()); return hrefTypeTO; } Oauth2Controller(Oauth2Service oauth2Service); @Override HrefType getAuthorizationUrl(Map<String, String> headers, Map<String, String> parameters); @Override TokenResponseTO getToken(Map<String, String> headers, Map<String, String> parameters);  }### Answer:
@Test void getAuthorizationUrl() throws Exception { when(oauth2Service.getAuthorizationRequestUri(anyMap(), any())) .thenReturn(URI.create(AUTHORISATION_URL)); mockMvc.perform(get(Oauth2Api.AUTHORIZATION_REQUEST_URI)) .andExpect(status().isOk()) .andExpect(jsonPath("$.href", containsString(AUTHORISATION_URL))); verify(oauth2Service, times(1)) .getAuthorizationRequestUri(anyMap(), any()); }