Skip to content

Commit 8e520c7

Browse files
Update TsoStartTest to check for JSON error messages
Signed-off-by: Frank Giordano <giofr01@yahoo.com>
1 parent e3eea67 commit 8e520c7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/test/java/zowe/client/sdk/zostso/methods/TsoStartTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,16 @@ public void tstTsoStartInvalidJsonThrowsZosmfRequestExceptionWithCorrectMessageF
9696
mocked.when(() -> TsoUtils.getResponseStr(any()))
9797
.thenReturn("invalid json response");
9898

99-
ZosmfRequestException ex = assertThrows(ZosmfRequestException.class,
100-
() -> tsoStart.start(input));
101-
assertTrue(ex.getMessage().contains("invalid json response"));
99+
ZosmfRequestException ex = assertThrows(
100+
ZosmfRequestException.class,
101+
() -> tsoStart.start(input)
102+
);
103+
104+
assertNotNull(ex.getMessage());
105+
assertTrue(
106+
ex.getMessage().contains("Unrecognized token")
107+
|| ex.getMessage().toLowerCase().contains("json")
108+
);
102109
}
103110
}
104111

0 commit comments

Comments
 (0)