@Test @Sql(scripts = { "/sql/clearAction.sql", "/sql/insertActionData.sql" }) public void testShouldReturnActionForUserRole() throws Exception { ActionSearchCriteria actionSearchCriteria = ActionSearchCriteria.builder().tenantId("ap.public") .roleCodes(Arrays.asList("CITIZEN", "SUPERUSER")).build(); ActionFinderQueryBuilder queryBuilder = new ActionFinderQueryBuilder(actionSearchCriteria); List<Action> actions = (List<Action>) (List<?>) baseRepository.run(queryBuilder, new ActionRowMapper()); assertEquals(8, actions.size()); assertEquals(Long.valueOf(3), actions.get(0).getId()); assertEquals("Get ComplaintType by type,count and tenantId", actions.get(0).getName()); assertEquals("/pgr/services", actions.get(0).getUrl()); assertEquals("Get ComplaintType by type,count and tenantId", actions.get(0).getDisplayName()); assertEquals("ap.public", actions.get(0).getTenantId()); assertEquals(Integer.valueOf(5), actions.get(0).getOrderNumber()); assertEquals(false, actions.get(0).isEnabled()); assertEquals(Long.valueOf(1), actions.get(0).getCreatedBy()); assertEquals(Long.valueOf(1), actions.get(0).getLastModifiedBy()); String currDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); assertEquals(currDate, actions.get(0).getCreatedDate().toString()); assertEquals(currDate, actions.get(0).getLastModifiedDate().toString()); assertEquals("PgrComp", actions.get(0).getParentModule()); assertEquals("PGR", actions.get(0).getServiceCode()); }
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);  }