### Question:
HttpRequestHandler extends SimpleChannelUpstreamHandler { protected HttpRequest mapRequest(HttpRequest request, MappingEndpoint mapping, MappingConfig config, HttpResponse tokenValidationResponse) throws MappingException, UpstreamException { BaseMapper mapper = new BaseMapper(); request.headers().set(HttpHeaders.Names.HOST, mapping.getBackendHost()); HttpRequest req = mapper.map(request, mapping.getInternalEndpoint()); if (mapping.getAction() != null) { BasicAction action = config.getAction(mapping.getAction()); req = action.execute(req, tokenValidationResponse, mapping); } return req; }  @Override void messageReceived(ChannelHandlerContext ctx, MessageEvent e);  }### Answer:
@Test public void when_invoke_action_pass_request_uri() throws Exception { HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/v0.1/countries?id=BUL"); MappingEndpoint mapping = mock(MappingEndpoint.class); willReturn("http: MappingConfig config = mock(MappingConfig.class); HttpResponse validationResponse = mock(HttpResponse.class); willReturn("/countries").given(mapping).getInternalEndpoint(); MappingAction action = mock(MappingAction.class); willReturn(action).given(mapping).getAction(); ReplaceCustomerIdAction replaceAction = mock(ReplaceCustomerIdAction.class); willReturn(replaceAction).given(config).getAction(action); willReturn(request).given(replaceAction).execute(request, "/countries?id=BUL", validationResponse); handler.mapRequest(request, mapping, config, validationResponse); verify(replaceAction).execute(request, validationResponse, mapping); }