@Test public void getAllTargetTypesByExceptionNameAndDataSourceTest() throws Exception { when(assetGroupExceptionService.getAllTargetTypesByExceptionNameAndDataSource(anyString(), anyString())).thenReturn(getStickyExceptionResponseResponse()); mockMvc.perform(get("/asset-group-exception/list-by-name-and-datasource") .param("exceptionName", "exceptionName123") .param("dataSource", "dataSource123") .contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.message", is("success"))) .andExpect(jsonPath("$.data.exceptionName", is("exceptionName123"))); }
@ApiOperation(httpMethod = "GET", value = "API to get all asset group exception details by exception name and datasource", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/list-by-name-and-datasource", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> getAllTargetTypesByExceptionNameAndDataSource( @ApiParam(value = "provide valid exception name", required = true) @RequestParam(defaultValue="", name = "exceptionName", required = true) String exceptionName, @ApiParam(value = "provide valid datasource", required = true) @RequestParam(defaultValue="", name = "dataSource", required = true) String dataSource) { try { return ResponseUtils.buildSucessResponse(assetGroupExceptionService.getAllTargetTypesByExceptionNameAndDataSource(exceptionName, dataSource)); } catch (Exception exception) { log.error(UNEXPECTED_ERROR_OCCURRED, exception); return ResponseUtils.buildFailureResponse(new Exception(UNEXPECTED_ERROR_OCCURRED), exception.getMessage()); } }
AssetGroupExceptionController { @ApiOperation(httpMethod = "GET", value = "API to get all asset group exception details by exception name and datasource", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/list-by-name-and-datasource", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> getAllTargetTypesByExceptionNameAndDataSource( @ApiParam(value = "provide valid exception name", required = true) @RequestParam(defaultValue="", name = "exceptionName", required = true) String exceptionName, @ApiParam(value = "provide valid datasource", required = true) @RequestParam(defaultValue="", name = "dataSource", required = true) String dataSource) { try { return ResponseUtils.buildSucessResponse(assetGroupExceptionService.getAllTargetTypesByExceptionNameAndDataSource(exceptionName, dataSource)); } catch (Exception exception) { log.error(UNEXPECTED_ERROR_OCCURRED, exception); return ResponseUtils.buildFailureResponse(new Exception(UNEXPECTED_ERROR_OCCURRED), exception.getMessage()); } } }
AssetGroupExceptionController { @ApiOperation(httpMethod = "GET", value = "API to get all asset group exception details by exception name and datasource", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/list-by-name-and-datasource", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> getAllTargetTypesByExceptionNameAndDataSource( @ApiParam(value = "provide valid exception name", required = true) @RequestParam(defaultValue="", name = "exceptionName", required = true) String exceptionName, @ApiParam(value = "provide valid datasource", required = true) @RequestParam(defaultValue="", name = "dataSource", required = true) String dataSource) { try { return ResponseUtils.buildSucessResponse(assetGroupExceptionService.getAllTargetTypesByExceptionNameAndDataSource(exceptionName, dataSource)); } catch (Exception exception) { log.error(UNEXPECTED_ERROR_OCCURRED, exception); return ResponseUtils.buildFailureResponse(new Exception(UNEXPECTED_ERROR_OCCURRED), exception.getMessage()); } }  }
AssetGroupExceptionController { @ApiOperation(httpMethod = "GET", value = "API to get all asset group exception details by exception name and datasource", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/list-by-name-and-datasource", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> getAllTargetTypesByExceptionNameAndDataSource( @ApiParam(value = "provide valid exception name", required = true) @RequestParam(defaultValue="", name = "exceptionName", required = true) String exceptionName, @ApiParam(value = "provide valid datasource", required = true) @RequestParam(defaultValue="", name = "dataSource", required = true) String dataSource) { try { return ResponseUtils.buildSucessResponse(assetGroupExceptionService.getAllTargetTypesByExceptionNameAndDataSource(exceptionName, dataSource)); } catch (Exception exception) { log.error(UNEXPECTED_ERROR_OCCURRED, exception); return ResponseUtils.buildFailureResponse(new Exception(UNEXPECTED_ERROR_OCCURRED), exception.getMessage()); } }  @ApiOperation(httpMethod = "GET", value = "API to get all asset group exception details", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getAllAssetGroupExceptionDetails(
		@ApiParam(value = "provide valid page number", required = true) @RequestParam("page") Integer page,
		@ApiParam(value = "provide valid page size", required = true) @RequestParam("size") Integer size,
		@ApiParam(value = "provide valid search term", required = false) @RequestParam(defaultValue  =StringUtils.EMPTY, name = "searchTerm", required = false) String searchTerm); @ApiOperation(httpMethod = "GET", value = "API to get all asset group exception details by exception name and datasource", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/list-by-name-and-datasource", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getAllTargetTypesByExceptionNameAndDataSource(
		@ApiParam(value = "provide valid exception name", required = true) @RequestParam(defaultValue="", name = "exceptionName", required = true) String exceptionName,
		@ApiParam(value = "provide valid datasource", required = true) @RequestParam(defaultValue="", name = "dataSource", required = true) String dataSource); @ApiOperation(httpMethod = "POST", value = "API to configure asset group exception", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/configure", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> createAssetGroupDetails(@AuthenticationPrincipal Principal user, @RequestBody CreateAssetGroupExceptionDetailsRequest assetGroupDetails); @ApiOperation(httpMethod = "POST", value = "API to delete asset group exception", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/delete", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> createAssetGroupDetails(@AuthenticationPrincipal Principal user, @RequestBody DeleteAssetGroupExceptionRequest assetGroupDetails); @ApiOperation(httpMethod = "GET", value = "API to get all asset group exception names", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/exception-names", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getAllExceptionNames(); }
AssetGroupExceptionController { @ApiOperation(httpMethod = "GET", value = "API to get all asset group exception details by exception name and datasource", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/list-by-name-and-datasource", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> getAllTargetTypesByExceptionNameAndDataSource( @ApiParam(value = "provide valid exception name", required = true) @RequestParam(defaultValue="", name = "exceptionName", required = true) String exceptionName, @ApiParam(value = "provide valid datasource", required = true) @RequestParam(defaultValue="", name = "dataSource", required = true) String dataSource) { try { return ResponseUtils.buildSucessResponse(assetGroupExceptionService.getAllTargetTypesByExceptionNameAndDataSource(exceptionName, dataSource)); } catch (Exception exception) { log.error(UNEXPECTED_ERROR_OCCURRED, exception); return ResponseUtils.buildFailureResponse(new Exception(UNEXPECTED_ERROR_OCCURRED), exception.getMessage()); } }  @ApiOperation(httpMethod = "GET", value = "API to get all asset group exception details", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getAllAssetGroupExceptionDetails(
		@ApiParam(value = "provide valid page number", required = true) @RequestParam("page") Integer page,
		@ApiParam(value = "provide valid page size", required = true) @RequestParam("size") Integer size,
		@ApiParam(value = "provide valid search term", required = false) @RequestParam(defaultValue  =StringUtils.EMPTY, name = "searchTerm", required = false) String searchTerm); @ApiOperation(httpMethod = "GET", value = "API to get all asset group exception details by exception name and datasource", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/list-by-name-and-datasource", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getAllTargetTypesByExceptionNameAndDataSource(
		@ApiParam(value = "provide valid exception name", required = true) @RequestParam(defaultValue="", name = "exceptionName", required = true) String exceptionName,
		@ApiParam(value = "provide valid datasource", required = true) @RequestParam(defaultValue="", name = "dataSource", required = true) String dataSource); @ApiOperation(httpMethod = "POST", value = "API to configure asset group exception", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/configure", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> createAssetGroupDetails(@AuthenticationPrincipal Principal user, @RequestBody CreateAssetGroupExceptionDetailsRequest assetGroupDetails); @ApiOperation(httpMethod = "POST", value = "API to delete asset group exception", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/delete", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> createAssetGroupDetails(@AuthenticationPrincipal Principal user, @RequestBody DeleteAssetGroupExceptionRequest assetGroupDetails); @ApiOperation(httpMethod = "GET", value = "API to get all asset group exception names", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(path = "/exception-names", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getAllExceptionNames();  }