@Test @Sql(scripts = { "/sql/clearRole.sql", "/sql/insertRoleData.sql" }) public void testRoleFinderWhenNoCodesAreGiven() throws Exception { RoleSearchCriteria roleSearchCriteria = RoleSearchCriteria.builder().build(); RoleFinderQueryBuilder queryBuilder = new RoleFinderQueryBuilder(roleSearchCriteria); List<Role> roles = (List<Role>) (List<?>) baseRepository.run(queryBuilder, new RoleRowMapper()); assertEquals(3, roles.size()); assertEquals("Citizen", roles.get(0).getName()); assertEquals("Employee", roles.get(1).getName()); assertEquals("Super User", roles.get(2).getName()); }
public List<Object> run(BaseQueryBuilder queryBuilder, RowMapper rowMapper) { String query = queryBuilder.build(); log.debug("Query : " + query); return jdbcTemplate.query(query, rowMapper); }
BaseRepository { public List<Object> run(BaseQueryBuilder queryBuilder, RowMapper rowMapper) { String query = queryBuilder.build(); log.debug("Query : " + query); return jdbcTemplate.query(query, rowMapper); } }
BaseRepository { public List<Object> run(BaseQueryBuilder queryBuilder, RowMapper rowMapper) { String query = queryBuilder.build(); log.debug("Query : " + query); return jdbcTemplate.query(query, rowMapper); } BaseRepository(JdbcTemplate jdbcTemplate); }
BaseRepository { public List<Object> run(BaseQueryBuilder queryBuilder, RowMapper rowMapper) { String query = queryBuilder.build(); log.debug("Query : " + query); return jdbcTemplate.query(query, rowMapper); } BaseRepository(JdbcTemplate jdbcTemplate); List<Object> run(BaseQueryBuilder queryBuilder, RowMapper rowMapper); }
BaseRepository { public List<Object> run(BaseQueryBuilder queryBuilder, RowMapper rowMapper) { String query = queryBuilder.build(); log.debug("Query : " + query); return jdbcTemplate.query(query, rowMapper); } BaseRepository(JdbcTemplate jdbcTemplate); List<Object> run(BaseQueryBuilder queryBuilder, RowMapper rowMapper);  }