This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cayenne.git
commit b412904de426d100d39c43c8e8d2d98d0ba4cc76 Author: Andrus Adamchik <[email protected]> AuthorDate: Sun May 10 11:21:34 2026 -0400 JUnit 5 migration of "cayenne-commitlog" module --- cayenne-commitlog/pom.xml | 7 +--- .../cayenne/commitlog/CommitLogFilterIT.java | 42 +++++++++++----------- .../commitlog/CommitLogFilter_All_FlattenedIT.java | 10 +++--- .../commitlog/CommitLogFilter_FilteredIT.java | 22 ++++++------ .../CommitLogFilter_ListenerInducedChangesIT.java | 14 ++++---- .../commitlog/CommitLogFilter_OutsideTxIT.java | 12 +++---- .../commitlog/CommitLogFilter_PreUpdate_IT.java | 12 +++---- .../CommitLogFilter_PreUpdate_OutsideTxIT.java | 10 +++--- .../cayenne/commitlog/CommitLogFilter_TxIT.java | 12 +++---- .../commitlog/CommitLogModuleBuilderTest.java | 10 +++--- .../commitlog/CommitLogModuleProviderTest.java | 4 +-- .../commitlog/unit/AuditableRuntimeCase.java | 8 ++--- .../commitlog/unit/FlattenedRuntimeCase.java | 8 ++--- 13 files changed, 83 insertions(+), 88 deletions(-) diff --git a/cayenne-commitlog/pom.xml b/cayenne-commitlog/pom.xml index 0c98b4435..a68c93778 100644 --- a/cayenne-commitlog/pom.xml +++ b/cayenne-commitlog/pom.xml @@ -44,12 +44,7 @@ <artifactId>junit-jupiter</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.junit.vintage</groupId> - <artifactId>junit-vintage-engine</artifactId> - <scope>test</scope> - </dependency> - <dependency> +<dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <scope>test</scope> diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilterIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilterIT.java index 15f46b89b..b1e52e33e 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilterIT.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilterIT.java @@ -27,13 +27,13 @@ import org.apache.cayenne.commitlog.model.*; import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase; import org.apache.cayenne.query.SelectById; import org.apache.cayenne.runtime.CayenneRuntimeBuilder; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import java.sql.SQLException; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; @@ -49,13 +49,13 @@ public class CommitLogFilterIT extends AuditableRuntimeCase { .addModule(b -> CommitLogModule.extend(b).addListener(mockListener)); } - @Before + @BeforeEach public void before() { context = runtime.newContext(); } @Test - public void testPostCommit_Insert() { + public void postCommit_Insert() { Auditable1 a1 = context.newObject(Auditable1.class); a1.setCharProperty1("yy"); @@ -82,7 +82,7 @@ public class CommitLogFilterIT extends AuditableRuntimeCase { } @Test - public void testPostCommit_Update() throws SQLException { + public void postCommit_Update() throws SQLException { auditable1.insert(1, "xx"); @@ -114,7 +114,7 @@ public class CommitLogFilterIT extends AuditableRuntimeCase { } @Test - public void testPostCommit_Delete() throws SQLException { + public void postCommit_Delete() throws SQLException { auditable1.insert(1, "xx"); auditableChild1.insert(1, 1, "cc1"); auditableChild1.insert(2, 1, "cc2"); @@ -139,9 +139,9 @@ public class CommitLogFilterIT extends AuditableRuntimeCase { assertEquals("xx", masterChange.getAttributeChanges().get(Auditable1.CHAR_PROPERTY1.getName()).getOldValue()); assertNull(masterChange.getAttributeChanges().get(Auditable1.CHAR_PROPERTY1.getName()).getNewValue()); - assertEquals("1..N was explicitly unset as a part of delete. Expected to be recorded in changes", - 1, masterChange.getToManyRelationshipChanges().size()); - assertTrue("No N..1 relationships in the entity", masterChange.getToOneRelationshipChanges().isEmpty()); + assertEquals(1, masterChange.getToManyRelationshipChanges().size(), + "1..N was explicitly unset as a part of delete. Expected to be recorded in changes"); + assertTrue(masterChange.getToOneRelationshipChanges().isEmpty(), "No N..1 relationships in the entity"); // check from the perspective of the child object ObjectChange childChange = changeMap.getValue().getChanges().get(ObjectId.of("AuditableChild1", AuditableChild1.ID_PK_COLUMN, 2)); @@ -152,13 +152,13 @@ public class CommitLogFilterIT extends AuditableRuntimeCase { assertEquals("cc2", childChange.getAttributeChanges().get(AuditableChild1.CHAR_PROPERTY1.getName()).getOldValue()); assertNull(childChange.getAttributeChanges().get(AuditableChild1.CHAR_PROPERTY1.getName()).getNewValue()); - assertTrue("No 1..N relationships in the entity", childChange.getToManyRelationshipChanges().isEmpty()); - assertEquals("N..1 was explicitly unset as a part of delete. Expected to be recorded in changes", - 1, childChange.getToOneRelationshipChanges().size()); + assertTrue(childChange.getToManyRelationshipChanges().isEmpty(), "No 1..N relationships in the entity"); + assertEquals(1, childChange.getToOneRelationshipChanges().size(), + "N..1 was explicitly unset as a part of delete. Expected to be recorded in changes"); } @Test - public void testPostCommit_Delete_ToOneNullify() throws SQLException { + public void postCommit_Delete_ToOneNullify() throws SQLException { auditable1.insert(1, "xx"); auditableChild1.insert(1, 1, "cc1"); auditableChild1.insert(2, 1, "cc2"); @@ -181,14 +181,14 @@ public class CommitLogFilterIT extends AuditableRuntimeCase { assertEquals("cc2", change.getAttributeChanges().get(AuditableChild1.CHAR_PROPERTY1.getName()).getOldValue()); assertNull(change.getAttributeChanges().get(AuditableChild1.CHAR_PROPERTY1.getName()).getNewValue()); - assertTrue("No 1..N relationships in the entity", change.getToManyRelationshipChanges().isEmpty()); - assertEquals("N..1 state was not captured", 1, change.getToOneRelationshipChanges().size()); + assertTrue(change.getToManyRelationshipChanges().isEmpty(), "No 1..N relationships in the entity"); + assertEquals(1, change.getToOneRelationshipChanges().size(), "N..1 state was not captured"); assertEquals(ObjectId.of("Auditable1", Auditable1.ID_PK_COLUMN, 1), change.getToOneRelationshipChanges().get(AuditableChild1.PARENT.getName()).getOldValue()); } @Test - public void testPostCommit_Delete_ToOne_OneWay() throws SQLException { + public void postCommit_Delete_ToOne_OneWay() throws SQLException { auditable1.insert(1, "xx"); auditableChild1x.insert(1, 1, "cc1"); auditableChild1x.insert(2, 1, "cc2"); @@ -211,15 +211,15 @@ public class CommitLogFilterIT extends AuditableRuntimeCase { assertEquals("cc2", change.getAttributeChanges().get(AuditableChild1x.CHAR_PROPERTY1.getName()).getOldValue()); assertNull(change.getAttributeChanges().get(AuditableChild1x.CHAR_PROPERTY1.getName()).getNewValue()); - assertTrue("No 1..N relationships in the entity", change.getToManyRelationshipChanges().isEmpty()); - assertEquals("N..1 state was not captured", 1, change.getToOneRelationshipChanges().size()); + assertTrue(change.getToManyRelationshipChanges().isEmpty(), "No 1..N relationships in the entity"); + assertEquals(1, change.getToOneRelationshipChanges().size(), "N..1 state was not captured"); assertEquals(ObjectId.of("Auditable1", Auditable1.ID_PK_COLUMN, 1), change.getToOneRelationshipChanges().get(AuditableChild1x.PARENT.getName()).getOldValue()); } @Test - public void testPostCommit_UpdateToOne() throws SQLException { + public void postCommit_UpdateToOne() throws SQLException { auditable1.insert(1, "xx"); auditable1.insert(2, "yy"); @@ -290,7 +290,7 @@ public class CommitLogFilterIT extends AuditableRuntimeCase { } @Test - public void testPostCommit_UpdateToMany() throws SQLException { + public void postCommit_UpdateToMany() throws SQLException { auditable1.insert(1, "xx"); auditableChild1.insert(1, 1, "cc1"); auditableChild1.insert(2, null, "cc2"); diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_All_FlattenedIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_All_FlattenedIT.java index 7a755890a..63f4cfe94 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_All_FlattenedIT.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_All_FlattenedIT.java @@ -29,13 +29,13 @@ import org.apache.cayenne.commitlog.model.ToManyRelationshipChange; import org.apache.cayenne.commitlog.unit.FlattenedRuntimeCase; import org.apache.cayenne.query.SelectById; import org.apache.cayenne.runtime.CayenneRuntimeBuilder; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.stubbing.Answer; import java.sql.SQLException; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; @@ -51,13 +51,13 @@ public class CommitLogFilter_All_FlattenedIT extends FlattenedRuntimeCase { .addModule(b -> CommitLogModule.extend(b).addListener(mockListener)); } - @Before + @BeforeEach public void before() { context = runtime.newContext(); } @Test - public void testPostCommit_UpdateToMany() throws SQLException { + public void postCommit_UpdateToMany() throws SQLException { e3.insert(1); e4.insert(11); e4.insert(12); diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_FilteredIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_FilteredIT.java index f87d06e94..803283539 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_FilteredIT.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_FilteredIT.java @@ -33,13 +33,13 @@ import org.apache.cayenne.commitlog.model.ToManyRelationshipChange; import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase; import org.apache.cayenne.query.SelectById; import org.apache.cayenne.runtime.CayenneRuntimeBuilder; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.stubbing.Answer; import java.sql.SQLException; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; @@ -55,13 +55,13 @@ public class CommitLogFilter_FilteredIT extends AuditableRuntimeCase { b -> CommitLogModule.extend(b).commitLogAnnotationEntitiesOnly().addListener(mockListener)); } - @Before + @BeforeEach public void before() { context = runtime.newContext(); } @Test - public void testPostCommit_Insert() { + public void postCommit_Insert() { doAnswer((Answer<Object>) invocation -> { @@ -92,7 +92,7 @@ public class CommitLogFilter_FilteredIT extends AuditableRuntimeCase { } @Test - public void testPostCommit_Update() throws SQLException { + public void postCommit_Update() throws SQLException { auditable2.insert(1, "P1_1", "P2_1"); doAnswer((Answer<Object>) invocation -> { @@ -124,7 +124,7 @@ public class CommitLogFilter_FilteredIT extends AuditableRuntimeCase { } @Test - public void testPostCommit_Delete() throws SQLException { + public void postCommit_Delete() throws SQLException { auditable2.insert(1, "P1_1", "P2_1"); doAnswer((Answer<Object>) invocation -> { @@ -153,7 +153,7 @@ public class CommitLogFilter_FilteredIT extends AuditableRuntimeCase { } @Test - public void testPostCommit_UpdateToMany() throws SQLException { + public void postCommit_UpdateToMany() throws SQLException { auditable1.insert(1, "xx"); auditableChild1.insert(1, 1, "cc1"); auditableChild1.insert(2, null, "cc2"); @@ -203,7 +203,7 @@ public class CommitLogFilter_FilteredIT extends AuditableRuntimeCase { } @Test - public void testPostCommit_IgnoreAttributes() throws SQLException { + public void postCommit_IgnoreAttributes() throws SQLException { auditable3.insert(1, "31", "32"); @@ -228,7 +228,7 @@ public class CommitLogFilter_FilteredIT extends AuditableRuntimeCase { } @Test - public void testPostCommit_IgnoreToMany() throws SQLException { + public void postCommit_IgnoreToMany() throws SQLException { auditable3.insert(1, "31", "32"); auditable4.insert(11, "41", "42", 1); @@ -257,7 +257,7 @@ public class CommitLogFilter_FilteredIT extends AuditableRuntimeCase { } @Test - public void testPostCommit_IgnoreToOne() throws SQLException { + public void postCommit_IgnoreToOne() throws SQLException { auditable3.insert(1, "31", "32"); auditable3.insert(2, "33", "34"); diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_ListenerInducedChangesIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_ListenerInducedChangesIT.java index b34c828dc..ec583efa5 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_ListenerInducedChangesIT.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_ListenerInducedChangesIT.java @@ -31,8 +31,8 @@ import org.apache.cayenne.commitlog.model.ObjectChangeType; import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase; import org.apache.cayenne.query.SelectById; import org.apache.cayenne.runtime.CayenneRuntimeBuilder; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -41,7 +41,7 @@ import java.util.ArrayList; import java.util.Comparator; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; @@ -60,13 +60,13 @@ public class CommitLogFilter_ListenerInducedChangesIT extends AuditableRuntimeCa b -> CommitLogModule.extend(b).addListener(mockListener)); } - @Before + @BeforeEach public void before() { context = runtime.newContext(); } @Test - public void testPostCommit_Insert() { + public void postCommit_Insert() { final InsertListener listener = new InsertListener(); runtime.getDataDomain().addListener(listener); @@ -102,7 +102,7 @@ public class CommitLogFilter_ListenerInducedChangesIT extends AuditableRuntimeCa } @Test - public void testPostCommit_Delete() throws SQLException { + public void postCommit_Delete() throws SQLException { auditable1.insert(1, "yy"); auditableChild1.insert(31, 1, "yyc"); @@ -143,7 +143,7 @@ public class CommitLogFilter_ListenerInducedChangesIT extends AuditableRuntimeCa } @Test - public void testPostCommit_Update() throws SQLException { + public void postCommit_Update() throws SQLException { auditable1.insert(1, "yy"); auditableChild1.insert(31, 1, "yyc"); diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_OutsideTxIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_OutsideTxIT.java index 54ad02f6d..b67b19099 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_OutsideTxIT.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_OutsideTxIT.java @@ -25,14 +25,14 @@ import org.apache.cayenne.commitlog.model.ObjectChange; import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase; import org.apache.cayenne.runtime.CayenneRuntimeBuilder; import org.apache.cayenne.tx.BaseTransaction; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.sql.SQLException; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; public class CommitLogFilter_OutsideTxIT extends AuditableRuntimeCase { @@ -59,13 +59,13 @@ public class CommitLogFilter_OutsideTxIT extends AuditableRuntimeCase { .addListener(listener)); } - @Before + @BeforeEach public void before() { this.context = runtime.newContext(); } @Test - public void testCommitLog() throws SQLException { + public void commitLog() throws SQLException { Auditable2 a1 = context.newObject(Auditable2.class); a1.setCharProperty1("yy"); a1.setCharProperty2("zz"); diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_IT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_IT.java index 5646c4c0d..a503bebdb 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_IT.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_IT.java @@ -28,14 +28,14 @@ import org.apache.cayenne.configuration.runtime.CoreModule; import org.apache.cayenne.query.ObjectSelect; import org.apache.cayenne.runtime.CayenneRuntimeBuilder; import org.apache.cayenne.tx.BaseTransaction; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.sql.SQLException; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class CommitLogFilter_PreUpdate_IT extends AuditableRuntimeCase { @@ -67,7 +67,7 @@ public class CommitLogFilter_PreUpdate_IT extends AuditableRuntimeCase { ); } - @Before + @BeforeEach public void before() throws Exception { context = runtime.newContext(); auditable5.insert(1, "yy"); @@ -75,7 +75,7 @@ public class CommitLogFilter_PreUpdate_IT extends AuditableRuntimeCase { } @Test - public void testCommitLog() throws SQLException { + public void commitLog() throws SQLException { AuditableChild5 auditableChild = ObjectSelect.query(AuditableChild5.class) .selectOne(context); diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_OutsideTxIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_OutsideTxIT.java index ac7d7be80..9dddc997b 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_OutsideTxIT.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_OutsideTxIT.java @@ -28,13 +28,13 @@ import org.apache.cayenne.configuration.runtime.CoreModule; import org.apache.cayenne.query.ObjectSelect; import org.apache.cayenne.runtime.CayenneRuntimeBuilder; import org.apache.cayenne.tx.BaseTransaction; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.sql.SQLException; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class CommitLogFilter_PreUpdate_OutsideTxIT extends AuditableRuntimeCase { @@ -67,7 +67,7 @@ public class CommitLogFilter_PreUpdate_OutsideTxIT extends AuditableRuntimeCase ); } - @Before + @BeforeEach public void before() throws Exception { context = runtime.newContext(); auditable5.insert(1, "yy"); @@ -75,7 +75,7 @@ public class CommitLogFilter_PreUpdate_OutsideTxIT extends AuditableRuntimeCase } @Test - public void testCommitLog() throws SQLException { + public void commitLog() throws SQLException { AuditableChild5 auditableChild = ObjectSelect.query(AuditableChild5.class) .selectOne(context); diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_TxIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_TxIT.java index 8dc723cf8..bba671c78 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_TxIT.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_TxIT.java @@ -25,14 +25,14 @@ import org.apache.cayenne.commitlog.model.ObjectChange; import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase; import org.apache.cayenne.runtime.CayenneRuntimeBuilder; import org.apache.cayenne.tx.BaseTransaction; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.sql.SQLException; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class CommitLogFilter_TxIT extends AuditableRuntimeCase { @@ -56,13 +56,13 @@ public class CommitLogFilter_TxIT extends AuditableRuntimeCase { addModule(b -> CommitLogModule.extend(b).commitLogAnnotationEntitiesOnly().addListener(listener)); } - @Before + @BeforeEach public void before() { this.context = runtime.newContext(); } @Test - public void testCommitLog() throws SQLException { + public void commitLog() throws SQLException { Auditable2 a1 = context.newObject(Auditable2.class); a1.setCharProperty1("yy"); a1.setCharProperty2("zz"); diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleBuilderTest.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleBuilderTest.java index 9b51f414b..30eb21afc 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleBuilderTest.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleBuilderTest.java @@ -24,17 +24,17 @@ import org.apache.cayenne.di.DIBootstrap; import org.apache.cayenne.di.Injector; import org.apache.cayenne.di.Key; import org.apache.cayenne.di.Module; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class CommitLogModuleBuilderTest { @Test - public void testListener_Object() { + public void listener_Object() { L listener = new L(); Module m = b -> CommitLogModule.extend(b).addListener(listener); @@ -46,7 +46,7 @@ public class CommitLogModuleBuilderTest { } @Test - public void testListener_Class() { + public void listener_Class() { Module m = b -> CommitLogModule.extend(b).addListener(L.class); diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleProviderTest.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleProviderTest.java index b58cc9668..b385cebb0 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleProviderTest.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleProviderTest.java @@ -21,12 +21,12 @@ package org.apache.cayenne.commitlog; import org.apache.cayenne.runtime.CayenneRuntimeModuleProvider; import org.apache.cayenne.unit.util.ModuleProviderChecker; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class CommitLogModuleProviderTest { @Test - public void testAutoLoadable() { + public void autoLoadable() { ModuleProviderChecker.testProviderPresent(CommitLogModuleProvider.class, CayenneRuntimeModuleProvider.class); } } diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/AuditableRuntimeCase.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/AuditableRuntimeCase.java index cbb3e1bff..1afb8a088 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/AuditableRuntimeCase.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/AuditableRuntimeCase.java @@ -22,8 +22,8 @@ import org.apache.cayenne.runtime.CayenneRuntime; import org.apache.cayenne.runtime.CayenneRuntimeBuilder; import org.apache.cayenne.test.jdbc.DBHelper; import org.apache.cayenne.test.jdbc.TableHelper; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; /** * A superclass of integration tests for cayenne-lifecycle. @@ -47,7 +47,7 @@ public abstract class AuditableRuntimeCase { protected TableHelper auditLog; - @Before + @BeforeEach public void startCayenne() throws Exception { this.runtime = configureCayenne().build(); @@ -92,7 +92,7 @@ public abstract class AuditableRuntimeCase { return CayenneRuntime.builder().addConfig("cayenne-lifecycle.xml"); } - @After + @AfterEach public void shutdownCayenne() { if (runtime != null) { runtime.shutdown(); diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/FlattenedRuntimeCase.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/FlattenedRuntimeCase.java index 01f0db713..83293d08d 100644 --- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/FlattenedRuntimeCase.java +++ b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/FlattenedRuntimeCase.java @@ -22,8 +22,8 @@ import org.apache.cayenne.runtime.CayenneRuntime; import org.apache.cayenne.runtime.CayenneRuntimeBuilder; import org.apache.cayenne.test.jdbc.DBHelper; import org.apache.cayenne.test.jdbc.TableHelper; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; public class FlattenedRuntimeCase { @@ -33,7 +33,7 @@ public class FlattenedRuntimeCase { protected TableHelper e4; protected TableHelper e34; - @Before + @BeforeEach public void startCayenne() throws Exception { this.runtime = configureCayenne().build(); @@ -52,7 +52,7 @@ public class FlattenedRuntimeCase { return CayenneRuntime.builder().addConfig("cayenne-lifecycle.xml"); } - @After + @AfterEach public void shutdownCayenne() { if (runtime != null) { runtime.shutdown();
