### Question:
StaticRequestFilter extends GenericHeapObject implements Filter { @Override public Promise<Response, NeverThrowsException> filter(final Context context, final Request request, final Handler next) { Bindings bindings = bindings(context, request); Request newRequest = new Request(); newRequest.setMethod(this.method); String value = this.uri.eval(bindings); if (value != null) { try { newRequest.setUri(value); } catch (URISyntaxException e) { logger.debug(e); String message = format("The URI %s was not valid", value); return Promises.newResultPromise(Responses.newInternalServerError(message, e)); } } else { String message = format("The URI expression '%s' could not be resolved", uri.toString()); logger.debug(message); return Promises.newResultPromise(Responses.newInternalServerError(message)); } if (entity != null) { newRequest.setEntity(entity.eval(bindings)); } if (this.version != null) { newRequest.setVersion(version); } for (String key : this.headers.keySet()) { for (Expression<String> expression : this.headers.get(key)) { String eval = expression.eval(bindings); if (eval != null) { newRequest.getHeaders().add(key, eval); } } } if (this.form != null && !this.form.isEmpty()) { Form f = new Form(); for (String key : this.form.keySet()) { for (Expression<String> expression : this.form.get(key)) { String eval = expression.eval(bindings); if (eval != null) { f.add(key, eval); } } } if ("POST".equals(newRequest.getMethod())) { f.toRequestEntity(newRequest); } else { f.appendRequestQuery(newRequest); } } return next.handle(context, newRequest); } StaticRequestFilter(final String method); void setEntity(final Expression<String> entity); void setUri(final Expression<String> uri); void setVersion(final String version); StaticRequestFilter addHeaderValue(final String key, final Expression<String> value); StaticRequestFilter addFormParameter(final String name, final Expression<String> value); @Override Promise<Response, NeverThrowsException> filter(final Context context,
                                                          final Request request,
                                                          final Handler next);  }### Answer:
@Test(dataProvider = "validConfigurations") public void shouldSucceedToCreateHeaplet(final JsonValue config) throws Exception { final StaticRequestFilter.Heaplet heaplet = new StaticRequestFilter.Heaplet(); final StaticRequestFilter filter = (StaticRequestFilter) heaplet.create(Name.of("myStaticRequestFilter"), config, buildDefaultHeap()); filter.filter(context, null, terminalHandler); assertThat(terminalHandler.request).isNotNull(); assertThat(terminalHandler.request.getUri()).isEqualTo(uri(URI)); }