Class ResponseAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<ResponseAssert, javax.ws.rs.core.Response>
ubic.gemma.rest.util.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

    Modifier and Type
    Method
    Description
    org.assertj.core.api.MapAssert<String, javax.ws.rs.core.NewCookie>
     
     
    Asserts that the response does not have the given header.
    Asserts that the response does not have the given header with a particular value.
    org.assertj.core.api.ObjectAssert<?>
     
    <T> org.assertj.core.api.ObjectAssert<T>
    entityAs(Class<T> clazz)
     
    org.assertj.core.api.InputStreamAssert
     
    org.assertj.core.api.StringAssert
     
    hasEncoding(String encoding)
    Asserts that the response has the given 'Content-Encoding' header.
    Asserts that the response has the given header.
     
    Asserts that the response has the given header with a particular value.
     
    Asserts that the response has a 'Content-Length' header.
    hasLength(int length)
    Asserts that the response has a 'Content-Length' header with the given length.
    hasMediaType(javax.ws.rs.core.MediaType mediaType)
    Asserts that the response has the given media type.
    hasMediaTypeCompatibleWith(javax.ws.rs.core.MediaType mediaType)
    Asserts that the response has a media type compatible with the given media type.
    hasStatus(javax.ws.rs.core.Response.Status status)
    Asserts that the response has the given status code and reason phrase.
    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>>
     

    Methods inherited from class org.assertj.core.api.AbstractAssert

    actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, 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, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable

    as, as, as, describedAs, describedAs
  • Constructor Details

    • ResponseAssert

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

    • 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)
      Asserts that the response has the given header.
    • hasHeaderWithValue

      public ResponseAssert hasHeaderWithValue(String name, String value)
      Asserts that the response has the given header with a particular value.

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

    • hasHeaderSatisfying

      public ResponseAssert hasHeaderSatisfying(String name, Consumer<List<String>> consumer)
    • doesNotHaveHeader

      public ResponseAssert doesNotHaveHeader(String name)
      Asserts that the response does not have the given header.
    • doesNotHaveHeaderWithValue

      public ResponseAssert doesNotHaveHeaderWithValue(String name, String value)
      Asserts that the response does not have the given header with a particular value.

      If the header is multivalued, asserts that no value is satisfied.

    • hasLength

      public ResponseAssert hasLength()
      Asserts that the response has a 'Content-Length' header.
    • hasLength

      public ResponseAssert hasLength(int length)
      Asserts that the response has a 'Content-Length' header with the given length.
    • hasEncoding

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

      public ResponseAssert doesNotHaveEncoding(String encoding)
    • hasLanguage

      public ResponseAssert hasLanguage(Locale locale)
    • 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()