@Test public void test_Should_Create_ReceivingCenter_Invalid() { final ReceivingCenterTypeReq receivingCenterReq = getReceivingCenterRequest(); final ReceivingCenterType receivingCenter = receivingCenterReq.getCenterType(); receivingCenter.getCode(); receivingCenter.getName(); receivingCenter.getDescription(); receivingCenter.getActive(); Long.valueOf(receivingCenterReq.getRequestInfo().getUserInfo().getId()); Long.valueOf(receivingCenterReq.getRequestInfo().getUserInfo().getId()); new Date(new java.util.Date().getTime()); new Date(new java.util.Date().getTime()); receivingCenter.getTenantId(); when(jdbcTemplate.update(any(String.class), any(Object[].class))).thenReturn(1); assertTrue(!receivingCenter.equals(receivingCenterRepository.persistReceivingCenterType(receivingCenterReq))); }
public ReceivingCenterTypeReq persistReceivingCenterType(final ReceivingCenterTypeReq centerTypeRequest) { LOGGER.info("ReceivingCenterType Create Request::" + centerTypeRequest); final String receivingCenterTypeInsert = ReceivingCenterTypeQueryBuilder.insertReceivingCenterTypeQuery(); final ReceivingCenterType centerType = centerTypeRequest.getCenterType(); final Object[] obj = new Object[]{centerType.getCode(), centerType.getName(), centerType.getDescription(), centerType.getIscrnrequired(), centerType.getOrderno(), centerType.getActive(), Long.valueOf(centerTypeRequest.getRequestInfo().getUserInfo().getId()), Long.valueOf(centerTypeRequest.getRequestInfo().getUserInfo().getId()), new Date(new java.util.Date().getTime()), new Date(new java.util.Date().getTime()), centerType.getTenantId()}; jdbcTemplate.update(receivingCenterTypeInsert, obj); return centerTypeRequest; }
ReceivingCenterTypeRepository { public ReceivingCenterTypeReq persistReceivingCenterType(final ReceivingCenterTypeReq centerTypeRequest) { LOGGER.info("ReceivingCenterType Create Request::" + centerTypeRequest); final String receivingCenterTypeInsert = ReceivingCenterTypeQueryBuilder.insertReceivingCenterTypeQuery(); final ReceivingCenterType centerType = centerTypeRequest.getCenterType(); final Object[] obj = new Object[]{centerType.getCode(), centerType.getName(), centerType.getDescription(), centerType.getIscrnrequired(), centerType.getOrderno(), centerType.getActive(), Long.valueOf(centerTypeRequest.getRequestInfo().getUserInfo().getId()), Long.valueOf(centerTypeRequest.getRequestInfo().getUserInfo().getId()), new Date(new java.util.Date().getTime()), new Date(new java.util.Date().getTime()), centerType.getTenantId()}; jdbcTemplate.update(receivingCenterTypeInsert, obj); return centerTypeRequest; } }
ReceivingCenterTypeRepository { public ReceivingCenterTypeReq persistReceivingCenterType(final ReceivingCenterTypeReq centerTypeRequest) { LOGGER.info("ReceivingCenterType Create Request::" + centerTypeRequest); final String receivingCenterTypeInsert = ReceivingCenterTypeQueryBuilder.insertReceivingCenterTypeQuery(); final ReceivingCenterType centerType = centerTypeRequest.getCenterType(); final Object[] obj = new Object[]{centerType.getCode(), centerType.getName(), centerType.getDescription(), centerType.getIscrnrequired(), centerType.getOrderno(), centerType.getActive(), Long.valueOf(centerTypeRequest.getRequestInfo().getUserInfo().getId()), Long.valueOf(centerTypeRequest.getRequestInfo().getUserInfo().getId()), new Date(new java.util.Date().getTime()), new Date(new java.util.Date().getTime()), centerType.getTenantId()}; jdbcTemplate.update(receivingCenterTypeInsert, obj); return centerTypeRequest; }  }
ReceivingCenterTypeRepository { public ReceivingCenterTypeReq persistReceivingCenterType(final ReceivingCenterTypeReq centerTypeRequest) { LOGGER.info("ReceivingCenterType Create Request::" + centerTypeRequest); final String receivingCenterTypeInsert = ReceivingCenterTypeQueryBuilder.insertReceivingCenterTypeQuery(); final ReceivingCenterType centerType = centerTypeRequest.getCenterType(); final Object[] obj = new Object[]{centerType.getCode(), centerType.getName(), centerType.getDescription(), centerType.getIscrnrequired(), centerType.getOrderno(), centerType.getActive(), Long.valueOf(centerTypeRequest.getRequestInfo().getUserInfo().getId()), Long.valueOf(centerTypeRequest.getRequestInfo().getUserInfo().getId()), new Date(new java.util.Date().getTime()), new Date(new java.util.Date().getTime()), centerType.getTenantId()}; jdbcTemplate.update(receivingCenterTypeInsert, obj); return centerTypeRequest; }  ReceivingCenterTypeReq persistReceivingCenterType(final ReceivingCenterTypeReq centerTypeRequest); ReceivingCenterTypeReq persistModifyReceivingCenterType(final ReceivingCenterTypeReq centerTypeRequest); List<ReceivingCenterType> getAllReceivingCenterTypes(final ReceivingCenterTypeGetReq centerTypeGetRequest); boolean checkReceivingCenterTypeByCode(final String code, final String tenantId); boolean checkReceivingCenterTypeByCodeAndName(String code, String name, String tenantId, String mode); boolean checkReceivingCenterNameExists(ReceivingCenterType receivingCenter, String mode); }
ReceivingCenterTypeRepository { public ReceivingCenterTypeReq persistReceivingCenterType(final ReceivingCenterTypeReq centerTypeRequest) { LOGGER.info("ReceivingCenterType Create Request::" + centerTypeRequest); final String receivingCenterTypeInsert = ReceivingCenterTypeQueryBuilder.insertReceivingCenterTypeQuery(); final ReceivingCenterType centerType = centerTypeRequest.getCenterType(); final Object[] obj = new Object[]{centerType.getCode(), centerType.getName(), centerType.getDescription(), centerType.getIscrnrequired(), centerType.getOrderno(), centerType.getActive(), Long.valueOf(centerTypeRequest.getRequestInfo().getUserInfo().getId()), Long.valueOf(centerTypeRequest.getRequestInfo().getUserInfo().getId()), new Date(new java.util.Date().getTime()), new Date(new java.util.Date().getTime()), centerType.getTenantId()}; jdbcTemplate.update(receivingCenterTypeInsert, obj); return centerTypeRequest; }  ReceivingCenterTypeReq persistReceivingCenterType(final ReceivingCenterTypeReq centerTypeRequest); ReceivingCenterTypeReq persistModifyReceivingCenterType(final ReceivingCenterTypeReq centerTypeRequest); List<ReceivingCenterType> getAllReceivingCenterTypes(final ReceivingCenterTypeGetReq centerTypeGetRequest); boolean checkReceivingCenterTypeByCode(final String code, final String tenantId); boolean checkReceivingCenterTypeByCodeAndName(String code, String name, String tenantId, String mode); boolean checkReceivingCenterNameExists(ReceivingCenterType receivingCenter, String mode); static final Logger LOGGER; }