Skip to content

Commit e3eea67

Browse files
committed
test for getResponsePhraseAsStringOrDefault
1 parent 838d1db commit e3eea67

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/test/java/zowe/client/sdk/rest/ResponseTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,27 @@ public void tstHasTextResponsePhraseWithValidStringValueSuccess() {
196196
assertTrue(response.hasTextResponsePhrase());
197197
}
198198

199+
@Test
200+
public void tstGetResponsePhraseAsStringOrDefaultSuccess() {
201+
final Response response = new Response("valid response", 200, "ok");
202+
203+
assertEquals("valid response", response.getResponsePhraseAsStringOrDefault("default"));
204+
}
205+
206+
@Test
207+
public void tstGetResponsePhraseAsStringOrDefaultForDefaultValueSuccess() {
208+
final Response response = new Response(null, 200, "ok");
209+
210+
assertEquals("default", response.getResponsePhraseAsStringOrDefault("default"));
211+
}
212+
213+
@Test
214+
public void tstGetResponsePhraseAsStringOrDefaultWithBlankResponsePhraseSuccess() {
215+
final Response response = new Response("", 200, "ok");
216+
217+
assertEquals("", response.getResponsePhraseAsStringOrDefault("default"));
218+
}
219+
199220
@Test
200221
public void tstToStringSuccess() {
201222
final Response response = new Response("hello", 200, "ok");

0 commit comments

Comments
 (0)