@Test public void testGetOptionParser() throws Exception { OptionParser optionParser = Main.getOptionParser(); String tmpDir = systemTempDir().toString(); OptionSet optionSet = optionParser.parse( "-f", "/tmp/dummy", "-s", "9908:976098897", "-r", "9908:810017902", "-u", "https://ap.unit4.com", "-m", "as2", "-e", tmpDir); assertTrue(optionSet.has("u")); assertTrue(optionSet.has("f")); assertTrue(optionSet.has("e")); Object e = optionSet.valueOf("e"); assertNotNull(e); assertTrue(e instanceof File); File f = (File) e; assertEquals(f, new File(tmpDir)); }
@Test public void senderAndReceiverIsOptional() throws Exception { OptionParser optionParser = Main.getOptionParser(); OptionSet optionSet = optionParser.parse("-f", "/tmp/dummy", "-u", "https://ap.unit4.com", "-m", "as2"); assertFalse(optionSet.has("-r")); assertFalse(optionSet.has("-s")); }