Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
aff4cd3
Initial scaffold of AbstractMultimapAssert
mattbertolini Feb 8, 2025
b068f42
Add the containsKeys assertion
mattbertolini Feb 8, 2025
543a93b
Add the contains assertion
mattbertolini Feb 8, 2025
5e9264c
Docs
mattbertolini Feb 8, 2025
c66a53f
Add isNullOrEmpty contract
mattbertolini Feb 8, 2025
0c0a166
Add isNotEmpty contract
mattbertolini Feb 8, 2025
7ee9782
Fix abstract class
mattbertolini Feb 8, 2025
93112c5
Add isEmpty assertion
mattbertolini Feb 8, 2025
50795f1
Fix imports
mattbertolini Feb 8, 2025
8d487b3
Add hasValueSatisfying assertion
mattbertolini Feb 8, 2025
2d27a39
Add hasSizeLessThanOrEqualTo assertion
mattbertolini Feb 8, 2025
f785eae
Add hasKeySatisfying assertion
mattbertolini Feb 8, 2025
ffb7aff
Add hasDistinctSize assertion
mattbertolini Feb 8, 2025
87f7871
Add hasSize assertion
mattbertolini Feb 8, 2025
7046be6
Add hasSizeLessThan assertion
mattbertolini Feb 9, 2025
9443a77
Add containsOnly assertion
mattbertolini Feb 9, 2025
908f2e3
Add hasSizeGreaterThan assertion
mattbertolini Feb 9, 2025
686b43c
Tweak condition
mattbertolini Feb 9, 2025
8f9404a
Add README
mattbertolini Feb 9, 2025
8429c53
Add hasSizeGreaterThanOrEqualTo assertion
mattbertolini Feb 9, 2025
292c93f
Add containsValues assertion
mattbertolini Feb 9, 2025
aab8f70
Add license headers
mattbertolini Feb 9, 2025
4d74387
Remove package-info for now. I'll figure out if needed later.
mattbertolini Feb 9, 2025
7392027
Use list factory method instead of array adapter
mattbertolini Feb 9, 2025
d41236d
Add hasDistinctSizeGreaterThan assertion
mattbertolini Feb 9, 2025
bed1e36
Add license headers
mattbertolini Feb 9, 2025
2aa7c34
Adding BDDAssertion support, javadoc
mattbertolini Feb 10, 2025
76d46e5
Javadoc and polish
mattbertolini Feb 10, 2025
090d64a
Add hasSizeBetween assertion
mattbertolini Feb 10, 2025
24469f5
Add license
mattbertolini Feb 10, 2025
588bab3
Add hasDistinctSizeGreaterThanOrEqualTo assertion
mattbertolini Feb 10, 2025
5f2f291
Clean up unchecked warnings
mattbertolini Feb 10, 2025
6d40019
Update scope
mattbertolini Feb 10, 2025
acfd7d7
Fixing javadoc warnings and adding docs
mattbertolini Feb 14, 2025
e090ddd
Fix more javadoc warnings
mattbertolini Feb 14, 2025
0511918
Polishing
scordio Mar 29, 2025
77a24df
Simplify test setup by simplifying the Multimap assert.
mattbertolini Apr 11, 2025
201ede3
Tiny cleanup
mattbertolini May 14, 2025
1600c23
Set to use Java 11 for bytecode
mattbertolini Jun 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# AssertJ Eclipse Collections [![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)

[![CI](https://github.com/assertj/assertj/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/assertj/assertj/actions/workflows/main.yml?query=branch%3Amain)
19 changes: 17 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
</license>
</licenses>

<developers>
<developer>
<id>mattbertolini</id>
<name>Matt Bertolini</name>
<url>https://github.com/mattbertolini</url>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/assertj/assertj-eclipse-collections.git</connection>
<developerConnection>scm:git:https://github.com/assertj/assertj-eclipse-collections.git</developerConnection>
Expand All @@ -31,9 +39,10 @@

<properties>
<assertj.version>3.27.3</assertj.version>
<java.version>11</java.version>
<eclipse-collections.version>13.0.0</eclipse-collections.version>
<!-- Dependency versions overriding -->
<junit-jupiter.version>5.11.4</junit-jupiter.version>
<junit-jupiter.version>5.12.1</junit-jupiter.version>
</properties>

<dependencies>
Expand All @@ -46,10 +55,16 @@
<!-- Provided -->
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId>
<artifactId>eclipse-collections</artifactId>
<version>${eclipse-collections.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.opentest4j</groupId>
<artifactId>opentest4j</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
33 changes: 0 additions & 33 deletions src/main/java/org/assertj/eclipse/collections/Main.java

This file was deleted.

43 changes: 43 additions & 0 deletions src/main/java/org/assertj/eclipse/collections/api/Assertions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* Copyright 2025-2025 the original author or authors.
*/
package org.assertj.eclipse.collections.api;

import org.assertj.core.util.CheckReturnValue;
import org.assertj.eclipse.collections.api.multimap.MultimapAssert;
import org.eclipse.collections.api.multimap.Multimap;

/**
* Entry point for assertion methods for the Eclipse Collections library. Each method in this class is a static factory
* for a type-specific assertion object.
*/
@CheckReturnValue
public class Assertions {
/**
* Creates a new {@link Assertions}.
*/
protected Assertions() {
// Do nothing
}

/**
* Creates a new instance of {@link MultimapAssert}.
*
* @param actual the actual value.
* @return the created assertion object.
* @param <KEY> The type of keys in the BagMultimap
* @param <VALUE> The type of values in the BagMultimap
*/
public static <KEY, VALUE> MultimapAssert<KEY, VALUE> assertThat(Multimap<KEY, VALUE> actual) {
return new MultimapAssert<>(actual);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* Copyright 2025-2025 the original author or authors.
*/
package org.assertj.eclipse.collections.api;

import org.assertj.core.util.CheckReturnValue;
import org.assertj.eclipse.collections.api.multimap.MultimapAssert;
import org.eclipse.collections.api.multimap.Multimap;

/**
* Behavior-driven development style entry point for assertion methods for the Eclipse Collections library. Each method
* in this class is a static factory for a type-specific assertion object.
*/
@CheckReturnValue
public class BDDAssertions extends Assertions {
/**
* Creates a new <code>{@link BDDAssertions}</code>.
*/
protected BDDAssertions() {
// Do nothing
}

/**
* Creates a new instance of {@link MultimapAssert}.
*
* @param actual the actual value.
* @return the created assertion object.
* @param <KEY> The type of keys in the BagMultimap
* @param <VALUE> The type of values in the BagMultimap
*/
public static <KEY, VALUE> MultimapAssert<KEY, VALUE> then(Multimap<KEY, VALUE> actual) {
return assertThat(actual);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* Copyright 2025-2025 the original author or authors.
*/
package org.assertj.eclipse.collections.api;

import org.assertj.core.api.SoftAssertionsProvider;
import org.assertj.core.util.CheckReturnValue;
import org.assertj.eclipse.collections.api.multimap.MultimapAssert;
import org.eclipse.collections.api.multimap.Multimap;

/**
* Soft assertions implementations for Eclipse Collections types.
*/
@CheckReturnValue
public interface EclipseCollectionsSoftAssertionsProvider extends SoftAssertionsProvider {
/**
* Creates a new, proxied instance of a {@link MultimapAssert}
*
* @param actual the path
* @return the created assertion object
* @param <KEY> The type of keys in the actual BagMultimap
* @param <VALUE> The type of values in the actual BagMultimap
*/
@SuppressWarnings("unchecked")
default <KEY, VALUE> MultimapAssert<KEY, VALUE> assertThat(Multimap<KEY, VALUE> actual) {
return this.proxy(MultimapAssert.class, Multimap.class, actual);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* Copyright 2025-2025 the original author or authors.
*/
package org.assertj.eclipse.collections.api;

import org.assertj.core.api.AbstractSoftAssertions;
import org.assertj.core.api.SoftAssertionsProvider;
import org.opentest4j.MultipleFailuresError;

import java.util.function.Consumer;

/**
* A soft assertions provider for Eclipse Collections assertions
*/
public class SoftAssertions extends AbstractSoftAssertions implements EclipseCollectionsSoftAssertionsProvider {
/**
* Creates a new {@link SoftAssertions}.
*/
public SoftAssertions() {
// Do nothing
}

/**
* Convenience method for calling {@link EclipseCollectionsSoftAssertionsProvider#assertSoftly} for these assertion
* types. Equivalent to {@code SoftAssertion.assertSoftly(SoftAssertions.class, softly)}.
*
* @param softly the Consumer containing the code that will make the soft assertions.
* Takes one parameter (the SoftAssertions instance used to make the assertions).
* @throws MultipleFailuresError if possible or SoftAssertionError if any proxied assertion objects threw an {@link
* AssertionError}
*/
public static void assertSoftly(Consumer<SoftAssertions> softly) {
SoftAssertionsProvider.assertSoftly(SoftAssertions.class, softly);
}
}
Loading
Loading