Skip to content

Commit c2a647c

Browse files
authored
Merge pull request #3343 from hazendaz/pom-cleanup
Cleanup tests with open rewrite help
2 parents 5d7e1eb + 2e3990c commit c2a647c

File tree

212 files changed

+650
-666
lines changed

Some content is hidden

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

212 files changed

+650
-666
lines changed

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@
232232
<artifactId>junit-jupiter</artifactId>
233233
<version>${testcontainers.version}</version>
234234
<scope>test</scope>
235+
<!--Only Mysqlcontainer is allowed to use junit 4: Uncomment to test
236+
<exclusions>
237+
<exclusion>
238+
<groupId>junit</groupId>
239+
<artifactId>junit</artifactId>
240+
</exclusion>
241+
</exclusions>
242+
-->
235243
</dependency>
236244
<dependency>
237245
<groupId>org.testcontainers</groupId>

src/test/java/org/apache/ibatis/binding/BindingTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 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.

src/test/java/org/apache/ibatis/binding/WrongMapperTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 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.
@@ -24,9 +24,7 @@ class WrongMapperTest {
2424
@Test
2525
void shouldFailForBothOneAndMany() {
2626
Configuration configuration = new Configuration();
27-
Assertions.assertThrows(RuntimeException.class, () -> {
28-
configuration.addMapper(MapperWithOneAndMany.class);
29-
});
27+
Assertions.assertThrows(RuntimeException.class, () -> configuration.addMapper(MapperWithOneAndMany.class));
3028
}
3129

3230
}

src/test/java/org/apache/ibatis/binding/WrongNamespacesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2024 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.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2024 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.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2024 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.
@@ -22,7 +22,7 @@
2222
import org.junit.jupiter.api.BeforeEach;
2323
import org.junit.jupiter.api.Test;
2424

25-
public class SqlSourceBuilderTest {
25+
class SqlSourceBuilderTest {
2626

2727
private static Configuration configuration;
2828
private static SqlSourceBuilder sqlSourceBuilder;
@@ -36,15 +36,15 @@ void setUp() {
3636
}
3737

3838
@Test
39-
void testShrinkWhitespacesInSqlIsFalse() {
39+
void shrinkWhitespacesInSqlIsFalse() {
4040
SqlSource sqlSource = sqlSourceBuilder.parse(sqlFromXml, null, null);
4141
BoundSql boundSql = sqlSource.getBoundSql(null);
4242
String actual = boundSql.getSql();
4343
Assertions.assertEquals(sqlFromXml, actual);
4444
}
4545

4646
@Test
47-
void testShrinkWhitespacesInSqlIsTrue() {
47+
void shrinkWhitespacesInSqlIsTrue() {
4848
configuration.setShrinkWhitespacesInSql(true);
4949
SqlSource sqlSource = sqlSourceBuilder.parse(sqlFromXml, null, null);
5050
BoundSql boundSql = sqlSource.getBoundSql(null);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 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.

src/test/java/org/apache/ibatis/builder/xml/dynamic/DynamicSqlSourceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 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.

src/test/java/org/apache/ibatis/builder/xsd/XmlMapperBuilderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 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.

src/test/java/org/apache/ibatis/cache/CacheKeyTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 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.
@@ -112,9 +112,7 @@ void shouldDemonstrateClonedNullCacheKeysAreEqual() throws Exception {
112112
void serializationExceptionTest() {
113113
CacheKey cacheKey = new CacheKey();
114114
cacheKey.update(new Object());
115-
assertThrows(NotSerializableException.class, () -> {
116-
serialize(cacheKey);
117-
});
115+
assertThrows(NotSerializableException.class, () -> serialize(cacheKey));
118116
}
119117

120118
@Test

0 commit comments

Comments
 (0)