Skip to content

Commit

Permalink
Prepare moving assertj-core to the assertj organisation
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-costigliola committed Sep 22, 2020
1 parent a619a16 commit 710e5f7
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 40 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ We appreciate your effort and to make sure that your pull request is easy to rev
* Put GIVEN WHEN THEN steps in each test, favoring `BDDAssertions.then` instead of `Assertions.assertThat` for assertions in the THEN step. Steps can be combined or omitted if a separate step does not provide much benefit to test readability, just ensure that the WHEN step (either single or combined) contains the test target.
* Use `AssertionUtil.expectAssertionError` for tests expecting to get an `AssertionError` - see `OptionalAssert_containsInstanceOf_Test` as an example..
* Use static import when it makes the code more readable.
* If possible, add a (fun) code example in [assertj-examples](https://github.com/joel-costigliola/assertj-examples) and use it in the javadoc.
* If possible, add a (fun) code example in [assertj-examples](https://github.com/assertj/assertj-examples) and use it in the javadoc.

A good unit test to use as a reference is `OptionalAssert_containsInstanceOf_Test`. Here's a sample below:

Expand Down Expand Up @@ -53,7 +53,7 @@ class OptionalAssert_containsInstanceOf_Test extends BaseTest {

It's ok not to follow some of the rules described above if you have a good reason not to (use your best judgement)

[assertj-examples](https://github.com/joel-costigliola/assertj-examples) shows how to efficiently use AssertJ through fun unit test examples, it can be seen as AssertJs living documentation.
[assertj-examples](https://github.com/assertj/assertj-examples) shows how to efficiently use AssertJ through fun unit test examples, it can be seen as AssertJs living documentation.

## Rebase your PR on main (no merge!)

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AssertJ - Fluent assertions for java

[![Github CI status](https://github.com/joel-costigliola/assertj-core/workflows/CI/badge.svg)](https://github.com/joel-costigliola/assertj-core/actions?query=workflow%3ACI)
[![Github Cross-Version status](https://github.com/joel-costigliola/assertj-core/workflows/Cross-Version/badge.svg)](https://github.com/joel-costigliola/assertj-core/actions?query=workflow%3ACross-Version)
[![Github CI status](https://github.com/assertj/assertj-core/workflows/CI/badge.svg)](https://github.assertj-costigliola/assertj-core/actions?query=workflow%3ACI)
[![Github Cross-Version status](https://github.com/assertj/assertj-core/workflows/Cross-Version/badge.svg)](https://github.com/assertj/assertj-core/actions?query=workflow%3ACross-Version)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.assertj/assertj-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.assertj/assertj-core)
[![Javadocs](http://www.javadoc.io/badge/org.assertj/assertj-core.svg)](http://www.javadoc.io/doc/org.assertj/assertj-core)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=joel-costigliola_assertj-core&metric=alert_status)](https://sonarcloud.io/dashboard?id=joel-costigliola_assertj-core)
Expand All @@ -28,13 +28,13 @@ a `Map`? Use Map-specific assertions to easily check the contents of the map.

AssertJ is composed of several modules:
* A core module (this one) to provide assertions for JDK types (`String`, `Iterable`, `Stream`, `Path`, `File`, `Map`...) - see [AssertJ Core documentation](https://assertj.github.io/doc/#assertj-core-assertions-guide) and [javadoc](https://www.javadoc.io/doc/org.assertj/assertj-core/latest/index.html).
* A **[Guava module](https://github.com/joel-costigliola/assertj-guava#readme)** to provide assertions for Guava types (`Multimap`, `Optional`...) - see [AssertJ Guava documentation](http://joel-costigliola.github.io/assertj/assertj-guava.html) and [javadoc](http://joel-costigliola.github.io/assertj/guava/api/index.html).
* A **[Joda Time module](https://github.com/joel-costigliola/assertj-joda-time#readme)** to provide assertions for Joda Time types (`DateTime`, `LocalDateTime`) - see [AssertJ Joda Time documentation](http://joel-costigliola.github.io/assertj/assertj-joda-time.html) and [javadoc](http://joel-costigliola.github.io/assertj/jodatime/api/index.html).
* A **[Neo4J module](https://github.com/joel-costigliola/assertj-neo4j#readme)** to provide assertions for Neo4J types (`Path`, `Node`, `Relationship`...) - see [AssertJ Neo4J documentation](http://joel-costigliola.github.io/assertj/assertj-neo4j.html) and [javadoc](http://joel-costigliola.github.io/assertj/neo4j/api/index.html).
* A **[DB module](https://github.com/joel-costigliola/assertj-db#readme)** to provide assertions for relational database types (`Table`, `Row`, `Column`...) - see [AssertJ DB documentation](http://joel-costigliola.github.io/assertj/assertj-db.html) and [javadoc](http://joel-costigliola.github.io/assertj/db/current/api/index.html).
* A **[Swing module](https://github.com/joel-costigliola/assertj-swing#readme)** provides a simple and intuitive API for functional testing of Swing user interfaces - see [AssertJ Swing documentation](http://joel-costigliola.github.io/assertj/assertj-swing.html) and [javadoc](http://joel-costigliola.github.io/assertj/swing/api/index.html).
* A **[Guava module](https://github.com/assertj/assertj-guava#readme)** to provide assertions for Guava types (`Multimap`, `Optional`...) - see [AssertJ Guava documentation](https://assertj.github.io/doc/#assertj-guava) and [javadoc](https://www.javadoc.io/doc/org.assertj/assertj-guava/latest/index.html).
* A **[Joda Time module](https://github.com/assertj/assertj-joda-time#readme)** to provide assertions for Joda Time types (`DateTime`, `LocalDateTime`) - see [AssertJ Joda Time documentation](http://joel-costigliola.github.io/assertj/assertj-joda-time.html) and [javadoc](https://www.javadoc.io/doc/org.assertj/assertj-joda-time/latest/index.html).
* A **[Neo4J module](https://github.com/assertj/assertj-neo4j#readme)** to provide assertions for Neo4J types (`Path`, `Node`, `Relationship`...) - see [AssertJ Neo4J documentation](http://joel-costigliola.github.io/assertj/assertj-neo4j.html) and [javadoc](https://www.javadoc.io/doc/org.assertj/assertj-neo4j/latest/index.html).
* A **[DB module](https://github.com/assertj/assertj-db#readme)** to provide assertions for relational database types (`Table`, `Row`, `Column`...) - see [AssertJ DB documentation](https://assertj.github.io/doc/#assertj-db) and [javadoc](https://www.javadoc.io/doc/org.assertj/assertj-db/latest/index.html).
* A **[Swing module](https://github.com/assertj/assertj-swing#readme)** provides a simple and intuitive API for functional testing of Swing user interfaces - see [AssertJ Swing documentation](http://joel-costigliola.github.io/assertj/assertj-swing.html) and [javadoc](https://www.javadoc.io/doc/org.assertj/assertj-swing/latest/index.html).

Assertion missing? Please [create an issue](https://github.com/joel-costigliola/assertj-core/issues)!
Assertion missing? Please [create an issue](https://github.com/assertj/assertj-core/issues)!

AssertJ's assertions are super easy to use: just type **```assertThat```** followed by the actual value in parentheses and a dot,
then any Java IDE will show you all assertions available for the type of the object. No more confusion about the
Expand Down Expand Up @@ -64,8 +64,8 @@ Moreover, to ease your work, we provide assertions generator that can take a set

## <a name="junit-to-assertj-assertions"/>Replacing JUnit assertions with AssertJ Assertions

To help you [**replace JUnit assertions**](http://joel-costigliola.github.io/assertj/assertj-core-converting-junit-assertions-to-assertj.html) with AssertJ ones, you can use a [**script**](http://joel-costigliola.github.io/assertj/assertj-core-converting-junit-assertions-to-assertj.html#automatic-conversion) or do regexp search and replace manually as described [**here**](http://joel-costigliola.github.io/assertj/assertj-core-converting-junit-assertions-to-assertj.html#manual-conversion).
To help you [**replace JUnit assertions**](https://assertj.github.io/doc/#assertj-migration) with AssertJ ones, you can use a [**script**](https://assertj.github.io/doc/#assertj-migration-using-scripts) or do regexp search and replace manually as described [**here**](https://assertj.github.io/doc/#assertj-migration-using-regexes).

## <a name="contributing"/>Want to contribute?

You are encouraged to contribute any missing, useful assertions. To do so, please read the [contributing section](https://github.com/joel-costigliola/assertj-core/blob/main/CONTRIBUTING.md).
You are encouraged to contribute any missing, useful assertions. To do so, please read the [contributing section](https://github.com/assertj/assertj-core/blob/main/CONTRIBUTING.md).
18 changes: 5 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,15 @@
<version>2.2.8</version>
<relativePath />
</parent>
<mailingLists>
<mailingList>
<name>AssertJ Group</name>
<post>http://groups.google.com/group/assertj</post>
<subscribe>http://groups.google.com/group/assertj</subscribe>
<unsubscribe>http://groups.google.com/group/assertj</unsubscribe>
</mailingList>
</mailingLists>
<scm>
<developerConnection>scm:git:[email protected]:joel-costigliola/assertj-core.git</developerConnection>
<connection>scm:git:[email protected]:joel-costigliola/assertj-core.git</connection>
<url>[email protected]:joel-costigliola/assertj-core</url>
<developerConnection>scm:git:[email protected]:assertj/assertj-core.git</developerConnection>
<connection>scm:git:[email protected]:assertj/assertj-core.git</connection>
<url>[email protected]:assertj/assertj-core</url>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>github</system>
<url>https://github.com/joel-costigliola/assertj-core/issues</url>
<url>https://github.com/assertj/assertj-core/issues</url>
</issueManagement>

<properties>
Expand Down Expand Up @@ -510,7 +502,7 @@
<configuration>
<!-- Explicitly set Javadoc locale to English -->
<locale>en_US</locale>
<!-- needed to fix javadoc on java 11+ https://github.com/joel-costigliola/assertj-core/issues/1403 -->
<!-- needed to fix javadoc on java 11+ https://github.com/assertj/assertj-core/issues/1403 -->
<source>8</source>
<!-- (1) CSS file location -->
<stylesheetfile>${project.build.directory}/javadoc-stylesheet/assertj-javadoc-min.css</stylesheetfile>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/assertj/core/api/AbstractAssert.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
*/
public abstract class AbstractAssert<SELF extends AbstractAssert<SELF, ACTUAL>, ACTUAL> implements Assert<SELF, ACTUAL> {

// https://github.com/joel-costigliola/assertj-core/issues/1128
// https://github.com/assertj/assertj-core/issues/1128
public static boolean throwUnsupportedExceptionOnEquals = true;

private static final String ORG_ASSERTJ = "org.assert";
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/assertj/core/api/filter/FilterOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@

public abstract class FilterOperator<T> {

private static final String COMBINING_OPERATOR_IS_NOT_SUPPORTED = "Combining operator is not supported, but you can use Filters as in http://joel-costigliola.github.io/assertj/assertj-core-features-highlight.html#filters";
private static final String COMBINING_OPERATOR_IS_NOT_SUPPORTED = "Combining operator is not supported, but you can use Filters, see filteredOn methods in https://www.javadoc.io/doc/org.assertj/assertj-core/latest/org/assertj/core/api/AbstractIterableAssert.html";
protected final T filterParameter;

protected FilterOperator(T filterValue) {
if (filterValue instanceof FilterOperator<?>)
throw new UnsupportedOperationException(COMBINING_OPERATOR_IS_NOT_SUPPORTED);
if (filterValue instanceof FilterOperator<?>) throw new UnsupportedOperationException(COMBINING_OPERATOR_IS_NOT_SUPPORTED);
this.filterParameter = filterValue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* {@link StandardRepresentation#fallbackToStringOf(Object)}. By doing this all the defaults of AssertJ would be applied and you can apply your own customization</li>
* </ul>
* <p>
* The <a href="https://github.com/joel-costigliola/assertj-examples/tree/main/assertions-examples">assertj-examples</a> project provides a working example of registering a custom representation.
* The <a href="https://github.com/assertj/assertj-examples/tree/main/assertions-examples">assertj-examples</a> project provides a working example of registering a custom representation.
* <p>
* Registering a representation has been introduced in AssertJ 2.9.0/3.9.0.
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/scripts/convert-junit5-assertions-to-assertj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function usage() {
echo "convert-junit5-assertions-to-assertj.sh - Converts most of JUnit 5 assertions to AssertJ assertions"
echo
echo "AUTHOR"
echo "this script is based on JUnit 4 script found at http://joel-costigliola.github.io/assertj/assertj-core-converting-junit-assertions-to-assertj.html
echo "this script is based on JUnit 4 script found at https://assertj.github.io/doc/#assertj-migration
The changes in regexps are mostly due to the fact the order arguments changed
in JUnit 5 (i.e. message moved to the last position). Kudos to whoever wrote the original script!"
echo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,12 +945,12 @@ void withAssertions_assertThat_doublePredicate_Test() {

@Test
void withAssertions_assertThat_url_Test() throws MalformedURLException {
assertThat(new URL("https://github.com/joel-costigliola/assertj-core")).hasHost("github.com");
assertThat(new URL("https://github.com/assertj/assertj-core")).hasHost("github.com");
}

@Test
void withAssertions_assertThat_uri_Test() {
assertThat(java.net.URI.create("https://github.com/joel-costigliola/assertj-core")).hasHost("github.com");
assertThat(java.net.URI.create("https://github.com/assertj/assertj-core")).hasHost("github.com");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void raw_set_assertions_mixed_with_inherited_methods() {
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
void test_bug_485() {
// https://github.com/joel-costigliola/assertj-core/issues/485
// https://github.com/assertj/assertj-core/issues/485
Set set = new java.util.HashSet<>();
set.add("Key1");
set.add("Key2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void raw_list_assertions_mixed_with_inherited_methods() {
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
void test_bug_485() {
// https://github.com/joel-costigliola/assertj-core/issues/485
// https://github.com/assertj/assertj-core/issues/485
List list = new java.util.ArrayList<>();
list.add("Key1");
list.add("Key2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void raw_map_mixing_assertions_from_AbstractAssert_and_AbstractMapAssert() {
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
void test_bug_485() {
// https://github.com/joel-costigliola/assertj-core/issues/485
// https://github.com/assertj/assertj-core/issues/485
Map map1 = new java.util.HashMap<>();
map1.put("Key1", "Value1");
map1.put("Key2", "Value2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void should_allow_assertions_on_more_than_five_extracted_values_from_given_itera
tuple("Boromir", 37, MAN, "Boromir", 37, MAN));
}

// https://github.com/joel-costigliola/assertj-core/issues/880
// https://github.com/assertj/assertj-core/issues/880
@Test
void should_be_able_to_extract_values_returned_from_default_methods_from_given_iterable_elements() {
List<Person> people = asList(new Person());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void should_fail_if_actual_contains_any_non_digit_character() {
}

/**
* See <a href="https://github.com/joel-costigliola/assertj-core/pull/342">discussion on failing the assertion for empty CharSequence</a>
* See <a href="https://github.com/assertj/assertj-core/pull/342">discussion on failing the assertion for empty CharSequence</a>
*/
@Test
void should_fail_if_actual_is_empty() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.junit.jupiter.api.Timeout;

/**
* See https://github.com/joel-costigliola/assertj-core/issues/1718.
* See https://github.com/assertj/assertj-core/issues/1718.
*
* This test ensures assertThat(list_of_1m_elements).containsOnly(...) is an O(N) rather than O(N^2)
* operation. Given that the list has 1 million elements, O(N^2) is O(1000 billion), which should
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void should_only_consider_root_object_for_cycles() {
then(formatted).isEqualTo("[[1, 2, 3], [1, 2, 3]]");
}

// see https://github.com/joel-costigliola/assertj-core/issues/1990
// see https://github.com/assertj/assertj-core/issues/1990
@Test
public void should_use_overridden_toString_over_iterable_representation() {
// GIVEN
Expand Down

0 comments on commit 710e5f7

Please sign in to comment.