@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());
}