### Question:
UsersSaveServlet extends SlingAllMethodsServlet { public void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException, ServletException { response.setContentType("application/json"); response.setCharacterEncoding("UTF-8"); final ValueMap properties = request.getResource().adaptTo(ModifiableValueMap.class); final Parameters parameters = new Parameters(request); properties.put(GROUP_FILTER, parameters.getGroupFilter()); properties.put(GROUPS, parameters.getGroups()); properties.put(CUSTOM_PROPERTIES, parameters.getCustomProperties()); request.getResourceResolver().commit(); }  void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response);  }### Answer:
@Test public void testPost() throws Exception { UsersSaveServlet servlet = new UsersSaveServlet(); Map<String,Object> params = new HashMap<>(); params.put("params", UserExportServletTest.buildParameterObject("direct", "somegroup")); context.request().setParameterMap(params); servlet.doPost(context.request(), context.response()); assertEquals(context.response().getStatus(), 200); context.resourceResolver().refresh(); Resource resource = context.resourceResolver().getResource(PATH); ValueMap vm = resource.getValueMap(); assertNotNull(vm); assertEquals("direct",vm.get(Constants.GROUP_FILTER,"default")); assertEquals("somegroup",vm.get(Constants.GROUPS,"default")); assertEquals("abc",vm.get(Constants.CUSTOM_PROPERTIES,"default")); }