22
33import java .io .File ;
44import java .io .InputStream ;
5+ import java .lang .reflect .InvocationTargetException ;
56import java .nio .file .FileSystems ;
67import java .nio .file .Files ;
78import java .nio .file .Path ;
1112import java .util .HashSet ;
1213import java .util .Set ;
1314
14- import org .junit .Assert ;
1515import org .junit .Test ;
1616
17+ import gov .loc .repository .bagit .PrivateConstructorTest ;
1718import gov .loc .repository .bagit .domain .Bag ;
1819import 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