diff --git a/doma-spring-boot-autoconfigure/pom.xml b/doma-spring-boot-autoconfigure/pom.xml
index 7d07701b..63a4bb74 100644
--- a/doma-spring-boot-autoconfigure/pom.xml
+++ b/doma-spring-boot-autoconfigure/pom.xml
@@ -46,13 +46,8 @@
test
- org.junit.vintage
- junit-vintage-engine
- test
-
-
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter
test
diff --git a/doma-spring-boot-autoconfigure/src/test/java/org/seasar/doma/boot/autoconfigure/DomaAutoConfigurationTest.java b/doma-spring-boot-autoconfigure/src/test/java/org/seasar/doma/boot/autoconfigure/DomaAutoConfigurationTest.java
index 2aeddc73..07588068 100644
--- a/doma-spring-boot-autoconfigure/src/test/java/org/seasar/doma/boot/autoconfigure/DomaAutoConfigurationTest.java
+++ b/doma-spring-boot-autoconfigure/src/test/java/org/seasar/doma/boot/autoconfigure/DomaAutoConfigurationTest.java
@@ -69,13 +69,13 @@
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
-public class DomaAutoConfigurationTest {
+class DomaAutoConfigurationTest {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(DomaAutoConfiguration.class,
DataSourceAutoConfiguration.class));
@Test
- public void testAutoRegisteredConfig() {
+ void testAutoRegisteredConfig() {
this.contextRunner
.run(context -> {
Config config = context.getBean(Config.class);
@@ -104,7 +104,7 @@ public void testAutoRegisteredConfig() {
}
@Test
- public void testConfigWithDomaConfigBuilder() {
+ void testConfigWithDomaConfigBuilder() {
this.contextRunner
.withUserConfiguration(ConfigBuilderConfigure.class)
.run(context -> {
@@ -135,7 +135,7 @@ public void testConfigWithDomaConfigBuilder() {
}
@Test
- public void testConfigWithConfig() {
+ void testConfigWithConfig() {
this.contextRunner
.withUserConfiguration(ConfigConfigure.class)
.run(context -> {
@@ -166,7 +166,7 @@ public void testConfigWithConfig() {
}
@Test
- public void testExceptionTranslationEnabledSpecifyFalse() {
+ void testExceptionTranslationEnabledSpecifyFalse() {
this.contextRunner
.withPropertyValues("doma.exception-translation-enabled=false")
.run(context -> {
@@ -176,7 +176,7 @@ public void testExceptionTranslationEnabledSpecifyFalse() {
}
@Test
- public void testExceptionTranslationEnabledSpecifyTrue() {
+ void testExceptionTranslationEnabledSpecifyTrue() {
this.contextRunner
.withPropertyValues("doma.exception-translation-enabled=true")
.run(context -> {
@@ -188,7 +188,7 @@ public void testExceptionTranslationEnabledSpecifyTrue() {
}
@Test
- public void testChangeDialect() {
+ void testChangeDialect() {
this.contextRunner
.withPropertyValues("doma.dialect=MYSQL")
.run(context -> {
@@ -198,7 +198,7 @@ public void testChangeDialect() {
}
@Test
- public void testChangeMaxRows() {
+ void testChangeMaxRows() {
this.contextRunner
.withPropertyValues("doma.max-rows=100")
.run(context -> {
@@ -208,7 +208,7 @@ public void testChangeMaxRows() {
}
@Test
- public void testSQLExceptionTranslator() {
+ void testSQLExceptionTranslator() {
this.contextRunner
.run(context -> {
PersistenceExceptionTranslator translator = context
@@ -242,7 +242,7 @@ public void testSQLExceptionTranslator() {
}
@Test
- public void testAutoRegisteredCriteriaAPI() {
+ void testAutoRegisteredCriteriaAPI() {
this.contextRunner
.run(context -> {
Entityql entityql = context.getBean(Entityql.class);
@@ -253,7 +253,7 @@ public void testAutoRegisteredCriteriaAPI() {
}
@Test
- public void testCriteriaAPIWithConfig() {
+ void testCriteriaAPIWithConfig() {
this.contextRunner
.withUserConfiguration(MyCriteriaAPIConfig.class)
.run(context -> {
@@ -267,7 +267,7 @@ public void testCriteriaAPIWithConfig() {
}
@Test
- public void testDialectByDataSourceUrl() {
+ void testDialectByDataSourceUrl() {
this.contextRunner
.withPropertyValues(
"spring.datasource.url=jdbc:postgresql://localhost:1234/example",
@@ -279,7 +279,7 @@ public void testDialectByDataSourceUrl() {
}
@Test
- public void testDialectByJdbConnectionDetails() {
+ void testDialectByJdbConnectionDetails() {
this.contextRunner
.withPropertyValues(
"doma.exception-translation-enabled=false"/* prevent database connections */)
@@ -306,7 +306,7 @@ public String getJdbcUrl() {
}
@Test
- public void testDialectMissingJdbConnectionDetails() {
+ void testDialectMissingJdbConnectionDetails() {
this.contextRunner
.withPropertyValues(
"doma.exception-translation-enabled=false"/* prevent database connections */)
@@ -319,7 +319,7 @@ public void testDialectMissingJdbConnectionDetails() {
}
@Test
- public void testDialectMissingJdbConnectionDetailsExplicitDialect() {
+ void testDialectMissingJdbConnectionDetailsExplicitDialect() {
this.contextRunner
.withPropertyValues(
"doma.dialect=POSTGRES",
@@ -333,7 +333,7 @@ public void testDialectMissingJdbConnectionDetailsExplicitDialect() {
}
@Test
- public void testDialectByDomaPropertiesIgnoreDataSourceUrl() {
+ void testDialectByDomaPropertiesIgnoreDataSourceUrl() {
this.contextRunner
.withPropertyValues(
"spring.datasource.url=jdbc:h2:mem:example",
@@ -346,7 +346,7 @@ public void testDialectByDomaPropertiesIgnoreDataSourceUrl() {
}
@Test
- public void testJdbcLoggerSlf4J() {
+ void testJdbcLoggerSlf4J() {
this.contextRunner
.withPropertyValues("doma.jdbcLogger=SLF4J")
@@ -357,7 +357,7 @@ public void testJdbcLoggerSlf4J() {
}
@Test
- public void testAutoRegisteredQueryDsl() {
+ void testAutoRegisteredQueryDsl() {
this.contextRunner
.run(context -> {
@@ -367,7 +367,7 @@ public void testAutoRegisteredQueryDsl() {
}
@Test
- public void testQueryDslWithConfig() {
+ void testQueryDslWithConfig() {
this.contextRunner
.withUserConfiguration(MyQueryDslConfig.class)
@@ -379,7 +379,7 @@ public void testQueryDslWithConfig() {
}
@Test
- public void testThrowExceptionIfDuplicateColumn() {
+ void testThrowExceptionIfDuplicateColumn() {
this.contextRunner
.withPropertyValues("doma.throw-exception-if-duplicate-column=true")
@@ -391,7 +391,7 @@ public void testThrowExceptionIfDuplicateColumn() {
}
@Test
- public void testCustomizeShouldRemoveBlockComment() {
+ void testCustomizeShouldRemoveBlockComment() {
Predicate predicate = mock(Predicate.class);
when(predicate.test(anyString())).thenReturn(true);
@@ -411,7 +411,7 @@ public void testCustomizeShouldRemoveBlockComment() {
}
@Test
- public void testCustomizeShouldRemoveLineComment() {
+ void testCustomizeShouldRemoveLineComment() {
Predicate predicate = mock(Predicate.class);
when(predicate.test(anyString())).thenReturn(true);
@@ -431,7 +431,7 @@ public void testCustomizeShouldRemoveLineComment() {
}
@Test
- public void testAnonymousPredicateAreNotAffected() {
+ void testAnonymousPredicateAreNotAffected() {
Predicate predicate = mock(Predicate.class);
when(predicate.test(anyString())).thenReturn(true);
@@ -450,7 +450,7 @@ public void testAnonymousPredicateAreNotAffected() {
}
@Test
- public void testShouldRemoveBlankLinesDefaultValue() {
+ void testShouldRemoveBlankLinesDefaultValue() {
this.contextRunner
.run(context -> {
@@ -460,7 +460,7 @@ public void testShouldRemoveBlankLinesDefaultValue() {
}
@Test
- public void testShouldRemoveBlankLinesChangedValue() {
+ void testShouldRemoveBlankLinesChangedValue() {
this.contextRunner
.withPropertyValues("doma.sql-builder-settings.should-remove-blank-lines=true")
@@ -471,7 +471,7 @@ public void testShouldRemoveBlankLinesChangedValue() {
}
@Test
- public void testShouldRequireInListPaddingDefaultValue() {
+ void testShouldRequireInListPaddingDefaultValue() {
this.contextRunner
.run(context -> {
@@ -481,7 +481,7 @@ public void testShouldRequireInListPaddingDefaultValue() {
}
@Test
- public void testShouldRequireInListPaddingChangedValue() {
+ void testShouldRequireInListPaddingChangedValue() {
this.contextRunner
.withPropertyValues("doma.sql-builder-settings.should-require-in-list-padding=true")
@@ -492,7 +492,7 @@ public void testShouldRequireInListPaddingChangedValue() {
}
@Test
- public void testStatisticManagerDefaultValue() {
+ void testStatisticManagerDefaultValue() {
this.contextRunner
.run(context -> {
@@ -502,7 +502,7 @@ public void testStatisticManagerDefaultValue() {
}
@Test
- public void testStatisticManagerChangedValue() {
+ void testStatisticManagerChangedValue() {
this.contextRunner
.withPropertyValues("doma.statistic-manager.enabled=true")
diff --git a/doma-spring-boot-core/pom.xml b/doma-spring-boot-core/pom.xml
index b77201d9..7f0ca2fa 100644
--- a/doma-spring-boot-core/pom.xml
+++ b/doma-spring-boot-core/pom.xml
@@ -34,21 +34,11 @@
org.springframework.data
spring-data-commons
-
- junit
- junit
- test
-
org.junit.jupiter
junit-jupiter
test
-
- org.junit.vintage
- junit-vintage-engine
- test
-
org.assertj
assertj-core
diff --git a/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/DomaPersistenceExceptionTranslatorTest.java b/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/DomaPersistenceExceptionTranslatorTest.java
index 341567b1..20e5a5d8 100644
--- a/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/DomaPersistenceExceptionTranslatorTest.java
+++ b/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/DomaPersistenceExceptionTranslatorTest.java
@@ -1,12 +1,12 @@
package org.seasar.doma.boot;
-import static org.hamcrest.CoreMatchers.*;
-import static org.hamcrest.MatcherAssert.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import java.sql.SQLException;
import java.util.Collections;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.seasar.doma.DomaException;
import org.seasar.doma.jdbc.ConfigException;
import org.seasar.doma.jdbc.NoResultException;
@@ -30,33 +30,33 @@
import org.springframework.jdbc.UncategorizedSQLException;
import org.springframework.jdbc.support.SQLExceptionSubclassTranslator;
-public class DomaPersistenceExceptionTranslatorTest {
+class DomaPersistenceExceptionTranslatorTest {
private final DomaPersistenceExceptionTranslator translator = new DomaPersistenceExceptionTranslator(
new SQLExceptionSubclassTranslator());
@Test
- public void testOccurNotJdbcException() {
+ void testOccurNotJdbcException() {
DataAccessException dataAccessException = translator
.translateExceptionIfPossible(new DomaException(Message.DOMA2008));
- assertThat(dataAccessException, nullValue());
+ assertNull(dataAccessException);
}
@Test
- public void testOccurSqlExecutionException() {
+ void testOccurSqlExecutionException() {
DataAccessException dataAccessException = translator
.translateExceptionIfPossible(new SqlExecutionException(
SqlLogType.FORMATTED, SqlKind.SELECT,
"select * from todo where todo_id = ?",
"select * from todo where todo_id = '000000001'",
"TodoDao/findOne.sql", new SQLException(), null));
- assertThat(dataAccessException, is(instanceOf(UncategorizedSQLException.class)));
- assertThat(UncategorizedSQLException.class.cast(dataAccessException).getSql(),
- is("select * from todo where todo_id = ?"));
+ assertInstanceOf(UncategorizedSQLException.class, dataAccessException);
+ assertEquals("select * from todo where todo_id = ?",
+ ((UncategorizedSQLException) dataAccessException).getSql());
}
@Test
- public void testThrowOptimisticLockingFailureException() {
+ void testThrowOptimisticLockingFailureException() {
DataAccessException dataAccessException = translator
.translateExceptionIfPossible(new OptimisticLockException(
SqlLogType.FORMATTED,
@@ -64,12 +64,11 @@ public void testThrowOptimisticLockingFailureException() {
"update todo set title = ? where todo_id = ? and version = ?",
"update todo set title = 'Modified Title' where todo_id = '000000001' and version = 1",
"TodoDao/update.sql"));
- assertThat(dataAccessException,
- is(instanceOf(OptimisticLockingFailureException.class)));
+ assertInstanceOf(OptimisticLockingFailureException.class, dataAccessException);
}
@Test
- public void testThrowDuplicateKeyException() {
+ void testThrowDuplicateKeyException() {
DataAccessException dataAccessException = translator
.translateExceptionIfPossible(new UniqueConstraintException(
SqlLogType.FORMATTED,
@@ -77,11 +76,11 @@ public void testThrowDuplicateKeyException() {
"insert into todo (todo_id, title) values (?, ?)",
"insert into todo (todo_id, title) values ('000000001', 'Title')",
"TodoDao/insert.sql", new SQLException()));
- assertThat(dataAccessException, is(instanceOf(DuplicateKeyException.class)));
+ assertInstanceOf(DuplicateKeyException.class, dataAccessException);
}
@Test
- public void testThrowIncorrectResultSizeDataAccessException() {
+ void testThrowIncorrectResultSizeDataAccessException() {
{
DataAccessException dataAccessException = translator
.translateExceptionIfPossible(new NonUniqueResultException(
@@ -89,8 +88,7 @@ public void testThrowIncorrectResultSizeDataAccessException() {
"select * from todo where created_at = ?",
"select * from todo where created_at = '2016-03-06'",
"TodoDao/findBy.sql"));
- assertThat(dataAccessException,
- is(instanceOf(IncorrectResultSizeDataAccessException.class)));
+ assertInstanceOf(IncorrectResultSizeDataAccessException.class, dataAccessException);
}
{
DataAccessException dataAccessException = translator
@@ -100,24 +98,22 @@ public void testThrowIncorrectResultSizeDataAccessException() {
"select todo_id, title from todo where created_at = ?",
"select todo_id, title from todo where created_at = '2016-03-06'",
"TodoDao/findBy.sql"));
- assertThat(dataAccessException,
- is(instanceOf(IncorrectResultSizeDataAccessException.class)));
+ assertInstanceOf(IncorrectResultSizeDataAccessException.class, dataAccessException);
}
}
@Test
- public void testThrowEmptyResultDataAccessException() {
+ void testThrowEmptyResultDataAccessException() {
DataAccessException dataAccessException = translator
.translateExceptionIfPossible(new NoResultException(SqlLogType.FORMATTED,
SqlKind.SELECT, "select * from todo where todo_id = ?",
"select * from todo where todo_id = '000000001'",
"TodoDao/findOne.sql"));
- assertThat(dataAccessException,
- is(instanceOf(EmptyResultDataAccessException.class)));
+ assertInstanceOf(EmptyResultDataAccessException.class, dataAccessException);
}
@Test
- public void testThrowTypeMismatchDataAccessException() {
+ void testThrowTypeMismatchDataAccessException() {
{
DataAccessException dataAccessException = translator
.translateExceptionIfPossible(new UnknownColumnException(
@@ -125,8 +121,7 @@ public void testThrowTypeMismatchDataAccessException() {
SqlKind.SELECT, "select * from todo where created_at = ?",
"select * from todo where created_at = '2016-03-06'",
"TodoDao/findBy.sql"));
- assertThat(dataAccessException,
- is(instanceOf(TypeMismatchDataAccessException.class)));
+ assertInstanceOf(TypeMismatchDataAccessException.class, dataAccessException);
}
{
DataAccessException dataAccessException = translator
@@ -139,18 +134,16 @@ public void testThrowTypeMismatchDataAccessException() {
"select todo_id, title from todo where created_at = ?",
"select todo_id, title from todo where created_at = '2016-03-06'",
"TodoDao/findBy.sql"));
- assertThat(dataAccessException,
- is(instanceOf(TypeMismatchDataAccessException.class)));
+ assertInstanceOf(TypeMismatchDataAccessException.class, dataAccessException);
}
}
@Test
- public void testThrowUncategorizedDataAccessException() {
+ void testThrowUncategorizedDataAccessException() {
DataAccessException dataAccessException = translator
.translateExceptionIfPossible(new ConfigException("DomaConfig",
"configure"));
- assertThat(dataAccessException,
- is(instanceOf(UncategorizedDataAccessException.class)));
+ assertInstanceOf(UncategorizedDataAccessException.class, dataAccessException);
}
}
diff --git a/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/PageablesTest.java b/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/PageablesTest.java
index 77a33309..bffffccc 100644
--- a/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/PageablesTest.java
+++ b/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/PageablesTest.java
@@ -1,34 +1,33 @@
package org.seasar.doma.boot;
-import static org.hamcrest.CoreMatchers.*;
-import static org.hamcrest.MatcherAssert.*;
+import static org.junit.jupiter.api.Assertions.*;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.seasar.doma.jdbc.SelectOptions;
import org.seasar.doma.jdbc.SelectOptionsAccessor;
import org.springframework.data.domain.PageRequest;
-public class PageablesTest {
+class PageablesTest {
@Test
- public void testToSelectOptions() throws Exception {
+ void testToSelectOptions() throws Exception {
SelectOptions options = Pageables.toSelectOptions(pageRequest(0, 10));
- assertThat(SelectOptionsAccessor.getOffset(options), is(0L));
- assertThat(SelectOptionsAccessor.getLimit(options), is(10L));
+ assertEquals(0L, SelectOptionsAccessor.getOffset(options));
+ assertEquals(10L, SelectOptionsAccessor.getLimit(options));
}
@Test
- public void testToSelectOptions2() throws Exception {
+ void testToSelectOptions2() throws Exception {
SelectOptions options = Pageables.toSelectOptions(pageRequest(2, 10));
- assertThat(SelectOptionsAccessor.getOffset(options), is(20L));
- assertThat(SelectOptionsAccessor.getLimit(options), is(10L));
+ assertEquals(20L, SelectOptionsAccessor.getOffset(options));
+ assertEquals(10L, SelectOptionsAccessor.getLimit(options));
}
@Test
- public void testToSelectOptions3() throws Exception {
+ void testToSelectOptions3() throws Exception {
SelectOptions options = Pageables.toSelectOptions(pageRequest(2, 5));
- assertThat(SelectOptionsAccessor.getOffset(options), is(10L));
- assertThat(SelectOptionsAccessor.getLimit(options), is(5L));
+ assertEquals(10L, SelectOptionsAccessor.getOffset(options));
+ assertEquals(5L, SelectOptionsAccessor.getLimit(options));
}
private static PageRequest pageRequest(int page, int size) throws Exception {
diff --git a/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/ResourceLoaderScriptFileLoaderTest.java b/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/ResourceLoaderScriptFileLoaderTest.java
index cbf65865..c54b252a 100644
--- a/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/ResourceLoaderScriptFileLoaderTest.java
+++ b/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/ResourceLoaderScriptFileLoaderTest.java
@@ -11,7 +11,7 @@
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
-public class ResourceLoaderScriptFileLoaderTest {
+class ResourceLoaderScriptFileLoaderTest {
@Test
void testLoadAsURL() throws Exception {
diff --git a/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/TryLookupEntityListenerProviderTest.java b/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/TryLookupEntityListenerProviderTest.java
index 4f81d100..aa583d06 100644
--- a/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/TryLookupEntityListenerProviderTest.java
+++ b/doma-spring-boot-core/src/test/java/org/seasar/doma/boot/TryLookupEntityListenerProviderTest.java
@@ -1,9 +1,9 @@
package org.seasar.doma.boot;
-import static org.hamcrest.CoreMatchers.*;
-import static org.hamcrest.MatcherAssert.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertThrows;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.seasar.doma.jdbc.entity.EntityListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
@@ -11,59 +11,61 @@
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
-public class TryLookupEntityListenerProviderTest {
+class TryLookupEntityListenerProviderTest {
@Test
- public void testManaged() throws Exception {
+ void testManaged() throws Exception {
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
context.register(FooListener.class);
context.refresh();
TryLookupEntityListenerProvider provider = new TryLookupEntityListenerProvider();
provider.setApplicationContext(context);
FooListener listener = provider.get(FooListener.class, FooListener::new);
- assertThat(listener.managed, is(true));
+ assertTrue(listener.managed);
}
}
- @Test(expected = IllegalStateException.class)
- public void testManaged_notUnique() throws Exception {
+ @Test
+ void testManaged_notUnique() throws Exception {
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
FooConfig.class)) {
TryLookupEntityListenerProvider provider = new TryLookupEntityListenerProvider();
provider.setApplicationContext(context);
- provider.get(FooListener.class, FooListener::new);
+ assertThrows(IllegalStateException.class, () -> {
+ provider.get(FooListener.class, FooListener::new);
+ });
}
}
@Test
- public void testNotManaged() throws Exception {
+ void testNotManaged() throws Exception {
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
context.refresh();
TryLookupEntityListenerProvider provider = new TryLookupEntityListenerProvider();
provider.setApplicationContext(context);
FooListener listener = provider.get(FooListener.class, FooListener::new);
- assertThat(listener.managed, is(false));
+ assertFalse(listener.managed);
}
}
@Component
- public static class FooListener implements EntityListener
- org.junit.vintage
- junit-vintage-engine
- test
-
-
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter
test
diff --git a/doma-spring-boot-samples/doma-spring-boot-sample-entity-listener/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java b/doma-spring-boot-samples/doma-spring-boot-sample-entity-listener/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
index 820d59d5..0bef7f89 100644
--- a/doma-spring-boot-samples/doma-spring-boot-sample-entity-listener/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
+++ b/doma-spring-boot-samples/doma-spring-boot-sample-entity-listener/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
@@ -16,7 +16,7 @@
import org.springframework.web.util.UriComponentsBuilder;
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-public class ApplicationTest {
+class ApplicationTest {
private final TestRestTemplate restTemplate = new TestRestTemplate();
private final ParameterizedTypeReference> typedReference = new ParameterizedTypeReference>() {
};
@@ -24,7 +24,7 @@ public class ApplicationTest {
private int port;
@Test
- public void test() {
+ void test() {
LocalDate now = LocalDate.now();
Message message1 = restTemplate.getForObject(
UriComponentsBuilder.fromUriString("http://localhost").port(port)
diff --git a/doma-spring-boot-samples/doma-spring-boot-sample-event-handler/pom.xml b/doma-spring-boot-samples/doma-spring-boot-sample-event-handler/pom.xml
index 2f6fa813..deedf760 100644
--- a/doma-spring-boot-samples/doma-spring-boot-sample-event-handler/pom.xml
+++ b/doma-spring-boot-samples/doma-spring-boot-sample-event-handler/pom.xml
@@ -47,13 +47,8 @@
test
- org.junit.vintage
- junit-vintage-engine
- test
-
-
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter
test
diff --git a/doma-spring-boot-samples/doma-spring-boot-sample-event-handler/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java b/doma-spring-boot-samples/doma-spring-boot-sample-event-handler/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
index 820d59d5..0bef7f89 100644
--- a/doma-spring-boot-samples/doma-spring-boot-sample-event-handler/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
+++ b/doma-spring-boot-samples/doma-spring-boot-sample-event-handler/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
@@ -16,7 +16,7 @@
import org.springframework.web.util.UriComponentsBuilder;
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-public class ApplicationTest {
+class ApplicationTest {
private final TestRestTemplate restTemplate = new TestRestTemplate();
private final ParameterizedTypeReference> typedReference = new ParameterizedTypeReference>() {
};
@@ -24,7 +24,7 @@ public class ApplicationTest {
private int port;
@Test
- public void test() {
+ void test() {
LocalDate now = LocalDate.now();
Message message1 = restTemplate.getForObject(
UriComponentsBuilder.fromUriString("http://localhost").port(port)
diff --git a/doma-spring-boot-samples/doma-spring-boot-sample-simple/pom.xml b/doma-spring-boot-samples/doma-spring-boot-sample-simple/pom.xml
index 2e48b63d..5b1ad237 100644
--- a/doma-spring-boot-samples/doma-spring-boot-sample-simple/pom.xml
+++ b/doma-spring-boot-samples/doma-spring-boot-sample-simple/pom.xml
@@ -17,6 +17,11 @@
+
+ org.seasar.doma
+ doma-core
+ ${doma.version}
+
org.seasar.doma
doma-processor
@@ -43,13 +48,8 @@
test
- org.junit.vintage
- junit-vintage-engine
- test
-
-
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter
test
diff --git a/doma-spring-boot-samples/doma-spring-boot-sample-simple/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java b/doma-spring-boot-samples/doma-spring-boot-sample-simple/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
index 1f832104..41c076f0 100644
--- a/doma-spring-boot-samples/doma-spring-boot-sample-simple/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
+++ b/doma-spring-boot-samples/doma-spring-boot-sample-simple/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
@@ -16,7 +16,7 @@
import org.springframework.web.util.UriComponentsBuilder;
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-public class ApplicationTest {
+class ApplicationTest {
@Autowired
private TestRestTemplate restTemplate;
private final ParameterizedTypeReference> typedReference = new ParameterizedTypeReference>() {
@@ -25,7 +25,7 @@ public class ApplicationTest {
private int port;
@Test
- public void test() {
+ void test() {
Message message1 = restTemplate.getForObject(
UriComponentsBuilder.fromUriString("http://localhost").port(port)
.queryParam("text", "hello").build().toUri(),
diff --git a/doma-spring-boot-samples/doma-spring-boot-sample-two-datasource/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java b/doma-spring-boot-samples/doma-spring-boot-sample-two-datasource/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
index f3c5385c..dc3462b7 100644
--- a/doma-spring-boot-samples/doma-spring-boot-sample-two-datasource/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
+++ b/doma-spring-boot-samples/doma-spring-boot-sample-two-datasource/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
@@ -10,7 +10,7 @@
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
-public class ApplicationTest {
+class ApplicationTest {
@Autowired
private SampleService service;
diff --git a/doma-spring-boot-samples/doma-spring-boot-sample-unified-criteria/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java b/doma-spring-boot-samples/doma-spring-boot-sample-unified-criteria/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
index f16b7a1b..5debe6ec 100644
--- a/doma-spring-boot-samples/doma-spring-boot-sample-unified-criteria/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
+++ b/doma-spring-boot-samples/doma-spring-boot-sample-unified-criteria/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java
@@ -15,7 +15,7 @@
import org.springframework.web.client.RestClient;
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-public class ApplicationTest {
+class ApplicationTest {
private RestClient http;
private final ParameterizedTypeReference> typedReference = new ParameterizedTypeReference>() {
};
diff --git a/pom.xml b/pom.xml
index f2e20e0f..cb416484 100644
--- a/pom.xml
+++ b/pom.xml
@@ -187,6 +187,24 @@
+
+
+ org.openrewrite.maven
+ rewrite-maven-plugin
+ 5.33.0
+
+
+ org.openrewrite.java.testing.junit5.JUnit4to5Migration
+
+
+
+
+ org.openrewrite.recipe
+ rewrite-testing-frameworks
+ 2.3.0
+
+
+