|
25 | 25 | import org.apache.ibatis.mapping.StatementType;
|
26 | 26 | import org.apache.ibatis.session.Configuration;
|
27 | 27 | import org.apache.ibatis.type.TypeHandler;
|
| 28 | +import org.hamcrest.CoreMatchers; |
28 | 29 | import org.junit.Rule;
|
29 | 30 | import org.junit.Test;
|
30 | 31 | import org.junit.rules.ExpectedException;
|
31 | 32 |
|
32 | 33 | import static org.junit.Assert.assertThat;
|
33 |
| -import static org.hamcrest.core.Is.is; |
34 |
| -import static org.hamcrest.core.IsNull.nullValue; |
| 34 | +import static org.hamcrest.CoreMatchers.*; |
35 | 35 |
|
36 | 36 | public class XmlMapperBuilderTest {
|
37 | 37 |
|
@@ -84,23 +84,26 @@ public void parseExpression() {
|
84 | 84 | public void resolveJdbcTypeWithUndefinedValue() {
|
85 | 85 | BaseBuilder builder = new BaseBuilder(new Configuration()){{}};
|
86 | 86 | expectedException.expect(BuilderException.class);
|
87 |
| - expectedException.expectMessage(is("Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum constant org.apache.ibatis.type.JdbcType.aaa")); |
| 87 | + expectedException.expectMessage(startsWith("Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum")); |
| 88 | + expectedException.expectMessage(endsWith("org.apache.ibatis.type.JdbcType.aaa")); |
88 | 89 | builder.resolveJdbcType("aaa");
|
89 | 90 | }
|
90 | 91 |
|
91 | 92 | @Test
|
92 | 93 | public void resolveResultSetTypeWithUndefinedValue() {
|
93 | 94 | BaseBuilder builder = new BaseBuilder(new Configuration()){{}};
|
94 | 95 | expectedException.expect(BuilderException.class);
|
95 |
| - expectedException.expectMessage(is("Error resolving ResultSetType. Cause: java.lang.IllegalArgumentException: No enum constant org.apache.ibatis.mapping.ResultSetType.bbb")); |
| 96 | + expectedException.expectMessage(startsWith("Error resolving ResultSetType. Cause: java.lang.IllegalArgumentException: No enum")); |
| 97 | + expectedException.expectMessage(endsWith("org.apache.ibatis.mapping.ResultSetType.bbb")); |
96 | 98 | builder.resolveResultSetType("bbb");
|
97 | 99 | }
|
98 | 100 |
|
99 | 101 | @Test
|
100 | 102 | public void resolveParameterModeWithUndefinedValue() {
|
101 | 103 | BaseBuilder builder = new BaseBuilder(new Configuration()){{}};
|
102 | 104 | expectedException.expect(BuilderException.class);
|
103 |
| - expectedException.expectMessage(is("Error resolving ParameterMode. Cause: java.lang.IllegalArgumentException: No enum constant org.apache.ibatis.mapping.ParameterMode.ccc")); |
| 105 | + expectedException.expectMessage(startsWith("Error resolving ParameterMode. Cause: java.lang.IllegalArgumentException: No enum")); |
| 106 | + expectedException.expectMessage(endsWith("org.apache.ibatis.mapping.ParameterMode.ccc")); |
104 | 107 | builder.resolveParameterMode("ccc");
|
105 | 108 | }
|
106 | 109 |
|
|
0 commit comments