### Question:
OidcHelper extends AbstractService { public OAuthClientRequest buildOauthRequest(HttpServletRequest request, String code) throws OAuthSystemException { return OAuthClientRequest .tokenLocation(this.oidcConfiguration.getOidcTokenLocation()) .setGrantType(GrantType.AUTHORIZATION_CODE) .setClientId(this.oidcConfiguration.getOidcClientId()) .setRedirectURI(buildRedirectURI(request)) .setCode(code) .setParameter("response_mode", "form_post") .buildBodyMessage(); }  String buildOauthRequestString(HttpServletRequest req); UserDetails getOidcUser(String accessToken); @Override void init(); boolean isOidcActive(); OAuthClientRequest buildOauthRequest(HttpServletRequest request, String code);  }### Answer:
@Test public void testBuildOauthTokenRequest() throws Exception{ HttpServletRequest request = mock(HttpServletRequest.class); when(request.getRequestURL()).thenReturn(new StringBuffer("http: this.oidcConfiguration.setOidcClientId("test.client.id"); this.oidcConfiguration.setOidcTokenLocation("http: this.oidcConfiguration.setOidcAuthLocation("http: OAuthClientRequest clientRequest = oidcUserExtractor.buildOauthRequest(request,"some_code"); assertThat(clientRequest.getLocationUri(),is(equalTo("http: assertThat(clientRequest.getBody(),is(equalTo("code=some_code&grant_type=authorization_code&redirect_uri=http%3A%2F%2Fsome.domain.com%3A9090%2Fsomecontext%2Fpage%3Fsome_param%3Dvalue&client_id=test.client.id&response_mode=form_post"))); }