Redirect warning in compaction
This commit is contained in:
@@ -2,11 +2,13 @@ package org.oneedtech.inspect.vc;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
import static org.oneedtech.inspect.test.Assertions.assertValid;
|
||||
import static org.oneedtech.inspect.test.Assertions.assertWarning;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.oneedtech.inspect.core.Inspector.Behavior;
|
||||
import org.oneedtech.inspect.core.report.Report;
|
||||
@@ -22,7 +24,7 @@ public class OB20Tests {
|
||||
validator = new TestBuilder()
|
||||
.add(new URI("https://www.example.org/"), "ob20/assets")
|
||||
.set(Behavior.TEST_INCLUDE_SUCCESS, true)
|
||||
.set(Behavior.TEST_INCLUDE_WARNINGS, true)
|
||||
.set(Behavior.TEST_INCLUDE_WARNINGS, false)
|
||||
.set(Behavior.VALIDATOR_FAIL_FAST, true)
|
||||
.set(OB20Inspector.Behavior.ALLOW_LOCAL_REDIRECTION, true)
|
||||
.build();
|
||||
@@ -36,4 +38,27 @@ public class OB20Tests {
|
||||
assertValid(report);
|
||||
});
|
||||
}
|
||||
|
||||
@Nested
|
||||
static class WarningTests {
|
||||
@BeforeAll
|
||||
static void setup() throws URISyntaxException {
|
||||
validator = new TestBuilder()
|
||||
.add(new URI("https://www.example.org/"), "ob20/assets")
|
||||
.set(Behavior.TEST_INCLUDE_SUCCESS, true)
|
||||
.set(Behavior.TEST_INCLUDE_WARNINGS, true)
|
||||
.set(Behavior.VALIDATOR_FAIL_FAST, true)
|
||||
.set(OB20Inspector.Behavior.ALLOW_LOCAL_REDIRECTION, true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testWarningRedirectionJsonValid() {
|
||||
assertDoesNotThrow(()->{
|
||||
Report report = validator.run(Samples.OB20.JSON.WARNING_REDIRECTION_ASSERTION_JSON.asFileResource());
|
||||
if(verbose) PrintHelper.print(report, true);
|
||||
assertWarning(report);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user