### Question:
RemoteOauth2Service implements Oauth2Service { @Override public TokenResponse getToken(Map<String, String> headers, Parameters parameters) throws IOException { return this.oauth2Mapper.toTokenResponse(this.oauth2Client.getToken(headers, parameters.asMap())); } RemoteOauth2Service(Oauth2Client oauth2Client); @Override URI getAuthorizationRequestUri(Map<String, String> headers, Parameters parameters); @Override TokenResponse getToken(Map<String, String> headers, Parameters parameters);  }### Answer:
@Test void getToken() throws IOException { Oauth2Service.Parameters parameters = new Oauth2Service.Parameters(); String accessToken = "access-token"; String tokenType = "token-type"; long expires = 60L; String scope = "test-scope"; String refreshToken = "refresh-token"; TokenResponseTO tokenTO = new TokenResponseTO(); tokenTO.setAccessToken(accessToken); tokenTO.setTokenType(tokenType); tokenTO.setExpiresInSeconds(expires); tokenTO.setRefreshToken(refreshToken); tokenTO.setScope(scope); doReturn(tokenTO).when(oauth2Client).getToken(anyMap(), any()); TokenResponse token = service.getToken(new HashMap<>(), parameters); assertThat(token.getAccessToken()).isEqualTo(accessToken); assertThat(token.getRefreshToken()).isEqualTo(refreshToken); assertThat(token.getTokenType()).isEqualTo(tokenType); assertThat(token.getExpiresInSeconds()).isEqualTo(expires); assertThat(token.getScope()).isEqualTo(scope); }