Class UriAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractCharSequenceAssert<SELF,String>
org.assertj.core.api.AbstractStringAssert<UriAssert>
org.springframework.test.web.UriAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<UriAssert,String>, org.assertj.core.api.Descriptable<UriAssert>, org.assertj.core.api.EnumerableAssert<UriAssert,Character>, org.assertj.core.api.ExtensionPoints<UriAssert,String>

public class UriAssert extends org.assertj.core.api.AbstractStringAssert<UriAssert>
AssertJ assertions that can be applied to a String representing a URI.
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
    Constructor
    Description
    UriAssert(String actual, String displayName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    isEqualToTemplate(String uriTemplate, Object... uriVars)
    Verify that the actual URI is equal to the URI built using the given uriTemplate and uriVars.
    Verify that the actual URI matches the given Ant-style uriPattern.

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

    asBase64Decoded, asBoolean, asByte, asDouble, asFloat, asInt, asLong, asShort, bytes, bytes, bytes, decodedAsBase64, isBase64, isBetween, isEqualTo, isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, isStrictlyBetween, usingComparator, usingComparator, usingDefaultComparator

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

    contains, contains, containsAnyOf, containsIgnoringCase, containsIgnoringNewLines, containsIgnoringWhitespaces, containsOnlyDigits, containsOnlyOnce, containsOnlyWhitespaces, containsPattern, containsPattern, containsPatternSatisfying, containsPatternSatisfying, containsSequence, containsSequence, containsSubsequence, containsSubsequence, containsWhitespaces, doesNotContain, doesNotContain, doesNotContainAnyWhitespaces, doesNotContainIgnoringCase, doesNotContainOnlyWhitespaces, doesNotContainPattern, doesNotContainPattern, doesNotEndWith, doesNotEndWithIgnoringCase, doesNotEndWithWhitespaces, doesNotMatch, doesNotMatch, doesNotStartWith, doesNotStartWithIgnoringCase, doesNotStartWithWhitespaces, endsWith, endsWithIgnoringCase, hasLineCount, hasSameSizeAs, hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, inHexadecimal, inUnicode, isAlphabetic, isAlphanumeric, isASCII, isBlank, isEmpty, isEqualToIgnoringCase, isEqualToIgnoringNewLines, isEqualToIgnoringWhitespace, isEqualToNormalizingNewlines, isEqualToNormalizingPunctuationAndWhitespace, isEqualToNormalizingUnicode, isEqualToNormalizingWhitespace, isHexadecimal, isJavaBlank, isLowerCase, isMixedCase, isNotBlank, isNotEmpty, isNotEqualToIgnoringCase, isNotEqualToIgnoringWhitespace, isNotEqualToNormalizingWhitespace, isNotJavaBlank, isNullOrEmpty, isPrintable, isSubstringOf, isUpperCase, isVisible, isXmlEqualTo, isXmlEqualToContentOf, matches, matches, matchesSatisfying, matchesSatisfying, startsWith, startsWithIgnoringCase, usingDefaultElementComparator, usingElementComparator

    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, 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, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, 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, as, as, describedAs, describedAs
  • Constructor Details

  • Method Details

    • isEqualToTemplate

      public UriAssert isEqualToTemplate(String uriTemplate, Object... uriVars)
      Verify that the actual URI is equal to the URI built using the given uriTemplate and uriVars. Example:
      
       // Verify that uri is equal to "/orders/1/items/2"
       assertThat(uri).isEqualToTemplate("/orders/{orderId}/items/{itemId}", 1, 2));
       
      Parameters:
      uriTemplate - the expected URI string, with a number of URI template variables
      uriVars - the values to replace the URI template variables
      See Also:
    • matchesAntPattern

      public UriAssert matchesAntPattern(String uriPattern)
      Verify that the actual URI matches the given Ant-style uriPattern. Example:
      
       // Verify that pattern matches "/orders/1/items/2"
       assertThat(uri).matchPattern("/orders/*"));
       
      Parameters:
      uriPattern - the pattern that is expected to match
      See Also: