I write simple main class, which requires two arguments "app firstOne secondOne". I want write Junit test to check, that user put right count of arguments
public static void main(String[] args) {
if (args.length == 2) {
someMethod();
System.exit(1);
} else
System.exit(0);
}
And i want check which exit status return.
I found solmething using
@Rule
public final ExpectedSystemExit exit = ExpectedSystemExit.none();
But it do not find lib (I am using now Junit version 4.13.beta-1)
org.junit.contrib.java.lang.system.ExpectedSystemExit
Have You any idea how to write test which will check right number of argument passed to program?