@Test public void testAddMonkeyStrategyErrCndtn() { MonkeyStrategy monkeyStrategy = null; UriComponentsBuilder ucBuilder = UriComponentsBuilder.newInstance(); MessageWrapper apiError = (MessageWrapper) monkeyStrategyController .addMonkeyStrategy(req, monkeyStrategy, ucBuilder).getBody(); assertEquals(HttpStatus.BAD_REQUEST, apiError.getStatus()); assertEquals("NULL request received to add monkeyStrategy", apiError.getStatusMessage()); monkeyStrategy = createMonkeyStrategy(MONKEYSTRATEGYNAME, TEAMNAME); monkeyStrategy.setMonkeyStrategyName(""); apiError = (MessageWrapper) monkeyStrategyController.addMonkeyStrategy(req, monkeyStrategy, ucBuilder) .getBody(); assertEquals(HttpStatus.BAD_REQUEST, apiError.getStatus()); assertEquals("Monkey Strategy name is empty", apiError.getStatusMessage()); setSecuirtyContext(TEAMNAME, USERNAME); TeamUser teamUser = createTeamUserObject(USERNAME, TEAMNAME); monkeyStrategy = createMonkeyStrategy(MONKEYSTRATEGYNAME, TEAMNAME); monkeyStrategy.setDefaultFlag("Y"); List<MonkeyStrategy> monkeyStrategies = new ArrayList<>(); monkeyStrategies.add(monkeyStrategy); Page<MonkeyStrategy> monkeyStrategyPage = new PageImpl<>(monkeyStrategies); when(teamUserRepository.findByUserNameAndDefaultFlag(USERNAME, "Y")).thenReturn(teamUser); when(monkeyStrategyRepository.findByMonkeyTypeAndMonkeyStrategyNameAndDefaultFlagAndTeamName( monkeyStrategy.getMonkeyType().monkeyType(), MONKEYSTRATEGYNAME, monkeyStrategy.getDefaultFlag(), TEAMNAME)).thenReturn(monkeyStrategyPage); apiError = (MessageWrapper) monkeyStrategyController.addMonkeyStrategy(req, monkeyStrategy, ucBuilder) .getBody(); assertEquals(HttpStatus.CONFLICT, apiError.getStatus()); assertEquals("MonkeyStrategy with name " + monkeyStrategy.getMonkeyStrategyName() + " already exist", apiError.getStatusMessage()); }
@ApiOperation(value = "This API inserts a Monkey Strategy Object into Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 201, message = "Monkey Strategy object successfully inserted into ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Add operation"), @ApiResponse(code = 409, message = "Monkey Strategy with same name is already exist"), @ApiResponse(code = 404, message = "The resource trying to reach is not found"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategy/", method = RequestMethod.POST, produces = "application/json") public ResponseEntity<Object> addMonkeyStrategy(HttpServletRequest request, @RequestBody MonkeyStrategy monkeyStrategy, UriComponentsBuilder ucBuilder) { if (monkeyStrategy == null) { final String error = "NULL request received to add monkeyStrategy"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.BAD_REQUEST, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } if (monkeyStrategy.getMonkeyStrategyName() == null || "".equals(monkeyStrategy.getMonkeyStrategyName().trim())) { final String error = "Monkey Strategy name is empty"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.BAD_REQUEST, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } final String teamName = userDetailsService.getCurrentTeamForUser(request).getTeamName(); monkeyStrategy.setTeamName(teamName); logger.debug("Creating monkeyStrategy with name -->" + monkeyStrategy.getMonkeyStrategyName()); if (insertMonkeyStrategy(monkeyStrategy, teamName)) { final String error = "MonkeyStrategy with name " + monkeyStrategy.getMonkeyStrategyName() + " already exist"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.CONFLICT, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } logger.debug("MonkeyStrategy saved in ES with id -->" + monkeyStrategy.getId()); HttpHeaders headers = new HttpHeaders(); headers.setLocation(ucBuilder.path("/monkeyStrategy/{id}").buildAndExpand(monkeyStrategy.getId()).toUri()); return new ResponseEntity<>(headers, HttpStatus.CREATED); }
MonkeyStrategyRestController { @ApiOperation(value = "This API inserts a Monkey Strategy Object into Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 201, message = "Monkey Strategy object successfully inserted into ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Add operation"), @ApiResponse(code = 409, message = "Monkey Strategy with same name is already exist"), @ApiResponse(code = 404, message = "The resource trying to reach is not found"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategy/", method = RequestMethod.POST, produces = "application/json") public ResponseEntity<Object> addMonkeyStrategy(HttpServletRequest request, @RequestBody MonkeyStrategy monkeyStrategy, UriComponentsBuilder ucBuilder) { if (monkeyStrategy == null) { final String error = "NULL request received to add monkeyStrategy"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.BAD_REQUEST, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } if (monkeyStrategy.getMonkeyStrategyName() == null || "".equals(monkeyStrategy.getMonkeyStrategyName().trim())) { final String error = "Monkey Strategy name is empty"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.BAD_REQUEST, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } final String teamName = userDetailsService.getCurrentTeamForUser(request).getTeamName(); monkeyStrategy.setTeamName(teamName); logger.debug("Creating monkeyStrategy with name -->" + monkeyStrategy.getMonkeyStrategyName()); if (insertMonkeyStrategy(monkeyStrategy, teamName)) { final String error = "MonkeyStrategy with name " + monkeyStrategy.getMonkeyStrategyName() + " already exist"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.CONFLICT, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } logger.debug("MonkeyStrategy saved in ES with id -->" + monkeyStrategy.getId()); HttpHeaders headers = new HttpHeaders(); headers.setLocation(ucBuilder.path("/monkeyStrategy/{id}").buildAndExpand(monkeyStrategy.getId()).toUri()); return new ResponseEntity<>(headers, HttpStatus.CREATED); } }
MonkeyStrategyRestController { @ApiOperation(value = "This API inserts a Monkey Strategy Object into Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 201, message = "Monkey Strategy object successfully inserted into ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Add operation"), @ApiResponse(code = 409, message = "Monkey Strategy with same name is already exist"), @ApiResponse(code = 404, message = "The resource trying to reach is not found"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategy/", method = RequestMethod.POST, produces = "application/json") public ResponseEntity<Object> addMonkeyStrategy(HttpServletRequest request, @RequestBody MonkeyStrategy monkeyStrategy, UriComponentsBuilder ucBuilder) { if (monkeyStrategy == null) { final String error = "NULL request received to add monkeyStrategy"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.BAD_REQUEST, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } if (monkeyStrategy.getMonkeyStrategyName() == null || "".equals(monkeyStrategy.getMonkeyStrategyName().trim())) { final String error = "Monkey Strategy name is empty"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.BAD_REQUEST, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } final String teamName = userDetailsService.getCurrentTeamForUser(request).getTeamName(); monkeyStrategy.setTeamName(teamName); logger.debug("Creating monkeyStrategy with name -->" + monkeyStrategy.getMonkeyStrategyName()); if (insertMonkeyStrategy(monkeyStrategy, teamName)) { final String error = "MonkeyStrategy with name " + monkeyStrategy.getMonkeyStrategyName() + " already exist"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.CONFLICT, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } logger.debug("MonkeyStrategy saved in ES with id -->" + monkeyStrategy.getId()); HttpHeaders headers = new HttpHeaders(); headers.setLocation(ucBuilder.path("/monkeyStrategy/{id}").buildAndExpand(monkeyStrategy.getId()).toUri()); return new ResponseEntity<>(headers, HttpStatus.CREATED); }  }
MonkeyStrategyRestController { @ApiOperation(value = "This API inserts a Monkey Strategy Object into Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 201, message = "Monkey Strategy object successfully inserted into ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Add operation"), @ApiResponse(code = 409, message = "Monkey Strategy with same name is already exist"), @ApiResponse(code = 404, message = "The resource trying to reach is not found"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategy/", method = RequestMethod.POST, produces = "application/json") public ResponseEntity<Object> addMonkeyStrategy(HttpServletRequest request, @RequestBody MonkeyStrategy monkeyStrategy, UriComponentsBuilder ucBuilder) { if (monkeyStrategy == null) { final String error = "NULL request received to add monkeyStrategy"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.BAD_REQUEST, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } if (monkeyStrategy.getMonkeyStrategyName() == null || "".equals(monkeyStrategy.getMonkeyStrategyName().trim())) { final String error = "Monkey Strategy name is empty"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.BAD_REQUEST, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } final String teamName = userDetailsService.getCurrentTeamForUser(request).getTeamName(); monkeyStrategy.setTeamName(teamName); logger.debug("Creating monkeyStrategy with name -->" + monkeyStrategy.getMonkeyStrategyName()); if (insertMonkeyStrategy(monkeyStrategy, teamName)) { final String error = "MonkeyStrategy with name " + monkeyStrategy.getMonkeyStrategyName() + " already exist"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.CONFLICT, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } logger.debug("MonkeyStrategy saved in ES with id -->" + monkeyStrategy.getId()); HttpHeaders headers = new HttpHeaders(); headers.setLocation(ucBuilder.path("/monkeyStrategy/{id}").buildAndExpand(monkeyStrategy.getId()).toUri()); return new ResponseEntity<>(headers, HttpStatus.CREATED); }  @ApiOperation(value = "This API returns all Monkey Strategy Objects present in Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned all Monkey Strategy Objects"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found") }) @RequestMapping(value = "/api/monkeystrategies/", method = RequestMethod.GET) ResponseEntity<Object> listAllMonkeyStrategies(); @ApiOperation(value = "This API returns list of all Monkey Strategy objects present in Elastic Search for given team", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned all Monkey Strategy Objects for given team"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given team") }) @RequestMapping(value = "/api/monkeystrategies/team-strategies/", method = RequestMethod.GET, produces = "application/json") ResponseEntity<Object> listAllMonkeyStrategy(HttpServletRequest request); @ApiOperation(value = "This API returns List of Monkey Type", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Monkey Type values"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "The resource trying to reach is not found") }) @RequestMapping(value = "/api/monkeytypes/", method = RequestMethod.GET, produces = "application/json") ResponseEntity<Object> listAllMonkeyTypes(); @ApiOperation(value = "This API returns single Monkey Strategy Object present in Elastic Search for given Monkey Strategy ID", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned single Monkey Strategy Object for given Monkey Strategy ID"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given Monkey Strategy ID") }) @RequestMapping(value = "/api/monkeystrategies/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getMonkeyStrategy(HttpServletRequest request, @PathVariable("id") String id); @ApiOperation(value = "This API returns single Monkey Strategy Object present in Elastic Search for given Monkey Strategy Name", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Monkey Strategy Object for given Monkey Strategy Name"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given Monkey Strategy Name") }) @RequestMapping(value = "/api/monkeystrategies/monkeystrategybyname/{name}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getMonkeyStrategyByName(HttpServletRequest request,
			@PathVariable("name") String name); @ApiOperation(value = "This API returns single Default Monkey Strategy Object present in Elastic Search for given Monkey Strategy Name & Monkey Type", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Monkey Strategy Object for given Monkey Strategy Name & Monkey Type"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given Monkey Strategy Name & Monkey Type") }) @RequestMapping(value = "/api/monkeystrategies/defaultmonkeystrategy/{name}/{monkeytype}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getDefaultMonkeyStrategy(HttpServletRequest request,
			@PathVariable("name") String name, @PathVariable("monkeytype") String monkeyTypeStr); @ApiOperation(value = "This API returns single Default Monkey Strategy Object present in Elastic Search for given Monkey Strategy Name & Version", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Monkey Strategy Object for given Monkey Strategy Name & Version"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given Monkey Strategy Name & Version") }) @RequestMapping(value = "/api/monkeystrategies/{name}/{version}/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getMonkeyStrategyByNameAndVersion(HttpServletRequest request,
			@PathVariable("name") String name, @PathVariable("version") String version); @ApiOperation(value = "This API returns count of Monkey Strategy objects available in Elastic Search for a team", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned count of Monkey Strategy objects for given team"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "The resource trying to reach is not found") }) @RequestMapping(value = "/api/monkeystrategies/count/", method = RequestMethod.GET, produces = "application/json") ResponseEntity<Object> countByTeamName(HttpServletRequest request); @ApiOperation(value = "This API returns Monkey Strategy Objects present in Elastic Search for given App Emvironment and team name", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Monkey Strategy Object for given App Emvironment and team name"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given App Emvironment and team name") }) @RequestMapping(value = "/api/monkeystrategies/autodiscover/{applicationname}/{environmentname}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getFailurePointByApplicationEnvironmentAndTeamName(HttpServletRequest request,
			@PathVariable("applicationname") String applicationname,
			@PathVariable("environmentname") String environmentname); @ApiOperation(value = "This API inserts a Monkey Strategy Object into Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 201, message = "Monkey Strategy object successfully inserted into ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Add operation"), @ApiResponse(code = 409, message = "Monkey Strategy with same name is already exist"), @ApiResponse(code = 404, message = "The resource trying to reach is not found"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategy/", method = RequestMethod.POST, produces = "application/json") ResponseEntity<Object> addMonkeyStrategy(HttpServletRequest request,
			@RequestBody MonkeyStrategy monkeyStrategy, UriComponentsBuilder ucBuilder); @ApiOperation(value = "This API updates a Monkey Strategy Objects into Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Monkey Strategy object successfully updated into ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Update operation"), @ApiResponse(code = 409, message = "Monkey Strategy can be changed only by the owning team"), @ApiResponse(code = 404, message = "Monkey Strategy object not found in ES for given Monkey Strategy ID"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategies/{id}", method = RequestMethod.PUT, produces = "application/json") ResponseEntity<Object> updateMonkeyStrategy(HttpServletRequest request, @PathVariable("id") String id,
			@RequestBody MonkeyStrategy toModifyMonkeyStrategy); @ApiOperation(value = "This API deletes a Monkey Strategy Objects from Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Monkey Strategy object successfully deleted from ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Delete operation"), @ApiResponse(code = 409, message = "Monkey Strategy can be delted only by the owning team"), @ApiResponse(code = 404, message = "Monkey Strategy object not found in ES for given Monkey Strategy ID"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategies/{id}", method = RequestMethod.DELETE, produces = "application/json") ResponseEntity<Object> deletemonkeystrategy(HttpServletRequest request, @PathVariable("id") String id); }
MonkeyStrategyRestController { @ApiOperation(value = "This API inserts a Monkey Strategy Object into Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 201, message = "Monkey Strategy object successfully inserted into ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Add operation"), @ApiResponse(code = 409, message = "Monkey Strategy with same name is already exist"), @ApiResponse(code = 404, message = "The resource trying to reach is not found"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategy/", method = RequestMethod.POST, produces = "application/json") public ResponseEntity<Object> addMonkeyStrategy(HttpServletRequest request, @RequestBody MonkeyStrategy monkeyStrategy, UriComponentsBuilder ucBuilder) { if (monkeyStrategy == null) { final String error = "NULL request received to add monkeyStrategy"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.BAD_REQUEST, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } if (monkeyStrategy.getMonkeyStrategyName() == null || "".equals(monkeyStrategy.getMonkeyStrategyName().trim())) { final String error = "Monkey Strategy name is empty"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.BAD_REQUEST, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } final String teamName = userDetailsService.getCurrentTeamForUser(request).getTeamName(); monkeyStrategy.setTeamName(teamName); logger.debug("Creating monkeyStrategy with name -->" + monkeyStrategy.getMonkeyStrategyName()); if (insertMonkeyStrategy(monkeyStrategy, teamName)) { final String error = "MonkeyStrategy with name " + monkeyStrategy.getMonkeyStrategyName() + " already exist"; logger.debug(error); final MessageWrapper apiError = new MessageWrapper(HttpStatus.CONFLICT, error, error); return new ResponseEntity<>(apiError, new HttpHeaders(), apiError.getStatus()); } logger.debug("MonkeyStrategy saved in ES with id -->" + monkeyStrategy.getId()); HttpHeaders headers = new HttpHeaders(); headers.setLocation(ucBuilder.path("/monkeyStrategy/{id}").buildAndExpand(monkeyStrategy.getId()).toUri()); return new ResponseEntity<>(headers, HttpStatus.CREATED); }  @ApiOperation(value = "This API returns all Monkey Strategy Objects present in Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned all Monkey Strategy Objects"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found") }) @RequestMapping(value = "/api/monkeystrategies/", method = RequestMethod.GET) ResponseEntity<Object> listAllMonkeyStrategies(); @ApiOperation(value = "This API returns list of all Monkey Strategy objects present in Elastic Search for given team", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned all Monkey Strategy Objects for given team"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given team") }) @RequestMapping(value = "/api/monkeystrategies/team-strategies/", method = RequestMethod.GET, produces = "application/json") ResponseEntity<Object> listAllMonkeyStrategy(HttpServletRequest request); @ApiOperation(value = "This API returns List of Monkey Type", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Monkey Type values"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "The resource trying to reach is not found") }) @RequestMapping(value = "/api/monkeytypes/", method = RequestMethod.GET, produces = "application/json") ResponseEntity<Object> listAllMonkeyTypes(); @ApiOperation(value = "This API returns single Monkey Strategy Object present in Elastic Search for given Monkey Strategy ID", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned single Monkey Strategy Object for given Monkey Strategy ID"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given Monkey Strategy ID") }) @RequestMapping(value = "/api/monkeystrategies/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getMonkeyStrategy(HttpServletRequest request, @PathVariable("id") String id); @ApiOperation(value = "This API returns single Monkey Strategy Object present in Elastic Search for given Monkey Strategy Name", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Monkey Strategy Object for given Monkey Strategy Name"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given Monkey Strategy Name") }) @RequestMapping(value = "/api/monkeystrategies/monkeystrategybyname/{name}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getMonkeyStrategyByName(HttpServletRequest request,
			@PathVariable("name") String name); @ApiOperation(value = "This API returns single Default Monkey Strategy Object present in Elastic Search for given Monkey Strategy Name & Monkey Type", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Monkey Strategy Object for given Monkey Strategy Name & Monkey Type"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given Monkey Strategy Name & Monkey Type") }) @RequestMapping(value = "/api/monkeystrategies/defaultmonkeystrategy/{name}/{monkeytype}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getDefaultMonkeyStrategy(HttpServletRequest request,
			@PathVariable("name") String name, @PathVariable("monkeytype") String monkeyTypeStr); @ApiOperation(value = "This API returns single Default Monkey Strategy Object present in Elastic Search for given Monkey Strategy Name & Version", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Monkey Strategy Object for given Monkey Strategy Name & Version"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given Monkey Strategy Name & Version") }) @RequestMapping(value = "/api/monkeystrategies/{name}/{version}/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getMonkeyStrategyByNameAndVersion(HttpServletRequest request,
			@PathVariable("name") String name, @PathVariable("version") String version); @ApiOperation(value = "This API returns count of Monkey Strategy objects available in Elastic Search for a team", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned count of Monkey Strategy objects for given team"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "The resource trying to reach is not found") }) @RequestMapping(value = "/api/monkeystrategies/count/", method = RequestMethod.GET, produces = "application/json") ResponseEntity<Object> countByTeamName(HttpServletRequest request); @ApiOperation(value = "This API returns Monkey Strategy Objects present in Elastic Search for given App Emvironment and team name", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Returned Monkey Strategy Object for given App Emvironment and team name"), @ApiResponse(code = 401, message = "User is not authorized to view requested object"), @ApiResponse(code = 404, message = "No Monkey Strategy object found for given App Emvironment and team name") }) @RequestMapping(value = "/api/monkeystrategies/autodiscover/{applicationname}/{environmentname}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> getFailurePointByApplicationEnvironmentAndTeamName(HttpServletRequest request,
			@PathVariable("applicationname") String applicationname,
			@PathVariable("environmentname") String environmentname); @ApiOperation(value = "This API inserts a Monkey Strategy Object into Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 201, message = "Monkey Strategy object successfully inserted into ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Add operation"), @ApiResponse(code = 409, message = "Monkey Strategy with same name is already exist"), @ApiResponse(code = 404, message = "The resource trying to reach is not found"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategy/", method = RequestMethod.POST, produces = "application/json") ResponseEntity<Object> addMonkeyStrategy(HttpServletRequest request,
			@RequestBody MonkeyStrategy monkeyStrategy, UriComponentsBuilder ucBuilder); @ApiOperation(value = "This API updates a Monkey Strategy Objects into Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Monkey Strategy object successfully updated into ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Update operation"), @ApiResponse(code = 409, message = "Monkey Strategy can be changed only by the owning team"), @ApiResponse(code = 404, message = "Monkey Strategy object not found in ES for given Monkey Strategy ID"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategies/{id}", method = RequestMethod.PUT, produces = "application/json") ResponseEntity<Object> updateMonkeyStrategy(HttpServletRequest request, @PathVariable("id") String id,
			@RequestBody MonkeyStrategy toModifyMonkeyStrategy); @ApiOperation(value = "This API deletes a Monkey Strategy Objects from Elastic Search", response = ResponseEntity.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Monkey Strategy object successfully deleted from ES"), @ApiResponse(code = 401, message = "User is not authorized to perform Delete operation"), @ApiResponse(code = 409, message = "Monkey Strategy can be delted only by the owning team"), @ApiResponse(code = 404, message = "Monkey Strategy object not found in ES for given Monkey Strategy ID"), @ApiResponse(code = 400, message = "Input Request object is not valid") }) @RequestMapping(value = "/api/monkeystrategies/{id}", method = RequestMethod.DELETE, produces = "application/json") ResponseEntity<Object> deletemonkeystrategy(HttpServletRequest request, @PathVariable("id") String id);  }