-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More tests + fixed some sonarcloud issues
- Loading branch information
1 parent
a0140ee
commit e45f7b9
Showing
5 changed files
with
77 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/test/java/nl/esciencecenter/xenon/grpc/XenonServerWrapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package nl.esciencecenter.xenon.grpc; | ||
|
||
import net.sourceforge.argparse4j.inf.ArgumentParser; | ||
import net.sourceforge.argparse4j.inf.ArgumentParserException; | ||
import org.junit.Test; | ||
|
||
import static org.hamcrest.core.StringContains.containsString; | ||
import static org.junit.Assert.*; | ||
|
||
public class XenonServerWrapperTest { | ||
|
||
@Test | ||
public void buildArgumentParser() { | ||
XenonServerWrapper wrapper = new XenonServerWrapper(); | ||
|
||
ArgumentParser parser = wrapper.buildArgumentParser(); | ||
|
||
String help = parser.formatHelp(); | ||
assertThat(help, containsString("port")); | ||
assertThat(help, containsString("TLS")); | ||
} | ||
|
||
@Test | ||
public void parseArgs_noargs() throws ArgumentParserException { | ||
XenonServerWrapper wrapper = new XenonServerWrapper(); | ||
|
||
wrapper.parseArgs(new String[0]); | ||
|
||
assertEquals("Default port", XenonServerWrapper.DEFAULT_PORT, wrapper.getPort()); | ||
assertFalse("no TLS", wrapper.getUseTLS()); | ||
} | ||
} |