### Question:
PatchingController implements Constants { @RequestMapping(path = "/v1/patching/quarters", method = RequestMethod.POST) public ResponseEntity<Object> getQuartersWithPatchingData(String assetGroup) { Map<String, Object> response = new HashMap<>(); try { List<Map<String, Object>> quarterList = patchingService.getQuartersWithPatchingData(assetGroup); response.put("response", quarterList); } catch (ServiceException e) { return complianceService.formatException(e); } return ResponseUtils.buildSucessResponse(response); }  @RequestMapping(path = "/v1/patching/topnoncompliantapps", method = RequestMethod.GET) ResponseEntity<Object> getTopNonCompliantApps(@RequestParam(name = "ag", required = true) String assetGroup); @RequestMapping(path = "/v1/patching/topnoncompliantexecs", method = RequestMethod.GET) ResponseEntity<Object> getTopNonCompliantExecs(@RequestParam(name = "ag", required = true) String assetGroup); @RequestMapping(path = "/v1/patching/detail", method = RequestMethod.POST) ResponseEntity<Object> getPatchingDetails(@RequestBody(required = true) Request request); @RequestMapping(path = "/v1/patching/progress", method = RequestMethod.POST) ResponseEntity<Object> getPatchingProgress(@RequestBody(required = true) PatchingRequest request); @RequestMapping(path = "/v1/patching/quarters", method = RequestMethod.POST) ResponseEntity<Object> getQuartersWithPatchingData(String assetGroup); @RequestMapping(path = "/v1/patching/rating", method = RequestMethod.GET) ResponseEntity<Object> getPatchingDataForAgForQuarter(String ag, int quarter, int year);  }### Answer:
@Test public void getQuartersWithPatchingDataTest() throws Exception { when(patchingService.getQuartersWithPatchingData(anyString())).thenReturn(CommonTestUtil.getListMapObject()); assertThat(patchingController.getQuartersWithPatchingData("ag"), is(notNullValue())); assertThat(patchingController.getQuartersWithPatchingData(""), is(notNullValue())); when(patchingService.getQuartersWithPatchingData(anyString())).thenThrow(new ServiceException()); when(complianceService.formatException(anyObject())).thenReturn(ResponseUtils.buildFailureResponse(new ServiceException())); ResponseEntity<Object> responseObj = patchingController.getQuartersWithPatchingData(anyString()); assertTrue(responseObj.getStatusCode() == HttpStatus.EXPECTATION_FAILED); }