@Test public void test_createDesignation() { RequestInfo requestInfo = new RequestInfo().builder().apiId("emp").build(); Designation designation = new Designation().builder().id(10L).active(true).chartOfAccounts("accounts").code("100").description("account designation").build(); DesignationRequest designationRequest = new DesignationRequest().builder().requestInfo(requestInfo).designation(designation).build(); ResponseInfo expectedResponseInfo = new ResponseInfo("emp", "1.0", "2017-01-18T07:18:23.130Z", "uief87324", "20170310130900", "200"); when(responseInfoFactory.createResponseInfoFromRequestInfo(any(RequestInfo.class),any(Boolean.class))).thenReturn(expectedResponseInfo); when(commonIdGenerationService.getNextId(any(Sequence.class))).thenReturn(Long.valueOf("10")); ResponseEntity<?> response = designationService.createDesignation(designationRequest); assertEquals(response.getStatusCode().toString(),"200"); }
public ResponseEntity<?> createDesignation(DesignationRequest designationRequest) { Designation designation = designationRequest.getDesignation(); designation.setId(commonIdGenerationService.getNextId(Sequence.DESIGNATIONSEQUENCS)); create(designationRequest); return getSuccessResponseForCreate(Collections.singletonList(designation), designationRequest.getRequestInfo()); }
DesignationService { public ResponseEntity<?> createDesignation(DesignationRequest designationRequest) { Designation designation = designationRequest.getDesignation(); designation.setId(commonIdGenerationService.getNextId(Sequence.DESIGNATIONSEQUENCS)); create(designationRequest); return getSuccessResponseForCreate(Collections.singletonList(designation), designationRequest.getRequestInfo()); } }
DesignationService { public ResponseEntity<?> createDesignation(DesignationRequest designationRequest) { Designation designation = designationRequest.getDesignation(); designation.setId(commonIdGenerationService.getNextId(Sequence.DESIGNATIONSEQUENCS)); create(designationRequest); return getSuccessResponseForCreate(Collections.singletonList(designation), designationRequest.getRequestInfo()); }  }
DesignationService { public ResponseEntity<?> createDesignation(DesignationRequest designationRequest) { Designation designation = designationRequest.getDesignation(); designation.setId(commonIdGenerationService.getNextId(Sequence.DESIGNATIONSEQUENCS)); create(designationRequest); return getSuccessResponseForCreate(Collections.singletonList(designation), designationRequest.getRequestInfo()); }  List<Designation> getDesignations(DesignationGetRequest designationGetRequest); List<Designation> getDesignationsFromMDMS(RequestInfo requestInfo, DesignationGetRequest designationGetRequest); MdmsCriteriaReq prepareSearchRequestForDesignation(RequestInfo requestInfo, DesignationGetRequest designationGetRequest); ResponseEntity<?> createDesignation(DesignationRequest designationRequest); ResponseEntity<?> updateDesignation(DesignationRequest designationRequest); ResponseEntity<?> getSuccessResponseForCreate(List<Designation> designationList,
			RequestInfo requestInfo); void create(DesignationRequest designationRequest); void update(DesignationRequest designationRequest); }
DesignationService { public ResponseEntity<?> createDesignation(DesignationRequest designationRequest) { Designation designation = designationRequest.getDesignation(); designation.setId(commonIdGenerationService.getNextId(Sequence.DESIGNATIONSEQUENCS)); create(designationRequest); return getSuccessResponseForCreate(Collections.singletonList(designation), designationRequest.getRequestInfo()); }  List<Designation> getDesignations(DesignationGetRequest designationGetRequest); List<Designation> getDesignationsFromMDMS(RequestInfo requestInfo, DesignationGetRequest designationGetRequest); MdmsCriteriaReq prepareSearchRequestForDesignation(RequestInfo requestInfo, DesignationGetRequest designationGetRequest); ResponseEntity<?> createDesignation(DesignationRequest designationRequest); ResponseEntity<?> updateDesignation(DesignationRequest designationRequest); ResponseEntity<?> getSuccessResponseForCreate(List<Designation> designationList,
			RequestInfo requestInfo); void create(DesignationRequest designationRequest); void update(DesignationRequest designationRequest);  }