Skip to content

Commit 56bfbe3

Browse files
🚀 Updated tests
1 parent 02cf108 commit 56bfbe3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/test/java/org/rrajesh1979/tool/JWTCTest.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,32 @@ void mainDecodeTest() {
6161
.execute(args);
6262
assertEquals(0, exitCode);
6363
}
64+
65+
@Test
66+
@DisplayName("Test JWTC Main")
67+
void mainTest() {
68+
String[] args = {};
69+
System.out.println(String.join(" ", args));
70+
CommandLine jwtcCommandLine = new CommandLine(new JWTC());
71+
int exitCode = jwtcCommandLine
72+
.setColorScheme(JWTC.getColorScheme())
73+
.execute(args);
74+
assertEquals(0, exitCode);
75+
}
76+
77+
@Test
78+
@DisplayName("Test JWTC Main - Invalid Command")
79+
void mainInvalidTest() {
80+
String userInput = "{}";
81+
82+
String[] args = {
83+
"invalid"
84+
};
85+
System.out.println(String.join(" ", args));
86+
CommandLine jwtcCommandLine = new CommandLine(new JWTC());
87+
int exitCode = jwtcCommandLine
88+
.setColorScheme(JWTC.getColorScheme())
89+
.execute(args);
90+
assertNotEquals(0, exitCode);
91+
}
6492
}

0 commit comments

Comments
 (0)