PropertyController implements Controller { @Override public Response execute(Request request) { accessControl.validate(request.clientIP()); return Response.text(properties()); } PropertyController(PropertyManager propertyManager); @Override Response execute(Request request);  }
@Test void execute() { var request = mock(Request.class); when(request.clientIP()).thenReturn("127.0.0.1"); Response response = controller.execute(request); assertThat(response.contentType()).get().isEqualTo(ContentType.TEXT_PLAIN); }