### Question:
HandlerManagementService extends RegistryAbstractAdmin implements
        IHandlerManagementService<SimulationResponse, SimulationRequest> { public SimulationResponse simulate(SimulationRequest request) throws Exception { Registry rootRegistry = getRootRegistry(); CommonUtil.simulateRegistryOperation(rootRegistry, request); return CommonUtil.getSimulationResponse(); }  String getHandlerCollectionLocation(); void setHandlerCollectionLocation(String location); String[] getHandlerList(); String getHandlerConfiguration(String name); boolean deleteHandler(String name); boolean createHandler(String payload); boolean updateHandler(String oldName, String payload); SimulationResponse simulate(SimulationRequest request);  }### Answer:
@Test public void simulate() throws Exception { MessageContext messageContext = new MessageContext(); HttpServletRequest servletRequest = mock(HttpServletRequest.class); HttpSession session = mock(HttpSession.class); when(session.getAttribute(RegistryConstants.ROOT_REGISTRY_INSTANCE)).thenReturn(registry); when(servletRequest.getSession()).thenReturn(session); messageContext.setProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST, servletRequest); AxisService axisService = new AxisService(); axisService.addParameter(new Parameter(CarbonConstants.ADMIN_SERVICE_PARAM_NAME, "true")); messageContext.setAxisService(axisService); MessageContext.setCurrentMessageContext(messageContext); final SimulationRequest simulationRequest = new SimulationRequest(); simulationRequest.setOperation("resourceexists"); simulationRequest.setPath("/test/2017/10/18"); CommonUtil.setSimulationService(new RegistryCoreServiceComponent.DefaultSimulationService()); HandlerManagementService managementService = new HandlerManagementService(); managementService.simulate(simulationRequest); assertNotNull(CommonUtil.getSimulationResponse().getStatus()); assertEquals(3, CommonUtil.getSimulationResponse().getStatus().length); }