Search in sources :

Example 1 with StandardResourceClaim

use of org.apache.nifi.controller.repository.claim.StandardResourceClaim in project nifi by apache.

the class TestFileSystemRepository method testReadWithNoContent.

@Test(expected = ContentNotFoundException.class)
public void testReadWithNoContent() throws IOException {
    final ContentClaim claim = new StandardContentClaim(new StandardResourceClaim(claimManager, "container1", "section 1", "1", false), 0L);
    final InputStream in = repository.read(claim);
    in.close();
}
Also used : ContentClaim(org.apache.nifi.controller.repository.claim.ContentClaim) StandardContentClaim(org.apache.nifi.controller.repository.claim.StandardContentClaim) StandardContentClaim(org.apache.nifi.controller.repository.claim.StandardContentClaim) StandardResourceClaim(org.apache.nifi.controller.repository.claim.StandardResourceClaim) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) Test(org.junit.Test)

Example 2 with StandardResourceClaim

use of org.apache.nifi.controller.repository.claim.StandardResourceClaim in project nifi by apache.

the class TestFileSystemRepository method testSizeWithNoContent.

@Test(expected = ContentNotFoundException.class)
public void testSizeWithNoContent() throws IOException {
    final ContentClaim claim = new StandardContentClaim(new StandardResourceClaim(claimManager, "container1", "section 1", "1", false), 0L);
    assertEquals(0L, repository.size(claim));
}
Also used : ContentClaim(org.apache.nifi.controller.repository.claim.ContentClaim) StandardContentClaim(org.apache.nifi.controller.repository.claim.StandardContentClaim) StandardContentClaim(org.apache.nifi.controller.repository.claim.StandardContentClaim) StandardResourceClaim(org.apache.nifi.controller.repository.claim.StandardResourceClaim) Test(org.junit.Test)

Aggregations

ContentClaim (org.apache.nifi.controller.repository.claim.ContentClaim)2 StandardContentClaim (org.apache.nifi.controller.repository.claim.StandardContentClaim)2 StandardResourceClaim (org.apache.nifi.controller.repository.claim.StandardResourceClaim)2 Test (org.junit.Test)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1