MCPcopy
hub / github.com/assertj/assertj

github.com/assertj/assertj @assertj-build-3.27.7 sqlite

repository ↗ · DeepWiki ↗ · release assertj-build-3.27.7 ↗ · compare 2 versions
32,415 symbols 202,920 edges 5,153 files 6,974 documented · 22%
README

AssertJ - Fluent Assertions for Java Maven Central Javadocs

CI Binary Compatibility Quality Gate Status

Open in Gitpod

AssertJ provides a rich and intuitive set of strongly-typed assertions to use for unit testing (with JUnit, TestNG or any other test framework).

You can ask questions in stackoverflow (assertj tag) and make suggestions by simply creating an issue.

AssertJ's goals

AssertJ's ambition is to provide a rich and intuitive set of strongly-typed assertions for unit testing.

The idea is that disposal assertions should be specific to the type of the objects we are checking when writing unit tests. If you're checking the value of a String, you use String-specific assertions. Checking the value of a Map? Use Map-specific assertions to easily check the contents of the map.

AssertJ's assertions are super easy to use: just type assertThat(underTest). and use code completion to show you all assertions available.

Assertion missing? Please create an issue to discuss it and even better contribute to the project!

AssertJ is composed of several modules: * A core module to provide assertions for JDK types (String, Iterable, Stream, Path, File, Map...) - see AssertJ Core documentation and javadoc. * A Guava module to provide assertions for Guava types (Multimap, Optional...) - see AssertJ Guava documentation and javadoc. * A Joda Time module to provide assertions for Joda Time types (DateTime, LocalDateTime) - see AssertJ Joda Time documentation and javadoc. * A Neo4J module to provide assertions for Neo4J types (Path, Node, Relationship...) - see AssertJ Neo4J documentation and javadoc. * A DB module to provide assertions for relational database types (Table, Row, Column...) - see AssertJ DB documentation and javadoc. * A Swing module provides a simple and intuitive API for functional testing of Swing user interfaces - see AssertJ Swing documentation and javadoc.

Want to contribute?

You are encouraged to contribute any missing useful assertions.

Please read the contributing section and raise a PR!

Extension points exported contracts — how you extend this code

Vehicle (Interface)
@author Marcus Klimstra (CGI) [31 implementers]
assertj-core/src/test/java/org/assertj/core/testkit/Vehicle.java
Vehicle (Interface)
@author Marcus Klimstra (CGI) [31 implementers]
assertj-tests/assertj-integration-tests/assertj-core-tests/src/test/java/org/assertj/tests/core/testkit/Vehicle.java
InstanceOfAssertFactories (Interface)
InstanceOfAssertFactory instances for Guava types. @author Stefano Cordio @since 3.3.0 @see org.assertj.core.ap [1 implementers]
assertj-guava/src/main/java/org/assertj/guava/api/InstanceOfAssertFactories.java
EnumerableAssert (Interface)
Assertions applicable to groups of values that can be enumerated (e.g. arrays, collections or strings.) @param t [15 implementers]
assertj-core/src/main/java/org/assertj/core/api/EnumerableAssert.java
PersonData (Interface)
(no doc) [4 implementers]
assertj-tests/assertj-integration-tests/assertj-core-tests/src/test/java/org/assertj/tests/core/api/recursive/comparison/PersonData.java
IndexedObjectEnumerableAssert (Interface)
Assertions methods applicable to indexed groups of objects (e.g. arrays or lists.) @param the "self" type of this [27 …
assertj-core/src/main/java/org/assertj/core/api/IndexedObjectEnumerableAssert.java
NavigationMethodBaseTest (Interface)
Base tests for navigation methods which create a new assertion. @author Stefano Cordio
assertj-tests/assertj-integration-tests/assertj-core-tests/src/test/java/org/assertj/tests/core/testkit/NavigationMethodBaseTest.java
AutoCloseableSoftAssertionsProvider (Interface)
Parent interface for soft assertion implementations. @author Fr Jeremy Krieg @see AbstractSoftAssertions @see SoftAsser [6 …
assertj-core/src/main/java/org/assertj/core/api/AutoCloseableSoftAssertionsProvider.java

Core symbols most depended-on inside this repo

assertThat
called by 6410
assertj-core/src/test/java/org/assertj/core/api/abstract_/SoftAssertionsMultipleProjectsTest.java
then
called by 5026
assertj-core/src/main/java/org/assertj/core/api/BDDSoftAssertionsProvider.java
isEqualTo
called by 2781
assertj-core/src/main/java/org/assertj/core/api/Assert.java
isThrownBy
called by 2576
assertj-core/src/main/java/org/assertj/core/api/NotThrownAssert.java
withMessage
called by 2175
assertj-core/src/main/java/org/assertj/core/api/ThrowableAssertAlternative.java
create
called by 2100
assertj-core/src/main/java/org/assertj/core/error/ErrorMessageFactory.java
hasMessage
called by 1878
assertj-core/src/main/java/org/assertj/core/api/AbstractThrowableAssert.java
assertThat
called by 1791
assertj-core/src/main/java/org/assertj/core/api/WithAssertions.java

Shape

Method 26,531
Class 5,780
Interface 84
Enum 20

Languages

Java100%

Modules by API surface

assertj-core/src/test/java/org/assertj/core/api/InstanceOfAssertFactoriesTest.java468 symbols
assertj-core/src/test/java/org/assertj/core/api/assumptions/BDDAssumptionsTest.java269 symbols
assertj-core/src/test/java/org/assertj/core/api/assumptions/Assumptions_assumeThat_with_extracting_and_narrowing_value_Test.java185 symbols
assertj-core/src/main/java/org/assertj/core/api/AbstractIterableAssert.java173 symbols
assertj-core/src/main/java/org/assertj/core/api/recursive/comparison/RecursiveComparisonConfiguration.java152 symbols
assertj-core/src/test/java/org/assertj/core/testkit/jdk11/ImmutableCollections.java136 symbols
assertj-core/src/main/java/org/assertj/core/api/AbstractObjectArrayAssert.java131 symbols
assertj-core/src/test/java/org/assertj/core/api/WithAssertions_delegation_Test.java124 symbols
assertj-core/src/main/java/org/assertj/core/api/AtomicReferenceArrayAssert.java112 symbols
assertj-core/src/main/java/org/assertj/core/internal/Iterables.java95 symbols
assertj-core/src/main/java/org/assertj/core/api/AbstractMapAssert.java93 symbols
assertj-core/src/main/java/org/assertj/core/api/AbstractCharSequenceAssert.java90 symbols

Dependencies from manifests, versioned

com.google.guava:guava33.5.0-jre · 1×
com.groupcdg:pitest-git-plugin
com.h2database:h2
jakarta.ws.rs:jakarta.ws.rs-api4.0.0 · 1×
javax.servlet:javax.servlet-api4.0.1 · 1×
junit:junit
nl.jqno.equalsverifier:equalsverifier3.18 · 1×
org.apache.commons:commons-collections44.4 · 1×
org.apache.commons:commons-lang33.17.0 · 1×

For agents

$ claude mcp add assertj \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact