Class AbstractHttpServletRequestAssert<SELF extends AbstractHttpServletRequestAssert<SELF,ACTUAL>,ACTUAL extends HttpServletRequest>

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractObjectAssert<SELF,ACTUAL>
org.springframework.test.web.servlet.assertj.AbstractHttpServletRequestAssert<SELF,ACTUAL>
Type Parameters:
SELF - the type of assertions
ACTUAL - the type of the object to assert
All Implemented Interfaces:
org.assertj.core.api.Assert<SELF,ACTUAL>, org.assertj.core.api.Descriptable<SELF>, org.assertj.core.api.ExtensionPoints<SELF,ACTUAL>
Direct Known Subclasses:
AbstractMockHttpServletRequestAssert

public abstract class AbstractHttpServletRequestAssert<SELF extends AbstractHttpServletRequestAssert<SELF,ACTUAL>,ACTUAL extends HttpServletRequest> extends org.assertj.core.api.AbstractObjectAssert<SELF,ACTUAL>
Base AssertJ assertions that can be applied to an HttpServletRequest.
Since:
6.2
Author:
Stephane Nicoll
  • Field Summary

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

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

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.assertj.core.api.MapAssert<String,Object>
    Return a new assertion object that uses the request attributes as the object to test, with values mapped by attribute name.
    hasAsyncStarted(boolean started)
    Verify whether asynchronous processing has started, usually as a result of a controller method returning a Callable or DeferredResult.
    org.assertj.core.api.MapAssert<String,Object>
    Return a new assertion object that uses the session attributes as the object to test, with values mapped by attribute name.

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

    as, as, doesNotReturn, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, hasOnlyFields, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, newObjectAssert, returns, usingComparatorForFields, usingComparatorForType, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison

    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, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    Methods inherited from class java.lang.Object

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

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

    as, describedAs, describedAs
  • Constructor Details

    • AbstractHttpServletRequestAssert

      protected AbstractHttpServletRequestAssert(ACTUAL actual, Class<?> selfType)
  • Method Details

    • attributes

      public org.assertj.core.api.MapAssert<String,Object> attributes()
      Return a new assertion object that uses the request attributes as the object to test, with values mapped by attribute name.

      Example:

      
       // Check for the presence of a request attribute named "attributeName":
       assertThat(request).attributes().containsKey("attributeName");
       
    • sessionAttributes

      public org.assertj.core.api.MapAssert<String,Object> sessionAttributes()
      Return a new assertion object that uses the session attributes as the object to test, with values mapped by attribute name.

      Example:

      
       // Check for the presence of a session attribute named "username":
       assertThat(request).sessionAttributes().containsKey("username");
       
    • hasAsyncStarted

      public SELF hasAsyncStarted(boolean started)
      Verify whether asynchronous processing has started, usually as a result of a controller method returning a Callable or DeferredResult.

      The test will await the completion of a Callable so that the asynchronous result is available and can be further asserted.

      Neither a Callable nor a DeferredResult will complete processing all the way since a MockHttpServletRequest does not perform asynchronous dispatches.

      Parameters:
      started - whether asynchronous processing should have started