Class ResponseAssert

  • All Implemented Interfaces:
    org.assertj.core.api.Assert<ResponseAssert,​javax.ws.rs.core.Response>, org.assertj.core.api.Descriptable<ResponseAssert>, org.assertj.core.api.ExtensionPoints<ResponseAssert,​javax.ws.rs.core.Response>

    public class ResponseAssert
    extends org.assertj.core.api.AbstractAssert<ResponseAssert,​javax.ws.rs.core.Response>
    Assertions for jax-rs Response.
    Author:
    poirigui
    • Field Summary

      • Fields inherited from class org.assertj.core.api.AbstractAssert

        actual, info, myself, objects, throwUnsupportedExceptionOnEquals
    • Constructor Summary

      Constructors 
      Constructor Description
      ResponseAssert​(javax.ws.rs.core.Response actual)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.assertj.core.api.MapAssert<String,​javax.ws.rs.core.NewCookie> cookies()  
      org.assertj.core.api.ObjectAssert<?> entity()  
      <T> org.assertj.core.api.ObjectAssert<T> entityAs​(Class<T> clazz)  
      org.assertj.core.api.InputStreamAssert entityAsStream()  
      org.assertj.core.api.StringAssert entityAsString()  
      ResponseAssert hasEncoding​(String encoding)
      Asserts that the response has the given 'Content-Encoding' header.
      ResponseAssert hasHeader​(String name, String value)
      Asserts that the response has the given header.
      ResponseAssert hasHeaderSatisfying​(String name, Consumer<List<String>> consumer)  
      ResponseAssert hasLanguage​(Locale locale)  
      ResponseAssert hasLength​(int length)  
      ResponseAssert hasMediaType​(javax.ws.rs.core.MediaType mediaType)
      Asserts that the response has the given media type.
      ResponseAssert hasMediaTypeCompatibleWith​(javax.ws.rs.core.MediaType mediaType)
      Asserts that the response has a media type compatible with the given media type.
      ResponseAssert hasStatus​(javax.ws.rs.core.Response.Status status)
      Asserts that the response has the given status code and reason phrase.
      ResponseAssert hasStatusFamily​(javax.ws.rs.core.Response.Status.Family family)
      Asserts that that response status is within the given status family.
      org.assertj.core.api.MapAssert<String,​List<String>> headers()  
      • Methods inherited from class org.assertj.core.api.AbstractAssert

        areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
      • Methods inherited from interface org.assertj.core.api.Descriptable

        as, as, as, describedAs, describedAs
    • Constructor Detail

      • ResponseAssert

        public ResponseAssert​(javax.ws.rs.core.Response actual)
    • Method Detail

      • hasStatus

        public ResponseAssert hasStatus​(javax.ws.rs.core.Response.Status status)
        Asserts that the response has the given status code and reason phrase.
      • hasStatusFamily

        public ResponseAssert hasStatusFamily​(javax.ws.rs.core.Response.Status.Family family)
        Asserts that that response status is within the given status family.
      • hasMediaType

        public ResponseAssert hasMediaType​(javax.ws.rs.core.MediaType mediaType)
        Asserts that the response has the given media type.
      • hasMediaTypeCompatibleWith

        public ResponseAssert hasMediaTypeCompatibleWith​(javax.ws.rs.core.MediaType mediaType)
        Asserts that the response has a media type compatible with the given media type.
      • headers

        public org.assertj.core.api.MapAssert<String,​List<String>> headers()
      • hasHeader

        public ResponseAssert hasHeader​(String name,
                                        String value)
        Asserts that the response has the given header.

        If the header is multivalued, asserts that at least one value is satisfied.

      • hasEncoding

        public ResponseAssert hasEncoding​(String encoding)
        Asserts that the response has the given 'Content-Encoding' header.
      • cookies

        public org.assertj.core.api.MapAssert<String,​javax.ws.rs.core.NewCookie> cookies()
      • entity

        public org.assertj.core.api.ObjectAssert<?> entity()
      • entityAs

        public <T> org.assertj.core.api.ObjectAssert<T> entityAs​(Class<T> clazz)
      • entityAsString

        public org.assertj.core.api.StringAssert entityAsString()
      • entityAsStream

        public org.assertj.core.api.InputStreamAssert entityAsStream()