### Question:
CertificateSubjectClientIdOauth2Service implements Oauth2Service { @Override public TokenResponse getToken(Map<String, String> headers, Parameters parameters) throws IOException { parameters.setClientId(clientId(parameters)); return oauth2Service.getToken(headers, parameters); } CertificateSubjectClientIdOauth2Service(Oauth2Service oauth2Service, Pkcs12KeyStore keyStore); @Override URI getAuthorizationRequestUri(Map<String, String> headers, Parameters parameters); @Override TokenResponse getToken(Map<String, String> headers, Parameters parameters);  }### Answer:
@Test void getToken() throws KeyStoreException, IOException { when(pkcs12KeyStore.getOrganizationIdentifier()).thenReturn(organisationIdentifier); when(oauth2Service.getToken(any(), eq(parameters))).thenReturn(new TokenResponse()); service.getToken(null, parameters); verify(pkcs12KeyStore, times(1)).getOrganizationIdentifier(); verify(oauth2Service, times(1)).getToken(any(), captor.capture()); assertEquals(organisationIdentifier, captor.getValue().getClientId()); }