@Test @Sql(scripts = { "/sql/clearAction.sql", "/sql/clearRole.sql", "/sql/insertActionData.sql", "/sql/insertRoleData.sql" }) public void testActionValidationWhenAllowed() { ValidateActionCriteria criteria = ValidateActionCriteria.builder() .roleNames(Arrays.asList("Citizen", "Super User")).tenantId("ap.public").actionUrl("/pgr/receivingmode") .build(); ValidateActionQueryBuilder queryBuilder = new ValidateActionQueryBuilder(criteria); List<Object> validations = baseRepository.run(queryBuilder, new ActionValidationRowMapper()); ActionValidation validation = (ActionValidation) validations.get(0); assert (validation.isAllowed()); }
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);  }