Skip to content

Commit 944a55a

Browse files
committed
increase code coverage
1 parent 1aaea34 commit 944a55a

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

src/test/java/gov/loc/repository/bagit/conformance/BagLinterTest.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.io.File;
44
import java.io.InputStream;
5+
import java.lang.reflect.InvocationTargetException;
56
import java.nio.file.FileSystems;
67
import java.nio.file.Files;
78
import java.nio.file.Path;
@@ -11,16 +12,21 @@
1112
import java.util.HashSet;
1213
import java.util.Set;
1314

14-
import org.junit.Assert;
1515
import org.junit.Test;
1616

17+
import gov.loc.repository.bagit.PrivateConstructorTest;
1718
import gov.loc.repository.bagit.domain.Bag;
1819
import gov.loc.repository.bagit.reader.BagReader;
1920

20-
public class BagLinterTest extends Assert{
21+
public class BagLinterTest extends PrivateConstructorTest{
2122

2223
private final Path rootDir = Paths.get("src","test","resources","linterTestBag");
2324

25+
@Test
26+
public void testClassIsWellDefined() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException{
27+
assertUtilityClassWellDefined(BagLinter.class);
28+
}
29+
2430
@Test
2531
public void testLintBag() throws Exception{
2632
Set<BagitWarning> expectedWarnings = new HashSet<>();
@@ -48,4 +54,10 @@ public void testCheckAgainstProfile() throws Exception{
4854
BagLinter.checkAgainstProfile(inputStream, bag);
4955
}
5056
}
57+
58+
@Test
59+
public void testIgnoreCheckForExtraLines() throws Exception{
60+
Set<BagitWarning> warnings = BagLinter.lintBag(rootDir, Arrays.asList(BagitWarning.EXTRA_LINES_IN_BAGIT_FILES));
61+
assertFalse(warnings.contains(BagitWarning.EXTRA_LINES_IN_BAGIT_FILES));
62+
}
5163
}

0 commit comments

Comments
 (0)