diff --git a/pom.xml b/pom.xml
index d2856749..855ae6c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
assertj-db
- 3.0.1
+ 3.0.2-SNAPSHOTAssertJ-DB - Assertions for databaseAssertJ-DB - Rich and fluent assertions for testing with database
diff --git a/src/main/java/org/assertj/db/type/Changes.java b/src/main/java/org/assertj/db/type/Changes.java
index c79eddf1..d279e3dc 100644
--- a/src/main/java/org/assertj/db/type/Changes.java
+++ b/src/main/java/org/assertj/db/type/Changes.java
@@ -24,6 +24,9 @@
import java.util.List;
import java.util.function.Consumer;
+import org.assertj.core.api.AssertProvider;
+import org.assertj.db.api.Assertions;
+import org.assertj.db.api.ChangesAssert;
import org.assertj.db.exception.AssertJDBException;
import org.assertj.db.util.ChangeComparator;
@@ -85,7 +88,7 @@
* @author Régis Pouiller
* @author Julien Roy
*/
-public class Changes extends AbstractDbElement {
+public class Changes extends AbstractDbElement implements AssertProvider {
/**
* The list of the tables.
@@ -679,4 +682,16 @@ public Changes build() {
return new Changes(this.connectionProvider);
}
}
+
+ /**
+ * Makes both AssertJ Core and AssertJ DB assertions able to coexist in the same class with {@link org.assertj.core.api.Assertions org.assertj.core.api.Assertions.assertThat} as the only import necessary.
+ * Also works for both BDDAssertions.then static methods from AssertJ Core and AssertJ DB.
+ *
+ * @see org.assertj.core.api.Assertions#assertThat(AssertProvider) <T> org.assertj.core.api.Assertions.assertThat(AssertProvider<T> component)
+ * @see org.assertj.core.api.BDDAssertions#then(AssertProvider) <T> org.assertj.core.api.BDDAssertions.then(AssertProvider<T> component)
+ */
+ @Override
+ public ChangesAssert assertThat() {
+ return Assertions.assertThat(this);
+ }
}
diff --git a/src/main/java/org/assertj/db/type/Request.java b/src/main/java/org/assertj/db/type/Request.java
index 5fade7a8..32e4ec60 100644
--- a/src/main/java/org/assertj/db/type/Request.java
+++ b/src/main/java/org/assertj/db/type/Request.java
@@ -21,6 +21,9 @@
import java.util.Arrays;
import java.util.List;
+import org.assertj.core.api.AssertProvider;
+import org.assertj.db.api.Assertions;
+import org.assertj.db.api.RequestAssert;
import org.assertj.db.type.lettercase.LetterCase;
/**
@@ -62,7 +65,7 @@
* @author Régis Pouiller
* @author Julien Roy
*/
-public class Request extends AbstractDbData {
+public class Request extends AbstractDbData implements AssertProvider {
/**
* SQL request to get the values.
@@ -226,4 +229,16 @@ public Request build() {
return new Request(this.connectionProvider, this.request, this.parameters, this.pksName);
}
}
+
+ /**
+ * Makes both AssertJ Core and AssertJ DB assertions able to coexist in the same class with {@link org.assertj.core.api.Assertions org.assertj.core.api.Assertions.assertThat} as the only import necessary.
+ * Also works for both BDDAssertions.then static methods from AssertJ Core and AssertJ DB.
implements AssertProvider {
/**
* The name of the table.
@@ -726,4 +729,16 @@ public enum OrderType {
DESC
}
}
+
+ /**
+ * Makes both AssertJ Core and AssertJ DB assertions able to coexist in the same class with {@link org.assertj.core.api.Assertions org.assertj.core.api.Assertions.assertThat} as the only import necessary.
+ * Also works for both BDDAssertions.then static methods from AssertJ Core and AssertJ DB.
+ *
+ * @see org.assertj.core.api.Assertions#assertThat(AssertProvider) <T> org.assertj.core.api.Assertions.assertThat(AssertProvider<T> component)
+ * @see org.assertj.core.api.BDDAssertions#then(AssertProvider) <T> org.assertj.core.api.BDDAssertions.then(AssertProvider<T> component)
+ */
+ @Override
+ public TableAssert assertThat() {
+ return Assertions.assertThat(this);
+ }
}
diff --git a/src/test/java/org/assertj/db/type/Changes_AssertThat_Test.java b/src/test/java/org/assertj/db/type/Changes_AssertThat_Test.java
new file mode 100644
index 00000000..ea79c167
--- /dev/null
+++ b/src/test/java/org/assertj/db/type/Changes_AssertThat_Test.java
@@ -0,0 +1,40 @@
+/*
+ * 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 2015-2025 the original author or authors.
+ */
+package org.assertj.db.type;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.assertj.db.api.ChangesAssert;
+import org.assertj.db.common.AbstractTest;
+import org.junit.Test;
+
+/**
+ * These tests are on the return from the {@code assertThat} method of {@code Changes}.
+ *