@Test(expected = IllegalArgumentException.class) public void test_findAllTypesByNamespace_null_namespace() { final String namespace = null; getKewTypeBoService().findAllTypesByNamespace(namespace); }
@Override public List<KewTypeDefinition> findAllTypesByNamespace(final String namespace) { if (StringUtils.isBlank(namespace)) { throw new RiceIllegalArgumentException("namespace is blank"); } QueryByCriteria.Builder criteria = QueryByCriteria.Builder.create(); criteria.setPredicates(equal("namespace", namespace), equal("active", Boolean.TRUE)); Collection<KewTypeBo> kewTypeBos = dataObjectService.findMatching(KewTypeBo.class, criteria.build()).getResults(); return convertListOfBosToImmutables(kewTypeBos); }
KewTypeBoServiceImpl implements KewTypeRepositoryService { @Override public List<KewTypeDefinition> findAllTypesByNamespace(final String namespace) { if (StringUtils.isBlank(namespace)) { throw new RiceIllegalArgumentException("namespace is blank"); } QueryByCriteria.Builder criteria = QueryByCriteria.Builder.create(); criteria.setPredicates(equal("namespace", namespace), equal("active", Boolean.TRUE)); Collection<KewTypeBo> kewTypeBos = dataObjectService.findMatching(KewTypeBo.class, criteria.build()).getResults(); return convertListOfBosToImmutables(kewTypeBos); } }
KewTypeBoServiceImpl implements KewTypeRepositoryService { @Override public List<KewTypeDefinition> findAllTypesByNamespace(final String namespace) { if (StringUtils.isBlank(namespace)) { throw new RiceIllegalArgumentException("namespace is blank"); } QueryByCriteria.Builder criteria = QueryByCriteria.Builder.create(); criteria.setPredicates(equal("namespace", namespace), equal("active", Boolean.TRUE)); Collection<KewTypeBo> kewTypeBos = dataObjectService.findMatching(KewTypeBo.class, criteria.build()).getResults(); return convertListOfBosToImmutables(kewTypeBos); }  }
KewTypeBoServiceImpl implements KewTypeRepositoryService { @Override public List<KewTypeDefinition> findAllTypesByNamespace(final String namespace) { if (StringUtils.isBlank(namespace)) { throw new RiceIllegalArgumentException("namespace is blank"); } QueryByCriteria.Builder criteria = QueryByCriteria.Builder.create(); criteria.setPredicates(equal("namespace", namespace), equal("active", Boolean.TRUE)); Collection<KewTypeBo> kewTypeBos = dataObjectService.findMatching(KewTypeBo.class, criteria.build()).getResults(); return convertListOfBosToImmutables(kewTypeBos); }  @Override KewTypeDefinition createKewType(KewTypeDefinition kewType); @Override void updateKewType(KewTypeDefinition kewType); @Override KewTypeDefinition getTypeById(final String id); @Override KewTypeDefinition getTypeByNameAndNamespace(final String name, final String namespace); @Override List<KewTypeDefinition> findAllTypesByNamespace(final String namespace); @Override List<KewTypeDefinition> findAllTypes(); void setDataObjectService(final DataObjectService dataObjectService); @Override void createKewTypeAttribute(KewTypeAttribute kewTypeAttribute); @Override void updateKewTypeAttribute(KewTypeAttribute kewTypeAttribute); }
KewTypeBoServiceImpl implements KewTypeRepositoryService { @Override public List<KewTypeDefinition> findAllTypesByNamespace(final String namespace) { if (StringUtils.isBlank(namespace)) { throw new RiceIllegalArgumentException("namespace is blank"); } QueryByCriteria.Builder criteria = QueryByCriteria.Builder.create(); criteria.setPredicates(equal("namespace", namespace), equal("active", Boolean.TRUE)); Collection<KewTypeBo> kewTypeBos = dataObjectService.findMatching(KewTypeBo.class, criteria.build()).getResults(); return convertListOfBosToImmutables(kewTypeBos); }  @Override KewTypeDefinition createKewType(KewTypeDefinition kewType); @Override void updateKewType(KewTypeDefinition kewType); @Override KewTypeDefinition getTypeById(final String id); @Override KewTypeDefinition getTypeByNameAndNamespace(final String name, final String namespace); @Override List<KewTypeDefinition> findAllTypesByNamespace(final String namespace); @Override List<KewTypeDefinition> findAllTypes(); void setDataObjectService(final DataObjectService dataObjectService); @Override void createKewTypeAttribute(KewTypeAttribute kewTypeAttribute); @Override void updateKewTypeAttribute(KewTypeAttribute kewTypeAttribute);  }