Module methanol.testing
Class ResponseVerifier<T>
java.lang.Object
com.github.mizosoft.methanol.testing.verifiers.ResponseVerifier<T>
A small DSL for testing
HttpResponses
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
containsHeader
(String name, long value) containsHeader
(String name, String value) containsHeader
(String name, List<String> values) containsHeaders
(Map<String, List<String>> headers) containsHeadersExactly
(HttpHeaders headers) containsRequestHeader
(String name, String value) containsRequestHeadersExactly
(String... headers) containsRequestHeadersExactly
(HttpHeaders headers) doesNotContainHeader
(String name) get()
hasCacheStatus
(CacheAwareResponse.CacheStatus expected) hasCode
(int code) hasSslSession
(Optional<SSLSession> expected) hasSslSession
(SSLSession expected) Tests if this is a conditional cache hit resulting from a request that is conditionalized by the client and evaluated by the cache, rather than conditionalized by the cache and evaluated by the origin.isSecure()
requestWasSentAt
(Instant expected) responseWasReceivedAt
(Instant expected)
-
Constructor Details
-
ResponseVerifier
-
-
Method Details
-
hasUri
-
hasCode
-
hasBody
-
hasNoBody
-
containsHeader
-
containsHeader
-
containsHeader
-
doesNotContainHeader
-
containsHeaders
-
containsHeadersExactly
-
containsHeadersExactlyDiscardingStrippedContentEncoding
public ResponseVerifier<T> containsHeadersExactlyDiscardingStrippedContentEncoding(HttpHeaders headers) -
containsRequestHeader
-
doesNotContainRequestHeader
-
containsRequestHeadersExactly
-
containsRequestHeadersExactly
-
isSecure
-
isNotSecure
-
hasSslSession
-
hasSslSession
-
requestWasSentAt
-
responseWasReceivedAt
-
hasCacheStatus
-
hasNetworkResponse
-
hasCacheResponse
-
hasNoNetworkResponse
-
hasNoCacheResponse
-
isCacheHit
-
isExternallyConditionalCacheHit
Tests if this is a conditional cache hit resulting from a request that is conditionalized by the client and evaluated by the cache, rather than conditionalized by the cache and evaluated by the origin. The latter is checked withisConditionalHit()
. -
isConditionalHit
-
isConditionalMiss
-
isCacheMiss
-
isCacheMissWithCacheResponse
-
isCacheUnsatisfaction
-
isCachedWithSsl
-
networkResponse
-
cacheResponse
-
previousResponse
-
hasPreviousResponse
-
assertIsTracked
public void assertIsTracked() -
assertIsCacheAware
public void assertIsCacheAware() -
sslSession
-
get
-
getTrackedResponse
-
getCacheAwareResponse
-