Skip to content

Commit 0e93702

Browse files
authored
Merge pull request #3366 from hazendaz/pom-cleanup
Various cleanup in tests
2 parents 5665cc3 + 6a2e63c commit 0e93702

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

src/test/java/org/apache/ibatis/io/ExternalResourcesTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.io.FileWriter;
2626
import java.io.IOException;
2727
import java.nio.charset.StandardCharsets;
28+
import java.nio.file.Files;
2829

2930
import org.junit.jupiter.api.AfterEach;
3031
import org.junit.jupiter.api.BeforeEach;
@@ -42,10 +43,10 @@ class ExternalResourcesTest {
4243
*/
4344
@BeforeEach
4445
void setUp() throws Exception {
45-
tempFile = File.createTempFile("migration", "properties");
46+
tempFile = Files.createTempFile("migration", "properties").toFile();
4647
tempFile.canWrite();
47-
sourceFile = File.createTempFile("test1", "sql");
48-
destFile = File.createTempFile("test2", "sql");
48+
sourceFile = Files.createTempFile("test1", "sql").toFile();
49+
destFile = Files.createTempFile("test2", "sql").toFile();
4950
}
5051

5152
@Test

src/test/java/org/apache/ibatis/submitted/nestedresulthandler/Item.java

Lines changed: 2 additions & 2 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.
@@ -21,7 +21,7 @@ public class Item {
2121

2222
@Override
2323
public String toString() {
24-
return new StringBuilder().append("Item(").append(id).append(", ").append(name).append(" )").toString();
24+
return "Item(" + id + ", " + name + " )";
2525
}
2626

2727
public Integer getId() {

src/test/java/org/apache/ibatis/submitted/nestedresulthandler/Person.java

Lines changed: 2 additions & 3 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.
@@ -26,8 +26,7 @@ public class Person {
2626

2727
@Override
2828
public String toString() {
29-
return new StringBuilder().append("Person(").append(id).append(", ").append(name).append(", ").append(items)
30-
.append(" )").toString();
29+
return "Person(" + id + ", " + name + ", " + items + " )";
3130
}
3231

3332
public Integer getId() {

src/test/java/org/apache/ibatis/submitted/nestedresulthandler/PersonItemPair.java

Lines changed: 2 additions & 3 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,8 +24,7 @@ public class PersonItemPair {
2424

2525
@Override
2626
public String toString() {
27-
return new StringBuilder().append("PersonItemPair(").append(person).append(", ").append(item).append(" )")
28-
.toString();
27+
return "PersonItemPair(" + person + ", " + item + " )";
2928
}
3029

3130
public Person getPerson() {

0 commit comments

Comments
 (0)