@Test public void testQueryToFindRolesWhenNoRoleCodes() { RoleSearchCriteria criteria = RoleSearchCriteria.builder().build(); RoleFinderQueryBuilder builder = new RoleFinderQueryBuilder(criteria); String expectedQuery = "SELECT r.name as r_name,r.code as r_code, r.description as r_description from eg_ms_role r " + "ORDER BY r_name"; assertEquals(expectedQuery, builder.build()); }
@Override public String build() { filterRoleCodes(); String filterQuery = shouldFilter() ? " WHERE " + String.join(" AND ", filters) : ""; return BASE_QUERY + filterQuery + " ORDER BY r_name"; }
RoleFinderQueryBuilder implements BaseQueryBuilder { @Override public String build() { filterRoleCodes(); String filterQuery = shouldFilter() ? " WHERE " + String.join(" AND ", filters) : ""; return BASE_QUERY + filterQuery + " ORDER BY r_name"; } }
RoleFinderQueryBuilder implements BaseQueryBuilder { @Override public String build() { filterRoleCodes(); String filterQuery = shouldFilter() ? " WHERE " + String.join(" AND ", filters) : ""; return BASE_QUERY + filterQuery + " ORDER BY r_name"; } RoleFinderQueryBuilder(RoleSearchCriteria criteria); }
RoleFinderQueryBuilder implements BaseQueryBuilder { @Override public String build() { filterRoleCodes(); String filterQuery = shouldFilter() ? " WHERE " + String.join(" AND ", filters) : ""; return BASE_QUERY + filterQuery + " ORDER BY r_name"; } RoleFinderQueryBuilder(RoleSearchCriteria criteria); @Override String build(); }
RoleFinderQueryBuilder implements BaseQueryBuilder { @Override public String build() { filterRoleCodes(); String filterQuery = shouldFilter() ? " WHERE " + String.join(" AND ", filters) : ""; return BASE_QUERY + filterQuery + " ORDER BY r_name"; } RoleFinderQueryBuilder(RoleSearchCriteria criteria); @Override String build();  }