java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractCharSequenceAssert<SELF,String>
org.assertj.core.api.AbstractStringAssert<SELF>
io.spring.initializr.generator.test.io.AbstractTextAssert<MavenBuildAssert>
io.spring.initializr.generator.test.buildsystem.maven.MavenBuildAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<MavenBuildAssert,String>, org.assertj.core.api.Descriptable<MavenBuildAssert>, org.assertj.core.api.EnumerableAssert<MavenBuildAssert,Character>, org.assertj.core.api.ExtensionPoints<MavenBuildAssert,String>

public class MavenBuildAssert extends AbstractTextAssert<MavenBuildAssert>
Assertions for a Maven build.
Author:
Stephane Nicoll
  • Field Summary

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

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

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    doesNotHaveBom(String groupId, String artifactId)
    Assert that pom.xml does not define the specified bom.
    doesNotHaveDependency(String groupId, String artifactId)
    Assert that pom.xml does not define a dependency with the specified groupId and artifactId.
    Assert pom.xml does not define a node with the specified path.
    Assert pom.xml does not define a profile with the specified id.
    Assert pom.xml does not define the specified property.
    hasArtifactId(String artifactId)
    Assert pom.xml uses the specified artifactId.
    hasBom(String groupId, String artifactId, String version)
    Assert pom.xml defines the specified bom.
    hasBomsSize(int size)
    Assert pom.xml defines the specified number of boms.
    Assert pom.xml defines the specified number of dependencies.
    Assert pom.xml defines the specified dependency.
    hasDependency(String groupId, String artifactId)
    Assert pom.xml defines the specified dependency with no version and compile scope.
    hasDependency(String groupId, String artifactId, String version)
    Assert pom.xml defines the specified dependency with compile scope.
    hasDependency(String groupId, String artifactId, String version, String scope)
    Assert pom.xml defines the specified dependency with the specified scope.
    hasDescription(String description)
    Assert pom.xml uses the specified description.
    hasGroupId(String groupId)
    Assert pom.xml uses the specified groupId.
    Assert pom.xml uses the specified name.
    hasPackaging(String packaging)
    Assert pom.xml uses the specified packaging.
    hasParent(String groupId, String artifactId, String version)
    Assert pom.xml defines the specified parent.
    Assert pom.xml defines a profile with the specified id.
    hasProperty(String name, String value)
    Assert pom.xml defines the specified property.
    Assert pom.xml defines the specified number of repositories.
    hasRepository(String id, String name, String url, Boolean snapshotsEnabled)
    Assert pom.xml defines the specified repository.
    hasText(String path, String value)
    Assert pom.xml contains the specified value at the specified path.
    hasVersion(String version)
    Assert pom.xml uses the specified version.

    Methods inherited from class io.spring.initializr.generator.test.io.AbstractTextAssert

    contains, containsExactly, hasSameContentAs, lines

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

    asBase64Decoded, 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, doesNotMatch, doesNotMatch, doesNotStartWith, doesNotStartWithIgnoringCase, 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, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, 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
  • Constructor Details

    • MavenBuildAssert

      public MavenBuildAssert(String content)
    • MavenBuildAssert

      public MavenBuildAssert(Path pomFile)
  • Method Details

    • hasParent

      public MavenBuildAssert hasParent(String groupId, String artifactId, String version)
      Assert pom.xml defines the specified parent.
      Parameters:
      groupId - the groupId of the parent
      artifactId - the artifactId of the parent
      version - the version of the parent
      Returns:
      this assertion object
    • hasGroupId

      public MavenBuildAssert hasGroupId(String groupId)
      Assert pom.xml uses the specified groupId.
      Parameters:
      groupId - the groupId of the project
      Returns:
      this assertion object
    • hasArtifactId

      public MavenBuildAssert hasArtifactId(String artifactId)
      Assert pom.xml uses the specified artifactId.
      Parameters:
      artifactId - the artifactId of the project
      Returns:
      this assertion object
    • hasVersion

      public MavenBuildAssert hasVersion(String version)
      Assert pom.xml uses the specified version.
      Parameters:
      version - the version of the project
      Returns:
      this assertion object
    • hasPackaging

      public MavenBuildAssert hasPackaging(String packaging)
      Assert pom.xml uses the specified packaging.
      Parameters:
      packaging - the packaging of the project
      Returns:
      this assertion object
    • hasName

      public MavenBuildAssert hasName(String name)
      Assert pom.xml uses the specified name.
      Parameters:
      name - the name of the project
      Returns:
      this assertion object
    • hasDescription

      public MavenBuildAssert hasDescription(String description)
      Assert pom.xml uses the specified description.
      Parameters:
      description - the description of the project
      Returns:
      this assertion object
    • hasProperty

      public MavenBuildAssert hasProperty(String name, String value)
      Assert pom.xml defines the specified property.
      Parameters:
      name - the name of the property
      value - the value of the property
      Returns:
      this assertion object
    • doesNotHaveProperty

      public MavenBuildAssert doesNotHaveProperty(String name)
      Assert pom.xml does not define the specified property.
      Parameters:
      name - the name of the property
      Returns:
      this assertion object
    • hasDependenciesSize

      public MavenBuildAssert hasDependenciesSize(int size)
      Assert pom.xml defines the specified number of dependencies.
      Parameters:
      size - the number of dependencies
      Returns:
      this assertion object
    • hasDependency

      public MavenBuildAssert hasDependency(String groupId, String artifactId)
      Assert pom.xml defines the specified dependency with no version and compile scope.
      Parameters:
      groupId - the groupId of the dependency
      artifactId - the artifactId of the dependency
      Returns:
      this assertion object
    • hasDependency

      public MavenBuildAssert hasDependency(String groupId, String artifactId, String version)
      Assert pom.xml defines the specified dependency with compile scope.
      Parameters:
      groupId - the groupId of the dependency
      artifactId - the artifactId of the dependency
      version - the version of the dependency
      Returns:
      this assertion object
    • hasDependency

      public MavenBuildAssert hasDependency(String groupId, String artifactId, String version, String scope)
      Assert pom.xml defines the specified dependency with the specified scope.
      Parameters:
      groupId - the groupId of the dependency
      artifactId - the artifactId of the dependency
      version - the version of the dependency
      scope - the scope of the dependency
      Returns:
      this assertion object
    • hasDependency

      public MavenBuildAssert hasDependency(Dependency dependency)
      Assert pom.xml defines the specified dependency.
      Parameters:
      dependency - the dependency
      Returns:
      this assertion object
    • doesNotHaveDependency

      public MavenBuildAssert doesNotHaveDependency(String groupId, String artifactId)
      Assert that pom.xml does not define a dependency with the specified groupId and artifactId.
      Parameters:
      groupId - the dependency's groupId
      artifactId - the dependency's artifactId
      Returns:
      this assertion object
    • hasBomsSize

      public MavenBuildAssert hasBomsSize(int size)
      Assert pom.xml defines the specified number of boms.
      Parameters:
      size - the number of boms
      Returns:
      this assertion object
    • hasBom

      public MavenBuildAssert hasBom(String groupId, String artifactId, String version)
      Assert pom.xml defines the specified bom.
      Parameters:
      groupId - the groupId of the bom
      artifactId - the artifactId of the bom
      version - the version of the bom
      Returns:
      this assertion object
    • doesNotHaveBom

      public MavenBuildAssert doesNotHaveBom(String groupId, String artifactId)
      Assert that pom.xml does not define the specified bom.
      Parameters:
      groupId - the groupId of the bom
      artifactId - the artifactId of the bom
      Returns:
      this assertion object
    • hasRepositoriesSize

      public MavenBuildAssert hasRepositoriesSize(int size)
      Assert pom.xml defines the specified number of repositories.
      Parameters:
      size - the number of repositories
      Returns:
      this assertion object
    • hasRepository

      public MavenBuildAssert hasRepository(String id, String name, String url, Boolean snapshotsEnabled)
      Assert pom.xml defines the specified repository.
      Parameters:
      id - the id of the repository
      name - the name of the repository
      url - the url of the repository
      snapshotsEnabled - whether snapshot is enabled for the repository
      Returns:
      this assertion object
    • hasProfile

      public MavenBuildAssert hasProfile(String id)
      Assert pom.xml defines a profile with the specified id.
      Parameters:
      id - the id of the profile
      Returns:
      this assertion object
    • doesNotHaveProfile

      public MavenBuildAssert doesNotHaveProfile(String id)
      Assert pom.xml does not define a profile with the specified id.
      Parameters:
      id - the id of the profile
      Returns:
      this assertion object
    • doesNotHaveNode

      public MavenBuildAssert doesNotHaveNode(String path)
      Assert pom.xml does not define a node with the specified path.
      Parameters:
      path - the path of the node
      Returns:
      this
    • hasText

      public MavenBuildAssert hasText(String path, String value)
      Assert pom.xml contains the specified value at the specified path.
      Parameters:
      path - the path to the element
      value - the expected value of the element
      Returns:
      this