Skip to content

Commit 0dd3896

Browse files
Fix test class visibility and make getCreatedBy() method public
Co-Authored-By: [email protected] <[email protected]>
1 parent fcba2a2 commit 0dd3896

File tree

14 files changed

+40
-35
lines changed

14 files changed

+40
-35
lines changed

doma-spring-boot-autoconfigure/src/test/java/org/seasar/doma/boot/autoconfigure/DomaAutoConfigurationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@
6969
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
7070
import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
7171

72-
public class DomaAutoConfigurationTest {
72+
class DomaAutoConfigurationTest {
7373
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
7474
.withConfiguration(AutoConfigurations.of(DomaAutoConfiguration.class,
7575
DataSourceAutoConfiguration.class));
7676

7777
@Test
78-
public void testAutoRegisteredConfig() {
78+
void testAutoRegisteredConfig() {
7979
this.contextRunner
8080
.run(context -> {
8181
Config config = context.getBean(Config.class);

doma-spring-boot-core/src/test/java/org/seasar/doma/boot/DomaPersistenceExceptionTranslatorTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
import org.springframework.jdbc.UncategorizedSQLException;
3131
import org.springframework.jdbc.support.SQLExceptionSubclassTranslator;
3232

33-
public class DomaPersistenceExceptionTranslatorTest {
33+
class DomaPersistenceExceptionTranslatorTest {
3434

3535
private final DomaPersistenceExceptionTranslator translator = new DomaPersistenceExceptionTranslator(
3636
new SQLExceptionSubclassTranslator());
3737

3838
@Test
39-
public void testOccurNotJdbcException() {
39+
void testOccurNotJdbcException() {
4040
DataAccessException dataAccessException = translator
4141
.translateExceptionIfPossible(new DomaException(Message.DOMA2008));
4242
assertNull(dataAccessException);
@@ -51,8 +51,8 @@ public void testOccurSqlExecutionException() {
5151
"select * from todo where todo_id = '000000001'",
5252
"TodoDao/findOne.sql", new SQLException(), null));
5353
assertInstanceOf(UncategorizedSQLException.class, dataAccessException);
54-
assertEquals("select * from todo where todo_id = ?",
55-
((UncategorizedSQLException)dataAccessException).getSql());
54+
assertEquals("select * from todo where todo_id = ?",
55+
((UncategorizedSQLException) dataAccessException).getSql());
5656
}
5757

5858
@Test

doma-spring-boot-core/src/test/java/org/seasar/doma/boot/PageablesTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77
import org.seasar.doma.jdbc.SelectOptionsAccessor;
88
import org.springframework.data.domain.PageRequest;
99

10-
public class PageablesTest {
10+
class PageablesTest {
1111

1212
@Test
13-
public void testToSelectOptions() throws Exception {
13+
void testToSelectOptions() throws Exception {
1414
SelectOptions options = Pageables.toSelectOptions(pageRequest(0, 10));
1515
assertEquals(0L, SelectOptionsAccessor.getOffset(options));
1616
assertEquals(10L, SelectOptionsAccessor.getLimit(options));
1717
}
1818

1919
@Test
20-
public void testToSelectOptions2() throws Exception {
20+
void testToSelectOptions2() throws Exception {
2121
SelectOptions options = Pageables.toSelectOptions(pageRequest(2, 10));
2222
assertEquals(20L, SelectOptionsAccessor.getOffset(options));
2323
assertEquals(10L, SelectOptionsAccessor.getLimit(options));
2424
}
2525

2626
@Test
27-
public void testToSelectOptions3() throws Exception {
27+
void testToSelectOptions3() throws Exception {
2828
SelectOptions options = Pageables.toSelectOptions(pageRequest(2, 5));
2929
assertEquals(10L, SelectOptionsAccessor.getOffset(options));
3030
assertEquals(5L, SelectOptionsAccessor.getLimit(options));

doma-spring-boot-core/src/test/java/org/seasar/doma/boot/ResourceLoaderScriptFileLoaderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import org.springframework.core.io.Resource;
1212
import org.springframework.core.io.ResourceLoader;
1313

14-
public class ResourceLoaderScriptFileLoaderTest {
14+
class ResourceLoaderScriptFileLoaderTest {
1515

1616
@Test
1717
void testLoadAsURL() throws Exception {

doma-spring-boot-core/src/test/java/org/seasar/doma/boot/TryLookupEntityListenerProviderTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
import org.springframework.context.annotation.Bean;
1212
import org.springframework.stereotype.Component;
1313

14-
public class TryLookupEntityListenerProviderTest {
14+
class TryLookupEntityListenerProviderTest {
1515

1616
@Test
17-
public void testManaged() throws Exception {
17+
void testManaged() throws Exception {
1818
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
1919
context.register(FooListener.class);
2020
context.refresh();
@@ -26,7 +26,7 @@ public void testManaged() throws Exception {
2626
}
2727

2828
@Test
29-
public void testManaged_notUnique() throws Exception {
29+
void testManaged_notUnique() throws Exception {
3030
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
3131
FooConfig.class)) {
3232
TryLookupEntityListenerProvider provider = new TryLookupEntityListenerProvider();
@@ -38,7 +38,7 @@ public void testManaged_notUnique() throws Exception {
3838
}
3939

4040
@Test
41-
public void testNotManaged() throws Exception {
41+
void testNotManaged() throws Exception {
4242
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
4343
context.refresh();
4444
TryLookupEntityListenerProvider provider = new TryLookupEntityListenerProvider();
@@ -49,23 +49,23 @@ public void testNotManaged() throws Exception {
4949
}
5050

5151
@Component
52-
public static class FooListener implements EntityListener<Object> {
52+
static class FooListener implements EntityListener<Object> {
5353

5454
final boolean managed;
5555

5656
// Invoked by Doma
57-
public FooListener() {
57+
FooListener() {
5858
managed = false;
5959
}
6060

6161
// Invoked by Spring
6262
@Autowired
63-
public FooListener(ApplicationContext context) {
63+
FooListener(ApplicationContext context) {
6464
managed = true;
6565
}
6666
}
6767

68-
public static class FooConfig {
68+
static class FooConfig {
6969
@Bean
7070
FooListener foo1() {
7171
return new FooListener();

doma-spring-boot-core/src/test/java/org/seasar/doma/boot/UnifiedCriteriaPageableTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
import org.springframework.data.domain.Pageable;
2626
import org.springframework.data.domain.Sort;
2727

28-
public class UnifiedCriteriaPageableTest {
28+
class UnifiedCriteriaPageableTest {
2929
@ParameterizedTest
3030
@CsvSource(value = {
3131
"0 | 10 | 0 | 10",
3232
"2 | 10 | 20 | 10",
3333
"2 | 5 | 10 | 5",
3434
}, delimiter = '|')
35-
public void testOffsetAndLimit(
35+
void testOffsetAndLimit(
3636
int pageNumber, int pageSize, int expectedOffset, int expectedLimit) {
3737
Pageable pageable = PageRequest.of(pageNumber, pageSize);
3838
UnifiedCriteriaPageable p = UnifiedCriteriaPageable.of(pageable, c -> Optional.empty());
@@ -45,7 +45,7 @@ public void testOffsetAndLimit(
4545
}
4646

4747
@Test
48-
public void testOffsetAndLimitWhenUnpaged() {
48+
void testOffsetAndLimitWhenUnpaged() {
4949
Pageable pageable = Pageable.unpaged();
5050
UnifiedCriteriaPageable p = UnifiedCriteriaPageable.of(pageable, c -> Optional.empty());
5151

doma-spring-boot-core/src/test/java/org/seasar/doma/boot/event/DomaApplicationListenerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void handle(TestEntity1 entity, PreInsertContext<TestEntity1> context) {
187187
public static class OnApplicationEventTest {
188188

189189
@Test
190-
public void handleEvent() throws Exception {
190+
void handleEvent() throws Exception {
191191
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
192192
context.register(EntityOnlyHandler.class);
193193
context.refresh();

doma-spring-boot-core/src/test/java/org/seasar/doma/boot/event/DomaEventEntityListenerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
@SuppressWarnings("unchecked")
2525
public class DomaEventEntityListenerTest {
2626
@Test
27-
public void handlePreInsert() throws Exception {
27+
void handlePreInsert() throws Exception {
2828
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
2929
context.register(DomaEventEntityListener.class);
3030
context.register(DomaEventListenerFactory.class);
@@ -43,7 +43,7 @@ public void handlePreInsert() throws Exception {
4343
}
4444

4545
@Test
46-
public void handlePreInsertWithContext() throws Exception {
46+
void handlePreInsertWithContext() throws Exception {
4747
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
4848
context.register(DomaEventEntityListener.class);
4949
context.register(DomaEventListenerFactory.class);
@@ -64,7 +64,7 @@ public void handlePreInsertWithContext() throws Exception {
6464
}
6565

6666
@Test
67-
public void handlePreUpdate() throws Exception {
67+
void handlePreUpdate() throws Exception {
6868
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
6969
context.register(DomaEventEntityListener.class);
7070
context.register(DomaEventListenerFactory.class);
@@ -83,7 +83,7 @@ public void handlePreUpdate() throws Exception {
8383
}
8484

8585
@Test
86-
public void handlePreUpdateWithContext() throws Exception {
86+
void handlePreUpdateWithContext() throws Exception {
8787
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
8888
context.register(DomaEventEntityListener.class);
8989
context.register(DomaEventListenerFactory.class);

doma-spring-boot-samples/doma-spring-boot-sample-entity-listener/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
import org.springframework.web.util.UriComponentsBuilder;
1717

1818
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
19-
public class ApplicationTest {
19+
class ApplicationTest {
2020
private final TestRestTemplate restTemplate = new TestRestTemplate();
2121
private final ParameterizedTypeReference<List<Message>> typedReference = new ParameterizedTypeReference<List<Message>>() {
2222
};
2323
@LocalServerPort
2424
private int port;
2525

2626
@Test
27-
public void test() {
27+
void test() {
2828
LocalDate now = LocalDate.now();
2929
Message message1 = restTemplate.getForObject(
3030
UriComponentsBuilder.fromUriString("http://localhost").port(port)

doma-spring-boot-samples/doma-spring-boot-sample-event-handler/src/test/java/org/seasar/doma/boot/sample/ApplicationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
import org.springframework.web.util.UriComponentsBuilder;
1717

1818
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
19-
public class ApplicationTest {
19+
class ApplicationTest {
2020
private final TestRestTemplate restTemplate = new TestRestTemplate();
2121
private final ParameterizedTypeReference<List<Message>> typedReference = new ParameterizedTypeReference<List<Message>>() {
2222
};
2323
@LocalServerPort
2424
private int port;
2525

2626
@Test
27-
public void test() {
27+
void test() {
2828
LocalDate now = LocalDate.now();
2929
Message message1 = restTemplate.getForObject(
3030
UriComponentsBuilder.fromUriString("http://localhost").port(port)

0 commit comments

Comments
 (0)