@Test public void test_delete_error() throws IOException, Exception { when(budgetReAppropriationService.delete(any(List.class), any(BindingResult.class), any(RequestInfo.class))) .thenReturn(getBudgetReAppropriations()); mockMvc.perform(post("/budgetreappropriations/_delete") .content(resources .readRequest("budgetreappropriation/budgetreappropriation_create_invalid_field_value.json")) .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); }
@PostMapping("/_delete") @ResponseStatus(HttpStatus.CREATED) public BudgetReAppropriationResponse delete( @RequestBody @Valid final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors) { final BudgetReAppropriationMapper mapper = new BudgetReAppropriationMapper(); budgetReAppropriationRequest.getRequestInfo().setAction(ACTION_DELETE); final BudgetReAppropriationResponse budgetReAppropriationResponse = new BudgetReAppropriationResponse(); budgetReAppropriationResponse.setResponseInfo(getResponseInfo(budgetReAppropriationRequest.getRequestInfo())); List<BudgetReAppropriation> budgetreappropriations = new ArrayList<>(); BudgetReAppropriation budgetReAppropriation = null; BudgetReAppropriationContract contract = null; final List<BudgetReAppropriationContract> budgetReAppropriationContracts = new ArrayList<BudgetReAppropriationContract>(); for (final BudgetReAppropriationContract budgetReAppropriationContract : budgetReAppropriationRequest .getBudgetReAppropriations()) { budgetReAppropriation = mapper.toDomain(budgetReAppropriationContract); budgetreappropriations.add(budgetReAppropriation); } budgetreappropriations = budgetReAppropriationService.delete(budgetreappropriations, errors, budgetReAppropriationRequest.getRequestInfo()); for (final BudgetReAppropriation bra : budgetreappropriations) { contract = mapper.toContract(bra); budgetReAppropriationContracts.add(contract); } budgetReAppropriationResponse.setBudgetReAppropriations(budgetReAppropriationContracts); return budgetReAppropriationResponse; }
BudgetReAppropriationController { @PostMapping("/_delete") @ResponseStatus(HttpStatus.CREATED) public BudgetReAppropriationResponse delete( @RequestBody @Valid final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors) { final BudgetReAppropriationMapper mapper = new BudgetReAppropriationMapper(); budgetReAppropriationRequest.getRequestInfo().setAction(ACTION_DELETE); final BudgetReAppropriationResponse budgetReAppropriationResponse = new BudgetReAppropriationResponse(); budgetReAppropriationResponse.setResponseInfo(getResponseInfo(budgetReAppropriationRequest.getRequestInfo())); List<BudgetReAppropriation> budgetreappropriations = new ArrayList<>(); BudgetReAppropriation budgetReAppropriation = null; BudgetReAppropriationContract contract = null; final List<BudgetReAppropriationContract> budgetReAppropriationContracts = new ArrayList<BudgetReAppropriationContract>(); for (final BudgetReAppropriationContract budgetReAppropriationContract : budgetReAppropriationRequest .getBudgetReAppropriations()) { budgetReAppropriation = mapper.toDomain(budgetReAppropriationContract); budgetreappropriations.add(budgetReAppropriation); } budgetreappropriations = budgetReAppropriationService.delete(budgetreappropriations, errors, budgetReAppropriationRequest.getRequestInfo()); for (final BudgetReAppropriation bra : budgetreappropriations) { contract = mapper.toContract(bra); budgetReAppropriationContracts.add(contract); } budgetReAppropriationResponse.setBudgetReAppropriations(budgetReAppropriationContracts); return budgetReAppropriationResponse; } }
BudgetReAppropriationController { @PostMapping("/_delete") @ResponseStatus(HttpStatus.CREATED) public BudgetReAppropriationResponse delete( @RequestBody @Valid final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors) { final BudgetReAppropriationMapper mapper = new BudgetReAppropriationMapper(); budgetReAppropriationRequest.getRequestInfo().setAction(ACTION_DELETE); final BudgetReAppropriationResponse budgetReAppropriationResponse = new BudgetReAppropriationResponse(); budgetReAppropriationResponse.setResponseInfo(getResponseInfo(budgetReAppropriationRequest.getRequestInfo())); List<BudgetReAppropriation> budgetreappropriations = new ArrayList<>(); BudgetReAppropriation budgetReAppropriation = null; BudgetReAppropriationContract contract = null; final List<BudgetReAppropriationContract> budgetReAppropriationContracts = new ArrayList<BudgetReAppropriationContract>(); for (final BudgetReAppropriationContract budgetReAppropriationContract : budgetReAppropriationRequest .getBudgetReAppropriations()) { budgetReAppropriation = mapper.toDomain(budgetReAppropriationContract); budgetreappropriations.add(budgetReAppropriation); } budgetreappropriations = budgetReAppropriationService.delete(budgetreappropriations, errors, budgetReAppropriationRequest.getRequestInfo()); for (final BudgetReAppropriation bra : budgetreappropriations) { contract = mapper.toContract(bra); budgetReAppropriationContracts.add(contract); } budgetReAppropriationResponse.setBudgetReAppropriations(budgetReAppropriationContracts); return budgetReAppropriationResponse; }  }
BudgetReAppropriationController { @PostMapping("/_delete") @ResponseStatus(HttpStatus.CREATED) public BudgetReAppropriationResponse delete( @RequestBody @Valid final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors) { final BudgetReAppropriationMapper mapper = new BudgetReAppropriationMapper(); budgetReAppropriationRequest.getRequestInfo().setAction(ACTION_DELETE); final BudgetReAppropriationResponse budgetReAppropriationResponse = new BudgetReAppropriationResponse(); budgetReAppropriationResponse.setResponseInfo(getResponseInfo(budgetReAppropriationRequest.getRequestInfo())); List<BudgetReAppropriation> budgetreappropriations = new ArrayList<>(); BudgetReAppropriation budgetReAppropriation = null; BudgetReAppropriationContract contract = null; final List<BudgetReAppropriationContract> budgetReAppropriationContracts = new ArrayList<BudgetReAppropriationContract>(); for (final BudgetReAppropriationContract budgetReAppropriationContract : budgetReAppropriationRequest .getBudgetReAppropriations()) { budgetReAppropriation = mapper.toDomain(budgetReAppropriationContract); budgetreappropriations.add(budgetReAppropriation); } budgetreappropriations = budgetReAppropriationService.delete(budgetreappropriations, errors, budgetReAppropriationRequest.getRequestInfo()); for (final BudgetReAppropriation bra : budgetreappropriations) { contract = mapper.toContract(bra); budgetReAppropriationContracts.add(contract); } budgetReAppropriationResponse.setBudgetReAppropriations(budgetReAppropriationContracts); return budgetReAppropriationResponse; }  @PostMapping("/_create") @ResponseStatus(HttpStatus.CREATED) BudgetReAppropriationResponse create(@RequestBody final BudgetReAppropriationRequest budgetReAppropriationRequest,
            final BindingResult errors); @PostMapping("/_update") @ResponseStatus(HttpStatus.CREATED) BudgetReAppropriationResponse update(
            @RequestBody @Valid final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors); @PostMapping("/_delete") @ResponseStatus(HttpStatus.CREATED) BudgetReAppropriationResponse delete(
            @RequestBody @Valid final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors); @PostMapping("/_search") @ResponseBody @ResponseStatus(HttpStatus.OK) BudgetReAppropriationResponse search(
            @ModelAttribute final BudgetReAppropriationSearchContract budgetReAppropriationSearchContract,
            @RequestBody final RequestInfo requestInfo, final BindingResult errors); }
BudgetReAppropriationController { @PostMapping("/_delete") @ResponseStatus(HttpStatus.CREATED) public BudgetReAppropriationResponse delete( @RequestBody @Valid final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors) { final BudgetReAppropriationMapper mapper = new BudgetReAppropriationMapper(); budgetReAppropriationRequest.getRequestInfo().setAction(ACTION_DELETE); final BudgetReAppropriationResponse budgetReAppropriationResponse = new BudgetReAppropriationResponse(); budgetReAppropriationResponse.setResponseInfo(getResponseInfo(budgetReAppropriationRequest.getRequestInfo())); List<BudgetReAppropriation> budgetreappropriations = new ArrayList<>(); BudgetReAppropriation budgetReAppropriation = null; BudgetReAppropriationContract contract = null; final List<BudgetReAppropriationContract> budgetReAppropriationContracts = new ArrayList<BudgetReAppropriationContract>(); for (final BudgetReAppropriationContract budgetReAppropriationContract : budgetReAppropriationRequest .getBudgetReAppropriations()) { budgetReAppropriation = mapper.toDomain(budgetReAppropriationContract); budgetreappropriations.add(budgetReAppropriation); } budgetreappropriations = budgetReAppropriationService.delete(budgetreappropriations, errors, budgetReAppropriationRequest.getRequestInfo()); for (final BudgetReAppropriation bra : budgetreappropriations) { contract = mapper.toContract(bra); budgetReAppropriationContracts.add(contract); } budgetReAppropriationResponse.setBudgetReAppropriations(budgetReAppropriationContracts); return budgetReAppropriationResponse; }  @PostMapping("/_create") @ResponseStatus(HttpStatus.CREATED) BudgetReAppropriationResponse create(@RequestBody final BudgetReAppropriationRequest budgetReAppropriationRequest,
            final BindingResult errors); @PostMapping("/_update") @ResponseStatus(HttpStatus.CREATED) BudgetReAppropriationResponse update(
            @RequestBody @Valid final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors); @PostMapping("/_delete") @ResponseStatus(HttpStatus.CREATED) BudgetReAppropriationResponse delete(
            @RequestBody @Valid final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors); @PostMapping("/_search") @ResponseBody @ResponseStatus(HttpStatus.OK) BudgetReAppropriationResponse search(
            @ModelAttribute final BudgetReAppropriationSearchContract budgetReAppropriationSearchContract,
            @RequestBody final RequestInfo requestInfo, final BindingResult errors); static final String ACTION_CREATE; static final String ACTION_UPDATE; static final String ACTION_DELETE; static final String PLACEHOLDER; }