@Test public void test_Should_Find_ReceivingCenter_Valid() { final List<Object> preparedStatementValues = new ArrayList<>(); final ReceivingCenterTypeGetReq receivingCenterGetReq = Mockito.mock(ReceivingCenterTypeGetReq.class); final String queryString = "MyQuery"; when(receivingCenterQueryBuilder.getQuery(receivingCenterGetReq, preparedStatementValues)).thenReturn(queryString); final List< ReceivingCenterType> connectionCategories = new ArrayList<>(); when(jdbcTemplate.query(queryString, preparedStatementValues.toArray(), receivingCenterRowMapper)) .thenReturn(connectionCategories); assertTrue( connectionCategories.equals(receivingCenterRepository.getAllReceivingCenterTypes(receivingCenterGetReq))); }
public List<ReceivingCenterType> getAllReceivingCenterTypes(final ReceivingCenterTypeGetReq centerTypeGetRequest) { LOGGER.info("ReceivingCenterType search Request::" + centerTypeGetRequest); final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = receivingCenterQueryBuilder.getQuery(centerTypeGetRequest, preparedStatementValues); final List<ReceivingCenterType> receivingCenterTypes = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), receivingCenterRowMapper); return receivingCenterTypes; }
ReceivingCenterTypeRepository { public List<ReceivingCenterType> getAllReceivingCenterTypes(final ReceivingCenterTypeGetReq centerTypeGetRequest) { LOGGER.info("ReceivingCenterType search Request::" + centerTypeGetRequest); final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = receivingCenterQueryBuilder.getQuery(centerTypeGetRequest, preparedStatementValues); final List<ReceivingCenterType> receivingCenterTypes = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), receivingCenterRowMapper); return receivingCenterTypes; } }
ReceivingCenterTypeRepository { public List<ReceivingCenterType> getAllReceivingCenterTypes(final ReceivingCenterTypeGetReq centerTypeGetRequest) { LOGGER.info("ReceivingCenterType search Request::" + centerTypeGetRequest); final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = receivingCenterQueryBuilder.getQuery(centerTypeGetRequest, preparedStatementValues); final List<ReceivingCenterType> receivingCenterTypes = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), receivingCenterRowMapper); return receivingCenterTypes; }  }
ReceivingCenterTypeRepository { public List<ReceivingCenterType> getAllReceivingCenterTypes(final ReceivingCenterTypeGetReq centerTypeGetRequest) { LOGGER.info("ReceivingCenterType search Request::" + centerTypeGetRequest); final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = receivingCenterQueryBuilder.getQuery(centerTypeGetRequest, preparedStatementValues); final List<ReceivingCenterType> receivingCenterTypes = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), receivingCenterRowMapper); return receivingCenterTypes; }  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 List<ReceivingCenterType> getAllReceivingCenterTypes(final ReceivingCenterTypeGetReq centerTypeGetRequest) { LOGGER.info("ReceivingCenterType search Request::" + centerTypeGetRequest); final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = receivingCenterQueryBuilder.getQuery(centerTypeGetRequest, preparedStatementValues); final List<ReceivingCenterType> receivingCenterTypes = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), receivingCenterRowMapper); return receivingCenterTypes; }  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; }