This is an automated email from the ASF dual-hosted git repository.

alien11689 pushed a commit to branch remove-usage-of-deprecated-junit-3-api
in repository https://gitbox.apache.org/repos/asf/aries.git

commit 875792a24f6b3f5f0ca7f177d5adcd6e9acdb7a5
Author: Dominik Przybysz <[email protected]>
AuthorDate: Fri May 9 22:33:26 2025 +0200

    [MAINTENANCE] Remove Assert.assertThat usage
---
 .../itests/cm/CmPropertyPlaceholderTest.java          |  4 ++--
 .../aries/transaction/internal/LogConversionTest.java | 19 +++++++++----------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git 
a/blueprint/itests/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/cm/CmPropertyPlaceholderTest.java
 
b/blueprint/itests/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/cm/CmPropertyPlaceholderTest.java
index 63faa1a6c..01cfee3ff 100644
--- 
a/blueprint/itests/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/cm/CmPropertyPlaceholderTest.java
+++ 
b/blueprint/itests/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/cm/CmPropertyPlaceholderTest.java
@@ -86,8 +86,8 @@ public class CmPropertyPlaceholderTest extends 
AbstractBlueprintIntegrationTest
         assertNotNull(sr);
         FooInterface foo = (FooInterface)context().getService(sr);
         assertNotNull(foo);
-        assertThat(foo.getB(), equalTo("42"));
-        assertThat(foo.getC(), nullValue());
+        assertEquals("42", foo.getB());
+        assertNull(foo.getC());
 
         Configuration cf = 
ca.getConfiguration("blueprint-sample-properties.pid", null);
         Hashtable<String,Object> props = new Hashtable<String,Object>();
diff --git 
a/transaction/transaction-manager/src/test/java/org/apache/aries/transaction/internal/LogConversionTest.java
 
b/transaction/transaction-manager/src/test/java/org/apache/aries/transaction/internal/LogConversionTest.java
index 265c5df19..08e1d0071 100644
--- 
a/transaction/transaction-manager/src/test/java/org/apache/aries/transaction/internal/LogConversionTest.java
+++ 
b/transaction/transaction-manager/src/test/java/org/apache/aries/transaction/internal/LogConversionTest.java
@@ -33,10 +33,9 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.not;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertTrue;
 
 public class LogConversionTest {
@@ -86,7 +85,7 @@ public class LogConversionTest {
         long lm = earlierLastModified(new File(logDir, "transaction_1.log"));
 
         assertFalse(TransactionLogUtils.copyActiveTransactions(null, 
properties));
-        assertThat("Transaction log should not be touched", new File(logDir, 
"transaction_1.log").lastModified(), equalTo(lm));
+        assertEquals("Transaction log should not be touched", new File(logDir, 
"transaction_1.log").lastModified(), lm);
     }
 
     @Test
@@ -109,7 +108,7 @@ public class LogConversionTest {
         newConfig.put("aries.transaction.howl.logFileDir", 
newLogDir.getAbsolutePath());
 
         assertFalse(TransactionLogUtils.copyActiveTransactions(properties, 
newConfig));
-        assertThat("Transaction log should not be touched", new 
File(newLogDir, "transaction_1.log").lastModified(), equalTo(lm));
+        assertEquals("Transaction log should not be touched", new 
File(newLogDir, "transaction_1.log").lastModified(), lm);
         assertFalse("Old transaction log should be moved", logDir.exists());
         assertTrue("New transaction log should be created", 
newLogDir.exists());
     }
@@ -157,7 +156,7 @@ public class LogConversionTest {
         assertTrue(TransactionLogUtils.copyActiveTransactions(properties, 
newConfig));
         assertTrue("Transaction log should exist", new File(logDir, 
"transaction_1.log").exists());
         assertTrue("There should be 20 transaction log files", new 
File(logDir, "transaction_20.log").exists());
-        assertThat("Transaction log should be processed", new File(logDir, 
"transaction_1.log").lastModified(), not(equalTo(lm)));
+        assertNotEquals("Transaction log should be processed", new 
File(logDir, "transaction_1.log").lastModified(), lm);
     }
 
     private long earlierLastModified(File file) {
@@ -185,7 +184,7 @@ public class LogConversionTest {
         assertTrue(TransactionLogUtils.copyActiveTransactions(properties, 
newConfig));
         assertTrue("Transaction log should exist", new File(logDir, 
"transaction_1.log").exists());
         assertFalse("There should be 3 transaction log files", new 
File(logDir, "transaction_4.log").exists());
-        assertThat("Transaction log should be processed", new File(logDir, 
"transaction_1.log").lastModified(), not(equalTo(lm)));
+        assertEquals("Transaction log should be processed", new File(logDir, 
"transaction_1.log").lastModified(), lm);
     }
 
     @Test
@@ -207,7 +206,7 @@ public class LogConversionTest {
 
         assertTrue(TransactionLogUtils.copyActiveTransactions(properties, 
newConfig));
         assertTrue("Transaction log should exist", new File(logDir, 
"transaction_1.log").exists());
-        assertThat("Transaction log should be processed", new File(logDir, 
"transaction_1.log").lastModified(), not(equalTo(lm)));
+        assertNotEquals("Transaction log should be processed", new 
File(logDir, "transaction_1.log").lastModified(), lm);
     }
 
     @Test
@@ -235,7 +234,7 @@ public class LogConversionTest {
         assertTrue(TransactionLogUtils.copyActiveTransactions(properties, 
newConfig));
         assertTrue("Old transaction log should exist", new File(logDir, 
"transaction_1.log").exists());
         assertTrue("New transaction log should exist", new File(newLogDir, 
"transaction_1.log").exists());
-        assertThat("Old transaction log should be touched (HOWL Log opened)", 
new File(logDir, "transaction_1.log").lastModified(), not(equalTo(lm)));
+        assertNotEquals("Old transaction log should be touched (HOWL Log 
opened)", new File(logDir, "transaction_1.log").lastModified(), lm);
     }
 
     @Test
@@ -303,7 +302,7 @@ public class LogConversionTest {
         newConfig.put("aries.transaction.howl.bufferSize", "4");
 
         assertTrue(TransactionLogUtils.copyActiveTransactions(properties, 
newConfig));
-        assertThat("Old transaction log should be touched (HOWL Log opened)", 
new File(logDir, "transaction_1.log").lastModified(), not(equalTo(lm)));
+        assertNotEquals("Old transaction log should be touched (HOWL Log 
opened)", new File(logDir, "transaction_1.log").lastModified(), lm);
         assertTrue("New transaction log should exist", new File(logDir, 
"megatransaction_1.log").exists());
     }
 

Reply via email to