Skip to content

Commit 674b9c0

Browse files
authored
Merge pull request #1460 from kazuki43zoo/polishing-tests
Polishing tests
2 parents bcd095b + e58a6d2 commit 674b9c0

File tree

291 files changed

+2128
-2276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+2128
-2276
lines changed

src/test/java/org/apache/ibatis/autoconstructor/AutoConstructorTest.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2018 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,11 +31,11 @@
3131
import static org.junit.jupiter.api.Assertions.assertNotNull;
3232
import static org.junit.jupiter.api.Assertions.assertThrows;
3333

34-
public class AutoConstructorTest {
34+
class AutoConstructorTest {
3535
private static SqlSessionFactory sqlSessionFactory;
3636

3737
@BeforeAll
38-
public static void setUp() throws Exception {
38+
static void setUp() throws Exception {
3939
// create a SqlSessionFactory
4040
try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/autoconstructor/mybatis-config.xml")) {
4141
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
@@ -47,7 +47,7 @@ public static void setUp() throws Exception {
4747
}
4848

4949
@Test
50-
public void fullyPopulatedSubject() {
50+
void fullyPopulatedSubject() {
5151
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
5252
final AutoConstructorMapper mapper = sqlSession.getMapper(AutoConstructorMapper.class);
5353
final Object subject = mapper.getSubject(1);
@@ -56,35 +56,31 @@ public void fullyPopulatedSubject() {
5656
}
5757

5858
@Test
59-
public void primitiveSubjects() {
59+
void primitiveSubjects() {
6060
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
6161
final AutoConstructorMapper mapper = sqlSession.getMapper(AutoConstructorMapper.class);
62-
assertThrows(PersistenceException.class, () -> {
63-
mapper.getSubjects();
64-
});
62+
assertThrows(PersistenceException.class, mapper::getSubjects);
6563
}
6664
}
6765

6866
@Test
69-
public void annotatedSubject() {
67+
void annotatedSubject() {
7068
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
7169
final AutoConstructorMapper mapper = sqlSession.getMapper(AutoConstructorMapper.class);
7270
verifySubjects(mapper.getAnnotatedSubjects());
7371
}
7472
}
7573

7674
@Test
77-
public void badSubject() {
75+
void badSubject() {
7876
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
7977
final AutoConstructorMapper mapper = sqlSession.getMapper(AutoConstructorMapper.class);
80-
assertThrows(PersistenceException.class, () -> {
81-
mapper.getBadSubjects();
82-
});
78+
assertThrows(PersistenceException.class, mapper::getBadSubjects);
8379
}
8480
}
8581

8682
@Test
87-
public void extensiveSubject() {
83+
void extensiveSubject() {
8884
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
8985
final AutoConstructorMapper mapper = sqlSession.getMapper(AutoConstructorMapper.class);
9086
verifySubjects(mapper.getExtensiveSubject());

0 commit comments

Comments
 (0)