test_class.declarator: servlet = new ApiServlet()
test_class.modifier: private
test_class.original_string: private ApiServlet servlet = new ApiServlet();
test_class.type: ApiServlet
test_class.var_name: servlet
test_class.declarator: requestMock = Mockito.mock(HttpServletRequest.class)
test_class.modifier: private
test_class.original_string: private HttpServletRequest requestMock = Mockito.mock(HttpServletRequest.class);
test_class.type: HttpServletRequest
test_class.var_name: requestMock
test_class.declarator: responseMock = Mockito.mock(HttpServletResponse.class)
test_class.modifier: private
test_class.original_string: private HttpServletResponse responseMock = Mockito.mock(HttpServletResponse.class);
test_class.type: HttpServletResponse
test_class.var_name: responseMock
test_class.declarator: responseBody = new StringWriter()
test_class.modifier: private
test_class.original_string: private StringWriter responseBody = new StringWriter();
test_class.type: StringWriter
test_class.var_name: responseBody
test_class.declarator: postedBody
test_class.modifier: public
test_class.original_string: public JsonObject postedBody;
test_class.type: JsonObject
test_class.var_name: postedBody
test_class.declarator: admin
test_class.modifier: public
test_class.original_string: public Optional<Boolean> admin;
test_class.type: Optional<Boolean>
test_class.var_name: admin
test_class.declarator: amount
test_class.modifier: public
test_class.original_string: public int amount;
test_class.type: int
test_class.var_name: amount
test_class.declarator: contextRoot
test_class.modifier: private
test_class.original_string: private URL contextRoot;
test_class.type: URL
test_class.var_name: contextRoot
test_class.declarator: response = new FakeServletResponse()
test_class.modifier: private
test_class.original_string: private FakeServletResponse response = new FakeServletResponse();
test_class.type: FakeServletResponse
test_class.var_name: response
test_class.declarator: expectedLogEvents = new ExpectedLogEventsRule(Level.WARN)
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedLogEventsRule expectedLogEvents = new ExpectedLogEventsRule(Level.WARN);
test_class.type: ExpectedLogEventsRule
test_class.var_name: expectedLogEvents
test_class.file: action-controller/src/test/java/org/actioncontroller/servlet/ApiServletTest.java
test_class.identifier: ApiServletTest
test_case.body: @Test
      public void shouldRequireNonOptionalParameter() throws IOException {
          FakeServletRequest request = new FakeServletRequest("GET", contextRoot, "/api", "/goodbye");
          expectedLogEvents.expect(ApiControllerAction.class, Level.DEBUG,
                  "While processing ServletHttpExchange[GET " + contextRoot + "/api/goodbye] arguments to " +
                  "ApiControllerMethodAction{GET /goodbye => ControllerWithTypedParameters.methodWithRequiredInt(int)}: " +
                  new HttpRequestException("Missing required parameter amount"));
          servlet.service(request, response);
          assertThat(response.getStatus()).isEqualTo(400);
          assertThat(response.getStatusMessage()).isEqualTo("Missing required parameter amount");
      }
test_case.class_method_signature: ApiServletTest.shouldRequireNonOptionalParameter()
test_case.full_signature: @Test public void shouldRequireNonOptionalParameter()
test_case.identifier: shouldRequireNonOptionalParameter
test_case.invocations: expect service isEqualTo assertThat getStatus isEqualTo assertThat getStatusMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldRequireNonOptionalParameter()
focal_class.declarator: logger = LoggerFactory.getLogger(ApiServlet.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ApiServlet.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: controllers = new ArrayList<>()
focal_class.modifier: private final
focal_class.original_string: private final List<Object> controllers = new ArrayList<>();
focal_class.type: List<Object>
focal_class.var_name: controllers
focal_class.declarator: actions = new ApiControllerActionRouter()
focal_class.modifier: private final
focal_class.original_string: private final ApiControllerActionRouter actions = new ApiControllerActionRouter();
focal_class.type: ApiControllerActionRouter
focal_class.var_name: actions
focal_class.declarator: context = new ApiControllerContext()
focal_class.modifier: private final
focal_class.original_string: private final ApiControllerContext context = new ApiControllerContext();
focal_class.type: ApiControllerContext
focal_class.var_name: context
focal_class.declarator: timerRegistery = TimerRegistry.NULL
focal_class.modifier: private
focal_class.original_string: private TimerRegistry timerRegistery = TimerRegistry.NULL;
focal_class.type: TimerRegistry
focal_class.var_name: timerRegistery
focal_class.declarator: controllerException
focal_class.modifier: private
focal_class.original_string: private ActionControllerConfigurationCompositeException controllerException;
focal_class.type: ActionControllerConfigurationCompositeException
focal_class.var_name: controllerException
focal_class.file: action-controller/src/main/java/org/actioncontroller/servlet/ApiServlet.java
focal_class.identifier: ApiServlet
focal_class.interfaces: implements UserContext
focal_class.class_method_signature: ApiServlet.ApiServlet()
focal_class.full_signature: public  ApiServlet()
focal_class.identifier: ApiServlet
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ApiServlet()
focal_class.class_method_signature: ApiServlet.ApiServlet(Object controller)
focal_class.full_signature: public  ApiServlet(Object controller)
focal_class.identifier: ApiServlet
focal_class.modifiers: public
focal_class.parameters: (Object controller)
focal_class.signature:  ApiServlet(Object controller)
focal_class.class_method_signature: ApiServlet.getContext()
focal_class.full_signature: public ApiControllerContext getContext()
focal_class.identifier: getContext
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ApiControllerContext
focal_class.signature: ApiControllerContext getContext()
focal_class.class_method_signature: ApiServlet.isUserLoggedIn(ApiHttpExchange exchange)
focal_class.full_signature: @Override public boolean isUserLoggedIn(ApiHttpExchange exchange)
focal_class.identifier: isUserLoggedIn
focal_class.modifiers: @Override public
focal_class.parameters: (ApiHttpExchange exchange)
focal_class.return: boolean
focal_class.signature: boolean isUserLoggedIn(ApiHttpExchange exchange)
focal_class.class_method_signature: ApiServlet.isUserInRole(ApiHttpExchange exchange, String role)
focal_class.full_signature: @Override public boolean isUserInRole(ApiHttpExchange exchange, String role)
focal_class.identifier: isUserInRole
focal_class.modifiers: @Override public
focal_class.parameters: (ApiHttpExchange exchange, String role)
focal_class.return: boolean
focal_class.signature: boolean isUserInRole(ApiHttpExchange exchange, String role)
focal_class.class_method_signature: ApiServlet.service(HttpServletRequest req, HttpServletResponse resp)
focal_class.full_signature: @Override protected void service(HttpServletRequest req, HttpServletResponse resp)
focal_class.identifier: service
focal_class.modifiers: @Override protected
focal_class.parameters: (HttpServletRequest req, HttpServletResponse resp)
focal_class.return: void
focal_class.signature: void service(HttpServletRequest req, HttpServletResponse resp)
focal_class.class_method_signature: ApiServlet.invokeAction(ApiHttpExchange httpExchange)
focal_class.full_signature: private void invokeAction(ApiHttpExchange httpExchange)
focal_class.identifier: invokeAction
focal_class.modifiers: private
focal_class.parameters: (ApiHttpExchange httpExchange)
focal_class.return: void
focal_class.signature: void invokeAction(ApiHttpExchange httpExchange)
focal_class.class_method_signature: ApiServlet.registerController(Object controller)
focal_class.full_signature: public void registerController(Object controller)
focal_class.identifier: registerController
focal_class.modifiers: public
focal_class.parameters: (Object controller)
focal_class.return: void
focal_class.signature: void registerController(Object controller)
focal_class.class_method_signature: ApiServlet.registerControllers(Object... controllers)
focal_class.full_signature: public void registerControllers(Object... controllers)
focal_class.identifier: registerControllers
focal_class.modifiers: public
focal_class.parameters: (Object... controllers)
focal_class.return: void
focal_class.signature: void registerControllers(Object... controllers)
focal_class.class_method_signature: ApiServlet.registerControllerList(List<Object> controllers)
focal_class.full_signature: public void registerControllerList(List<Object> controllers)
focal_class.identifier: registerControllerList
focal_class.modifiers: public
focal_class.parameters: (List<Object> controllers)
focal_class.return: void
focal_class.signature: void registerControllerList(List<Object> controllers)
focal_class.class_method_signature: ApiServlet.init(ServletConfig config)
focal_class.full_signature: @Override public void init(ServletConfig config)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (ServletConfig config)
focal_class.return: void
focal_class.signature: void init(ServletConfig config)
focal_class.class_method_signature: ApiServlet.setupActions()
focal_class.full_signature: protected void setupActions()
focal_class.identifier: setupActions
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setupActions()
focal_class.class_method_signature: ApiServlet.registerMBeans()
focal_class.full_signature: public void registerMBeans()
focal_class.identifier: registerMBeans
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void registerMBeans()
focal_class.class_method_signature: ApiServlet.registerMBeans(MBeanServer mBeanServer)
focal_class.full_signature: public void registerMBeans(MBeanServer mBeanServer)
focal_class.identifier: registerMBeans
focal_class.modifiers: public
focal_class.parameters: (MBeanServer mBeanServer)
focal_class.return: void
focal_class.signature: void registerMBeans(MBeanServer mBeanServer)
focal_class.class_method_signature: ApiServlet.getTimerRegistry()
focal_class.full_signature: @Override public TimerRegistry getTimerRegistry()
focal_class.identifier: getTimerRegistry
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: TimerRegistry
focal_class.signature: TimerRegistry getTimerRegistry()
focal_class.class_method_signature: ApiServlet.setTimerRegistry(TimerRegistry timerRegistry)
focal_class.full_signature: public void setTimerRegistry(TimerRegistry timerRegistry)
focal_class.identifier: setTimerRegistry
focal_class.modifiers: public
focal_class.parameters: (TimerRegistry timerRegistry)
focal_class.return: void
focal_class.signature: void setTimerRegistry(TimerRegistry timerRegistry)
focal_class.superclass: extends HttpServlet
focal_method.body: @Override
      protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException {
          try (
                  MDC.MDCCloseable ignored = MDC.putCloseable("clientIp", req.getRemoteAddr());
                  MDC.MDCCloseable ignored2 = MDC.putCloseable("requestPath", req.getContextPath() + req.getServletPath() + req.getPathInfo())
          ) {
              controllerException.verifyNoExceptions();
              invokeAction(new ServletHttpExchange(req, resp));
          }
      }
focal_method.class_method_signature: ApiServlet.service(HttpServletRequest req, HttpServletResponse resp)
focal_method.full_signature: @Override protected void service(HttpServletRequest req, HttpServletResponse resp)
focal_method.identifier: service
focal_method.invocations: putCloseable getRemoteAddr putCloseable getContextPath getServletPath getPathInfo verifyNoExceptions invokeAction
focal_method.modifiers: @Override protected
focal_method.parameters: (HttpServletRequest req, HttpServletResponse resp)
focal_method.return: void
focal_method.signature: void service(HttpServletRequest req, HttpServletResponse resp)