OperationAllowedSpecs { public static Specification<OperationAllowed> hasMetadataId(final String metadataId) { return hasMetadataId(Integer.valueOf(metadataId)); } private  OperationAllowedSpecs(); static Specification<OperationAllowed> hasMetadataId(final String metadataId); static Specification<OperationAllowed> hasMetadataId(final int metadataId); static Specification<OperationAllowed> hasGroupId(final int groupId); static Specification<OperationAllowed> hasOperation(final ReservedOperation operation); static Specification<OperationAllowed> hasOperationId(final int operationId); static Specification<OperationAllowed> isPublic(final ReservedOperation operation); static Specification<OperationAllowed> hasMetadataIdIn(final Collection<Integer> metadataIds); static Specification<OperationAllowed> hasGroupIdIn(final Collection<Integer> groupIds); static Specification<OperationAllowed> hasOperationIdIn(final Collection<Integer> operationIds);  }
@Test public void testHasMetadataId() { Specification<OperationAllowed> hasMetadataId = OperationAllowedSpecs.hasMetadataId(_md1.getId()); List<OperationAllowed> found = _opAllowRepo.findAll(hasMetadataId, new Sort(operationIdPath(), metadataIdPath())); assertEquals(found.size(), 3); assertEquals(_viewOp.getId(), found.get(0).getId().getOperationId()); assertEquals(_viewOp.getId(), found.get(1).getId().getOperationId()); assertEquals(_downloadOp.getId(), found.get(2).getId().getOperationId()); assertEquals(_allGroup.getId(), found.get(0).getId().getGroupId()); assertEquals(_md1.getId(), found.get(0).getId().getMetadataId()); assertEquals(_md1.getId(), found.get(1).getId().getMetadataId()); assertEquals(_md1.getId(), found.get(2).getId().getMetadataId()); }