@Test public void getUntaggedAssetsByAppTest() throws Exception { Request request = new Request(); request.setAg("ag"); Request request1 = new Request(); when(taggingService.getUnTaggedAssetsByApplication(anyObject())).thenReturn(CommonTestUtil.getResponseWithCount()); assertThat(taggingController.getUntaggedAssetsByApp(request), is(notNullValue())); assertThat(taggingController.getUntaggedAssetsByApp(request1), is(notNullValue())); when(taggingService.getUnTaggedAssetsByApplication(anyObject())).thenThrow(new ServiceException()); when(complianceService.formatException(anyObject())).thenReturn(ResponseUtils.buildFailureResponse(new ServiceException())); ResponseEntity<Object> responseObj = taggingController.getUntaggedAssetsByApp(request); assertTrue(responseObj.getStatusCode() == HttpStatus.EXPECTATION_FAILED); }
@RequestMapping(path = "/v1/tagging/summarybyapplication", method = RequestMethod.POST) @ResponseBody public ResponseEntity<Object> getUntaggedAssetsByApp(@RequestBody(required = false) Request request) { String assetGroup = request.getAg(); if (Strings.isNullOrEmpty(assetGroup)) { return ResponseUtils.buildFailureResponse(new Exception(ASSET_MANDATORY)); } ResponseWithCount response = null; try { response = taggingService.getUnTaggedAssetsByApplication(request); } catch (ServiceException e) { return complianceService.formatException(e); } return ResponseUtils.buildSucessResponse(response); }
TaggingController implements Constants { @RequestMapping(path = "/v1/tagging/summarybyapplication", method = RequestMethod.POST) @ResponseBody public ResponseEntity<Object> getUntaggedAssetsByApp(@RequestBody(required = false) Request request) { String assetGroup = request.getAg(); if (Strings.isNullOrEmpty(assetGroup)) { return ResponseUtils.buildFailureResponse(new Exception(ASSET_MANDATORY)); } ResponseWithCount response = null; try { response = taggingService.getUnTaggedAssetsByApplication(request); } catch (ServiceException e) { return complianceService.formatException(e); } return ResponseUtils.buildSucessResponse(response); } }
TaggingController implements Constants { @RequestMapping(path = "/v1/tagging/summarybyapplication", method = RequestMethod.POST) @ResponseBody public ResponseEntity<Object> getUntaggedAssetsByApp(@RequestBody(required = false) Request request) { String assetGroup = request.getAg(); if (Strings.isNullOrEmpty(assetGroup)) { return ResponseUtils.buildFailureResponse(new Exception(ASSET_MANDATORY)); } ResponseWithCount response = null; try { response = taggingService.getUnTaggedAssetsByApplication(request); } catch (ServiceException e) { return complianceService.formatException(e); } return ResponseUtils.buildSucessResponse(response); }  }
TaggingController implements Constants { @RequestMapping(path = "/v1/tagging/summarybyapplication", method = RequestMethod.POST) @ResponseBody public ResponseEntity<Object> getUntaggedAssetsByApp(@RequestBody(required = false) Request request) { String assetGroup = request.getAg(); if (Strings.isNullOrEmpty(assetGroup)) { return ResponseUtils.buildFailureResponse(new Exception(ASSET_MANDATORY)); } ResponseWithCount response = null; try { response = taggingService.getUnTaggedAssetsByApplication(request); } catch (ServiceException e) { return complianceService.formatException(e); } return ResponseUtils.buildSucessResponse(response); }  @RequestMapping(path = "/v1/tagging/summarybyapplication", method = RequestMethod.POST) @ResponseBody ResponseEntity<Object> getUntaggedAssetsByApp(@RequestBody(required = false) Request request); @RequestMapping(path = "/v1/tagging/compliance", method = RequestMethod.GET) ResponseEntity<Object> taggingSummary(@RequestParam("ag") String assetGroup); @RequestMapping(path = "/v1/tagging/summarybytargettype", method = RequestMethod.POST) @ResponseBody ResponseEntity<Object> untaggingByTargetTypes(@RequestBody UntaggedTargetTypeRequest request); @RequestMapping(path = "/v1/tagging/taggingByApplication", method = RequestMethod.GET) ResponseEntity<Object> taggingByApplication(@RequestParam("ag") String assetGroup,
            @RequestParam(name = "targetType", required = false) String targetType); }
TaggingController implements Constants { @RequestMapping(path = "/v1/tagging/summarybyapplication", method = RequestMethod.POST) @ResponseBody public ResponseEntity<Object> getUntaggedAssetsByApp(@RequestBody(required = false) Request request) { String assetGroup = request.getAg(); if (Strings.isNullOrEmpty(assetGroup)) { return ResponseUtils.buildFailureResponse(new Exception(ASSET_MANDATORY)); } ResponseWithCount response = null; try { response = taggingService.getUnTaggedAssetsByApplication(request); } catch (ServiceException e) { return complianceService.formatException(e); } return ResponseUtils.buildSucessResponse(response); }  @RequestMapping(path = "/v1/tagging/summarybyapplication", method = RequestMethod.POST) @ResponseBody ResponseEntity<Object> getUntaggedAssetsByApp(@RequestBody(required = false) Request request); @RequestMapping(path = "/v1/tagging/compliance", method = RequestMethod.GET) ResponseEntity<Object> taggingSummary(@RequestParam("ag") String assetGroup); @RequestMapping(path = "/v1/tagging/summarybytargettype", method = RequestMethod.POST) @ResponseBody ResponseEntity<Object> untaggingByTargetTypes(@RequestBody UntaggedTargetTypeRequest request); @RequestMapping(path = "/v1/tagging/taggingByApplication", method = RequestMethod.GET) ResponseEntity<Object> taggingByApplication(@RequestParam("ag") String assetGroup,
            @RequestParam(name = "targetType", required = false) String targetType);  }