agave-metadata/metadata-core/src/test/java/org/iplantc/service/metadata/search/MetadataDataProcessingIT.java
//find metadata item - with read permission
find metadata item - with read permission
find metadata item - with read permission
@Test(dataProvider = "initMetadataItemDataProvider")
    public void findSingleMetadataItemTest(String user, String jsonQuery, boolean bolCanRead, String message) throws MetadataException, MetadataStoreException, MetadataQueryException {
        JsonHandler jsonHandler = new JsonHandler();
        Document docQuery = jsonHandler.parseUserQueryToDocument(jsonQuery);
        MetadataSearch search = new MetadataSearch(user);
        search.setAccessibleOwnersImplicit();
        List<MetadataItem> result = search.find(docQuery);
        for (MetadataItem metadataItem : result) {
            Assert.assertEquals(metadataItem, addedMetadataItem, "Found MetadataItem should match the added MetadataItem.");
            MetadataPermissionManager pemManager = new MetadataPermissionManager(metadataItem, metadataItem.getOwner());
            assertEquals(pemManager.canRead(user), bolCanRead, message);
        }
    }
@ Test ( dataProvider = "initMetadataItemDataProvider" ) public void findSingleMetadataItemTest ( String user , String jsonQuery , boolean bolCanRead , String message ) throws MetadataException , MetadataStoreException , MetadataQueryException { JsonHandler jsonHandler = new JsonHandler ( ) ; Document docQuery = jsonHandler . parseUserQueryToDocument ( jsonQuery ) ; MetadataSearch search = new MetadataSearch ( user ) ; search . setAccessibleOwnersImplicit ( ) ; List < MetadataItem > result = search . find ( docQuery ) ; for ( MetadataItem metadataItem : result ) { Assert . assertEquals ( metadataItem , addedMetadataItem , "Found MetadataItem should match the added MetadataItem." ) ; MetadataPermissionManager pemManager = new MetadataPermissionManager ( metadataItem , metadataItem . getOwner ( ) ) ; assertEquals ( pemManager . canRead ( user ) , bolCanRead , message ) ; } }
find metadata item - with read permission
find metadata item - with read permission