Skip to content

Commit 66c943a

Browse files
committed
Apply JUnit 5
1 parent e541e9f commit 66c943a

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

src/test/java/org/apache/ibatis/builder/AnnotationMapperBuilderTest.java

Lines changed: 9 additions & 18 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.
@@ -19,28 +19,19 @@
1919
import org.apache.ibatis.annotations.Options;
2020
import org.apache.ibatis.annotations.Select;
2121
import org.apache.ibatis.builder.annotation.MapperAnnotationBuilder;
22-
import org.apache.ibatis.builder.xml.XMLMapperBuilder;
2322
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
24-
import org.apache.ibatis.io.Resources;
2523
import org.apache.ibatis.mapping.MappedStatement;
2624
import org.apache.ibatis.mapping.ResultSetType;
2725
import org.apache.ibatis.mapping.StatementType;
2826
import org.apache.ibatis.session.Configuration;
29-
import org.apache.ibatis.type.TypeHandler;
30-
import org.junit.Test;
27+
import org.junit.jupiter.api.Test;
3128

32-
import java.io.InputStream;
33-
import java.util.regex.Pattern;
34-
35-
import static com.googlecode.catchexception.apis.BDDCatchException.caughtException;
36-
import static com.googlecode.catchexception.apis.BDDCatchException.when;
3729
import static org.assertj.core.api.Assertions.assertThat;
38-
import static org.assertj.core.api.BDDAssertions.then;
3930

40-
public class AnnotationMapperBuilderTest {
31+
class AnnotationMapperBuilderTest {
4132

4233
@Test
43-
public void withOptions() throws Exception {
34+
void withOptions() {
4435
Configuration configuration = new Configuration();
4536
MapperAnnotationBuilder builder = new MapperAnnotationBuilder(configuration, Mapper.class);
4637
builder.parse();
@@ -61,7 +52,7 @@ public void withOptions() throws Exception {
6152
}
6253

6354
@Test
64-
public void withOptionsAndWithoutOptionsAttributesWhenSpecifyDefaultValue() throws Exception {
55+
void withOptionsAndWithoutOptionsAttributesWhenSpecifyDefaultValue() {
6556
Configuration configuration = new Configuration();
6657
configuration.setDefaultResultSetType(ResultSetType.SCROLL_INSENSITIVE);
6758
MapperAnnotationBuilder builder = new MapperAnnotationBuilder(configuration, Mapper.class);
@@ -73,7 +64,7 @@ public void withOptionsAndWithoutOptionsAttributesWhenSpecifyDefaultValue() thro
7364

7465

7566
@Test
76-
public void withOptionsAndWithoutOptionsAttributesWhenNotSpecifyDefaultValue() throws Exception {
67+
void withOptionsAndWithoutOptionsAttributesWhenNotSpecifyDefaultValue() {
7768
Configuration configuration = new Configuration();
7869
MapperAnnotationBuilder builder = new MapperAnnotationBuilder(configuration, Mapper.class);
7970
builder.parse();
@@ -83,7 +74,7 @@ public void withOptionsAndWithoutOptionsAttributesWhenNotSpecifyDefaultValue() t
8374
}
8475

8576
@Test
86-
public void withoutOptionsWhenSpecifyDefaultValue() throws Exception {
77+
void withoutOptionsWhenSpecifyDefaultValue() {
8778
Configuration configuration = new Configuration();
8879
configuration.setDefaultResultSetType(ResultSetType.SCROLL_INSENSITIVE);
8980
MapperAnnotationBuilder builder = new MapperAnnotationBuilder(configuration, Mapper.class);
@@ -94,7 +85,7 @@ public void withoutOptionsWhenSpecifyDefaultValue() throws Exception {
9485
}
9586

9687
@Test
97-
public void withoutOptionsWhenNotSpecifyDefaultValue() throws Exception {
88+
void withoutOptionsWhenNotSpecifyDefaultValue() {
9889
Configuration configuration = new Configuration();
9990
MapperAnnotationBuilder builder = new MapperAnnotationBuilder(configuration, Mapper.class);
10091
builder.parse();
@@ -103,7 +94,7 @@ public void withoutOptionsWhenNotSpecifyDefaultValue() throws Exception {
10394
assertThat(mappedStatement.getResultSetType()).isEqualTo(ResultSetType.DEFAULT);
10495
}
10596

106-
public interface Mapper {
97+
interface Mapper {
10798

10899
@Insert("insert into test (name) values(#{name})")
109100
@Options(useGeneratedKeys = true, keyColumn = "key_column", keyProperty = "keyProperty")

0 commit comments

Comments
 (0)