Skip to content

Commit 4da91af

Browse files
committed
Added test when ruleset is not found by default RuleApp loading strategies
1 parent fffdf71 commit 4da91af

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/java/j2serulesession/SampleTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ public void testRuleAppArchiveFileNotFound() throws Exception {
6767
Sample.main(argLine.split(" "));
6868
}
6969

70+
@Test
71+
public void testRulesetNotBundled() throws Exception {
72+
try {
73+
exit.expectSystemExitWithStatus(2);
74+
String argLine = "/foo/bar";
75+
Sample.main(argLine.split(" "));
76+
} finally {
77+
String expectedErrorMessage = "It was not possible to retrieve the information about the ruleset /foo/bar.";
78+
assertTrue("SysErr does not contain the error message '" + expectedErrorMessage + "'",
79+
systemErrRule.getLog().contains(expectedErrorMessage));
80+
systemErrRule.clearLog();
81+
}
82+
}
83+
7084
@Test
7185
public void testNoRuleAppArchiveArgument() throws Exception {
7286
String argLine = "/test_deployment/loan_validation_with_score_and_grade";

0 commit comments

Comments
 (0)