Skip to content

Commit 9642767

Browse files
committed
added test for error being thrown when payload oxum doesn't exist and a
quick verify is performed
1 parent 4f1c196 commit 9642767

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/test/java/gov/loc/repository/bagit/verify/BagVerifierTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import gov.loc.repository.bagit.exceptions.MissingBagitFileException;
2828
import gov.loc.repository.bagit.exceptions.MissingPayloadDirectoryException;
2929
import gov.loc.repository.bagit.exceptions.MissingPayloadManifestException;
30+
import gov.loc.repository.bagit.exceptions.PayloadOxumDoesNotExistException;
3031
import gov.loc.repository.bagit.hash.StandardSupportedAlgorithms;
3132
import gov.loc.repository.bagit.reader.BagReader;
3233

@@ -65,6 +66,13 @@ public void testQuickVerify() throws Exception{
6566
sut.quicklyVerify(bag, true);
6667
}
6768

69+
@Test(expected=PayloadOxumDoesNotExistException.class)
70+
public void testExceptionIsThrownWhenPayloadOxumDoesntExist() throws Exception{
71+
Bag bag = reader.read(rootDir);
72+
sut.quicklyVerify(bag, true);
73+
74+
}
75+
6876
@Test(expected=InvalidPayloadOxumException.class)
6977
public void testInvalidByteSizeForQuickVerify() throws Exception{
7078
Path badRootDir = Paths.get(getClass().getClassLoader().getResource("badPayloadOxumByteSize/bag").toURI());

0 commit comments

Comments
 (0)