@Test public void getTopNonCompliantAppsTest() throws Exception { when(patchingService.getNonCompliantNumberForAG(anyString())).thenReturn(CommonTestUtil.getListMapObject()); assertThat(patchingController.getTopNonCompliantApps("ag"), is(notNullValue())); assertThat(patchingController.getTopNonCompliantApps(""), is(notNullValue())); when(patchingService.getNonCompliantNumberForAG(anyString())).thenThrow(new ServiceException()); when(complianceService.formatException(anyObject())).thenReturn(ResponseUtils.buildFailureResponse(new ServiceException())); ResponseEntity<Object> responseObj = patchingController.getTopNonCompliantApps("ag"); assertTrue(responseObj.getStatusCode() == HttpStatus.EXPECTATION_FAILED); }
@RequestMapping(path = "/v1/patching/topnoncompliantapps", method = RequestMethod.GET) public ResponseEntity<Object> getTopNonCompliantApps(@RequestParam(name = "ag", required = true) String assetGroup) { ResponseData response = null; try { response = new ResponseData(patchingService.getNonCompliantNumberForAG(assetGroup)); } catch (ServiceException e) { return complianceService.formatException(e); } return ResponseUtils.buildSucessResponse(response); }
PatchingController implements Constants { @RequestMapping(path = "/v1/patching/topnoncompliantapps", method = RequestMethod.GET) public ResponseEntity<Object> getTopNonCompliantApps(@RequestParam(name = "ag", required = true) String assetGroup) { ResponseData response = null; try { response = new ResponseData(patchingService.getNonCompliantNumberForAG(assetGroup)); } catch (ServiceException e) { return complianceService.formatException(e); } return ResponseUtils.buildSucessResponse(response); } }
PatchingController implements Constants { @RequestMapping(path = "/v1/patching/topnoncompliantapps", method = RequestMethod.GET) public ResponseEntity<Object> getTopNonCompliantApps(@RequestParam(name = "ag", required = true) String assetGroup) { ResponseData response = null; try { response = new ResponseData(patchingService.getNonCompliantNumberForAG(assetGroup)); } catch (ServiceException e) { return complianceService.formatException(e); } return ResponseUtils.buildSucessResponse(response); }  }
PatchingController implements Constants { @RequestMapping(path = "/v1/patching/topnoncompliantapps", method = RequestMethod.GET) public ResponseEntity<Object> getTopNonCompliantApps(@RequestParam(name = "ag", required = true) String assetGroup) { ResponseData response = null; try { response = new ResponseData(patchingService.getNonCompliantNumberForAG(assetGroup)); } 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); }
PatchingController implements Constants { @RequestMapping(path = "/v1/patching/topnoncompliantapps", method = RequestMethod.GET) public ResponseEntity<Object> getTopNonCompliantApps(@RequestParam(name = "ag", required = true) String assetGroup) { ResponseData response = null; try { response = new ResponseData(patchingService.getNonCompliantNumberForAG(assetGroup)); } 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);  }