@Test public void test_create() throws IOException, Exception { when(budgetReAppropriationService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) .thenReturn(getBudgetReAppropriations()); mockMvc.perform(post("/budgetreappropriations/_create") .content(resources.readRequest("budgetreappropriation/budgetreappropriation_create_valid_request.json")) .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json(resources .readResponse("budgetreappropriation/budgetreappropriation_create_valid_response.json"))); }
@PostMapping("/_create") @ResponseStatus(HttpStatus.CREATED) public BudgetReAppropriationResponse create(@RequestBody final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors) { final BudgetReAppropriationMapper mapper = new BudgetReAppropriationMapper(); final BudgetReAppropriationResponse budgetReAppropriationResponse = new BudgetReAppropriationResponse(); budgetReAppropriationResponse.setResponseInfo(getResponseInfo(budgetReAppropriationRequest.getRequestInfo())); List<BudgetReAppropriation> budgetreappropriations = new ArrayList<>(); BudgetReAppropriation budgetReAppropriation = null; final List<BudgetReAppropriationContract> budgetReAppropriationContracts = new ArrayList<BudgetReAppropriationContract>(); BudgetReAppropriationContract contract = null; budgetReAppropriationRequest.getRequestInfo().setAction(ACTION_CREATE); for (final BudgetReAppropriationContract budgetReAppropriationContract : budgetReAppropriationRequest .getBudgetReAppropriations()) { budgetReAppropriation = mapper.toDomain(budgetReAppropriationContract); budgetReAppropriation.setCreatedBy(budgetReAppropriationRequest.getRequestInfo().getUserInfo()); budgetReAppropriation.setLastModifiedBy(budgetReAppropriationRequest.getRequestInfo().getUserInfo()); budgetreappropriations.add(budgetReAppropriation); } budgetreappropriations = budgetReAppropriationService.create(budgetreappropriations, errors, budgetReAppropriationRequest.getRequestInfo()); for (final BudgetReAppropriation bra : budgetreappropriations) { contract = mapper.toContract(bra); budgetReAppropriationContracts.add(contract); } budgetReAppropriationResponse.setBudgetReAppropriations(budgetReAppropriationContracts); return budgetReAppropriationResponse; }
BudgetReAppropriationController { @PostMapping("/_create") @ResponseStatus(HttpStatus.CREATED) public BudgetReAppropriationResponse create(@RequestBody final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors) { final BudgetReAppropriationMapper mapper = new BudgetReAppropriationMapper(); final BudgetReAppropriationResponse budgetReAppropriationResponse = new BudgetReAppropriationResponse(); budgetReAppropriationResponse.setResponseInfo(getResponseInfo(budgetReAppropriationRequest.getRequestInfo())); List<BudgetReAppropriation> budgetreappropriations = new ArrayList<>(); BudgetReAppropriation budgetReAppropriation = null; final List<BudgetReAppropriationContract> budgetReAppropriationContracts = new ArrayList<BudgetReAppropriationContract>(); BudgetReAppropriationContract contract = null; budgetReAppropriationRequest.getRequestInfo().setAction(ACTION_CREATE); for (final BudgetReAppropriationContract budgetReAppropriationContract : budgetReAppropriationRequest .getBudgetReAppropriations()) { budgetReAppropriation = mapper.toDomain(budgetReAppropriationContract); budgetReAppropriation.setCreatedBy(budgetReAppropriationRequest.getRequestInfo().getUserInfo()); budgetReAppropriation.setLastModifiedBy(budgetReAppropriationRequest.getRequestInfo().getUserInfo()); budgetreappropriations.add(budgetReAppropriation); } budgetreappropriations = budgetReAppropriationService.create(budgetreappropriations, errors, budgetReAppropriationRequest.getRequestInfo()); for (final BudgetReAppropriation bra : budgetreappropriations) { contract = mapper.toContract(bra); budgetReAppropriationContracts.add(contract); } budgetReAppropriationResponse.setBudgetReAppropriations(budgetReAppropriationContracts); return budgetReAppropriationResponse; } }
BudgetReAppropriationController { @PostMapping("/_create") @ResponseStatus(HttpStatus.CREATED) public BudgetReAppropriationResponse create(@RequestBody final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors) { final BudgetReAppropriationMapper mapper = new BudgetReAppropriationMapper(); final BudgetReAppropriationResponse budgetReAppropriationResponse = new BudgetReAppropriationResponse(); budgetReAppropriationResponse.setResponseInfo(getResponseInfo(budgetReAppropriationRequest.getRequestInfo())); List<BudgetReAppropriation> budgetreappropriations = new ArrayList<>(); BudgetReAppropriation budgetReAppropriation = null; final List<BudgetReAppropriationContract> budgetReAppropriationContracts = new ArrayList<BudgetReAppropriationContract>(); BudgetReAppropriationContract contract = null; budgetReAppropriationRequest.getRequestInfo().setAction(ACTION_CREATE); for (final BudgetReAppropriationContract budgetReAppropriationContract : budgetReAppropriationRequest .getBudgetReAppropriations()) { budgetReAppropriation = mapper.toDomain(budgetReAppropriationContract); budgetReAppropriation.setCreatedBy(budgetReAppropriationRequest.getRequestInfo().getUserInfo()); budgetReAppropriation.setLastModifiedBy(budgetReAppropriationRequest.getRequestInfo().getUserInfo()); budgetreappropriations.add(budgetReAppropriation); } budgetreappropriations = budgetReAppropriationService.create(budgetreappropriations, errors, budgetReAppropriationRequest.getRequestInfo()); for (final BudgetReAppropriation bra : budgetreappropriations) { contract = mapper.toContract(bra); budgetReAppropriationContracts.add(contract); } budgetReAppropriationResponse.setBudgetReAppropriations(budgetReAppropriationContracts); return budgetReAppropriationResponse; }  }
BudgetReAppropriationController { @PostMapping("/_create") @ResponseStatus(HttpStatus.CREATED) public BudgetReAppropriationResponse create(@RequestBody final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors) { final BudgetReAppropriationMapper mapper = new BudgetReAppropriationMapper(); final BudgetReAppropriationResponse budgetReAppropriationResponse = new BudgetReAppropriationResponse(); budgetReAppropriationResponse.setResponseInfo(getResponseInfo(budgetReAppropriationRequest.getRequestInfo())); List<BudgetReAppropriation> budgetreappropriations = new ArrayList<>(); BudgetReAppropriation budgetReAppropriation = null; final List<BudgetReAppropriationContract> budgetReAppropriationContracts = new ArrayList<BudgetReAppropriationContract>(); BudgetReAppropriationContract contract = null; budgetReAppropriationRequest.getRequestInfo().setAction(ACTION_CREATE); for (final BudgetReAppropriationContract budgetReAppropriationContract : budgetReAppropriationRequest .getBudgetReAppropriations()) { budgetReAppropriation = mapper.toDomain(budgetReAppropriationContract); budgetReAppropriation.setCreatedBy(budgetReAppropriationRequest.getRequestInfo().getUserInfo()); budgetReAppropriation.setLastModifiedBy(budgetReAppropriationRequest.getRequestInfo().getUserInfo()); budgetreappropriations.add(budgetReAppropriation); } budgetreappropriations = budgetReAppropriationService.create(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("/_create") @ResponseStatus(HttpStatus.CREATED) public BudgetReAppropriationResponse create(@RequestBody final BudgetReAppropriationRequest budgetReAppropriationRequest, final BindingResult errors) { final BudgetReAppropriationMapper mapper = new BudgetReAppropriationMapper(); final BudgetReAppropriationResponse budgetReAppropriationResponse = new BudgetReAppropriationResponse(); budgetReAppropriationResponse.setResponseInfo(getResponseInfo(budgetReAppropriationRequest.getRequestInfo())); List<BudgetReAppropriation> budgetreappropriations = new ArrayList<>(); BudgetReAppropriation budgetReAppropriation = null; final List<BudgetReAppropriationContract> budgetReAppropriationContracts = new ArrayList<BudgetReAppropriationContract>(); BudgetReAppropriationContract contract = null; budgetReAppropriationRequest.getRequestInfo().setAction(ACTION_CREATE); for (final BudgetReAppropriationContract budgetReAppropriationContract : budgetReAppropriationRequest .getBudgetReAppropriations()) { budgetReAppropriation = mapper.toDomain(budgetReAppropriationContract); budgetReAppropriation.setCreatedBy(budgetReAppropriationRequest.getRequestInfo().getUserInfo()); budgetReAppropriation.setLastModifiedBy(budgetReAppropriationRequest.getRequestInfo().getUserInfo()); budgetreappropriations.add(budgetReAppropriation); } budgetreappropriations = budgetReAppropriationService.create(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; }