Skip to content

Commit 48f9f61

Browse files
committed
chore: coverage #562
1 parent 6efa1f1 commit 48f9f61

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

fj-doc-val-core/src/main/java/org/fugerit/java/doc/val/core/basic/AbstractDocTypeValidator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public boolean checkCompatibility() {
7979
}
8080

8181
protected void logFailedCheck( String type, Exception e ) {
82-
logger.warn( "Failed check on {} : {}", type, e.toString() );
82+
String message = e.toString();
83+
logger.warn( "Failed check on {} : {}", type, message );
8384
}
8485

8586
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package test.org.fugerit.java.doc.core.val;
2+
3+
import org.fugerit.java.core.cfg.ConfigRuntimeException;
4+
import org.fugerit.java.doc.val.core.DocTypeValidationResult;
5+
import org.fugerit.java.doc.val.core.DocTypeValidator;
6+
import org.fugerit.java.doc.val.core.basic.AbstractDocTypeValidator;
7+
import org.junit.jupiter.api.Assertions;
8+
import org.junit.jupiter.api.Test;
9+
10+
import java.io.IOException;
11+
import java.io.InputStream;
12+
13+
class TestAbstractDocTypeValidator {
14+
15+
@Test
16+
public void testValidate() throws IOException {
17+
DocTypeValidator validator = new AbstractDocTypeValidator( "a", "b" ) {
18+
@Override
19+
public DocTypeValidationResult validate(InputStream is) {
20+
this.logFailedCheck( this.getMimeType(), new ConfigRuntimeException( "scenario exception" ) );
21+
return null;
22+
}
23+
};
24+
Assertions.assertNull( validator.validate( (InputStream) null ) );
25+
}
26+
27+
}

0 commit comments

Comments
 (0)