forked from plusone/plusone-commons
修改测试内容,体现 RestfulResult#successIf 方法允许只传入 condition 参数。
parent
4d6e116fc5
commit
8712d954e2
|
@ -11,8 +11,7 @@ class RestfulResultTest {
|
||||||
@Test
|
@Test
|
||||||
void testSuccessIf() {
|
void testSuccessIf() {
|
||||||
String str = null;
|
String str = null;
|
||||||
RestfulResult result = RestfulResult.successIf(str != null, "成功")
|
RestfulResult result = RestfulResult.successIf(str != null).orError();
|
||||||
.orError();
|
|
||||||
log.info(result.toString());
|
log.info(result.toString());
|
||||||
assertEquals(RestfulResult.DEFAULT_ERROR_STATUS, result.getStatus());
|
assertEquals(RestfulResult.DEFAULT_ERROR_STATUS, result.getStatus());
|
||||||
|
|
||||||
|
@ -23,8 +22,7 @@ class RestfulResultTest {
|
||||||
assertEquals("失败", result.getMessage());
|
assertEquals("失败", result.getMessage());
|
||||||
|
|
||||||
str = "";
|
str = "";
|
||||||
result = RestfulResult.successIf(str != null, "成功")
|
result = RestfulResult.successIf(str != null).orError();
|
||||||
.orError();
|
|
||||||
log.info(result.toString());
|
log.info(result.toString());
|
||||||
assertEquals(RestfulResult.SUCCESS_STATUS, result.getStatus());
|
assertEquals(RestfulResult.SUCCESS_STATUS, result.getStatus());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue