Class ResponseContentAssert
-
- All Implemented Interfaces:
-
org.assertj.core.api.Assert,org.assertj.core.api.Descriptable,org.assertj.core.api.ExtensionPoints
public class ResponseContentAssert<SELF extends ResponseContentAssert<SELF>> extends AbstractAssert<SELF, ResponseEntity<String>>
对于业务结果可以理解为 成功或者失败,业务代码,业务概述,业务数据
CJ
-
-
Field Summary
Fields Modifier and Type Field Description public final WritableAssertionInfoinfo
-
Constructor Summary
Constructors Constructor Description ResponseContentAssert(ResponseEntity<String> actual, ToBusinessResult business)
-
Method Summary
Modifier and Type Method Description final SELFisLegalResponse()final SELFisFailedResponse()final SELFisSuccessResponse()final SELFisErrorCodeMatch(String code)final SELFprint()final SELFisListResponse()final NormalJsonNodeArrayAssertasListAssert()final SELFisObjectResponse()final NormalJsonNodeObjectAssertasObject()final RestResourceCollectionAssertasSpringRestCollection()final RestResourceAssertasSpringRest()final <T extends Any> TreadData(Class<T> javaClass)返回数据结果 final <T extends Any> TreadData()final <T extends Any> ObjectAssert<T>asData(Class<T> javaClass)final <T extends Any> TreadFromData(Function1<BusinessResult, T> reader)final <T extends Any> TreadFromEntity(Function1<ResponseEntity<String>, T> reader)-
Methods inherited from class org.assertj.core.api.AbstractAssert
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, getWritableAssertionInfo, has, hasSameClassAs, hasSameHashCodeAs, hasToString, hashCode, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, overridingErrorMessage, satisfies, satisfies, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ResponseContentAssert
ResponseContentAssert(ResponseEntity<String> actual, ToBusinessResult business)
-
-
Method Detail
-
isLegalResponse
final SELF isLegalResponse()
- Returns:
这是一个合法的响应
-
isFailedResponse
final SELF isFailedResponse()
- Returns:
是个失败的请求
-
isSuccessResponse
final SELF isSuccessResponse()
- Returns:
是个成功的请求
-
isErrorCodeMatch
final SELF isErrorCodeMatch(String code)
-
isListResponse
final SELF isListResponse()
- Returns:
断言业务结果是数组
-
asListAssert
final NormalJsonNodeArrayAssert asListAssert()
- Returns:
转成数组断言
-
isObjectResponse
final SELF isObjectResponse()
- Returns:
断言业务数据是对象
-
asObject
final NormalJsonNodeObjectAssert asObject()
- Returns:
转成对象断言
-
asSpringRestCollection
final RestResourceCollectionAssert asSpringRestCollection()
- Returns:
转成 spring rest 资源集合断言
-
asSpringRest
final RestResourceAssert asSpringRest()
- Returns:
转成 spring rest 单个资源断言
-
readFromData
final <T extends Any> T readFromData(Function1<BusinessResult, T> reader)
-
readFromEntity
final <T extends Any> T readFromEntity(Function1<ResponseEntity<String>, T> reader)
-
-
-
-