修改测试内容,体现 RestfulResult#successIf 方法允许只传入 condition 参数。

feature/net-util
ZhouXY108 2023-04-15 03:57:26 +08:00
parent 4d6e116fc5
commit 8712d954e2
1 changed files with 2 additions and 4 deletions

View File

@ -11,8 +11,7 @@ class RestfulResultTest {
@Test
void testSuccessIf() {
String str = null;
RestfulResult result = RestfulResult.successIf(str != null, "成功")
.orError();
RestfulResult result = RestfulResult.successIf(str != null).orError();
log.info(result.toString());
assertEquals(RestfulResult.DEFAULT_ERROR_STATUS, result.getStatus());
@ -23,8 +22,7 @@ class RestfulResultTest {
assertEquals("失败", result.getMessage());
str = "";
result = RestfulResult.successIf(str != null, "成功")
.orError();
result = RestfulResult.successIf(str != null).orError();
log.info(result.toString());
assertEquals(RestfulResult.SUCCESS_STATUS, result.getStatus());