Skip to content

Commit a985f3e

Browse files
committed
polish, test fixups
1 parent f3e3b76 commit a985f3e

File tree

7 files changed

+62
-62
lines changed

7 files changed

+62
-62
lines changed

src/test/kotlin/org/openrewrite/java/testing/assertj/JUnitAssertArrayEqualsToAssertThatTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class JUnitAssertArrayEqualsToAssertThatTest : JavaRecipeTest {
308308
org.junit.jupiter.api.Assertions.assertArrayEquals(expected, notification(), () -> "These should be close");
309309
}
310310
private String[] notification() {
311-
return new String[] {"Fred", "Alice", "Mary"};
311+
return new String[] {"Fred", "Alice", "Mary"};
312312
}
313313
}
314314
""",

src/test/kotlin/org/openrewrite/java/testing/cleanup/TestsShouldIncludeAssertionsTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ class TestsShouldIncludeAssertionsTest : JavaRecipeTest {
173173
import org.learning.math.MyMathService;
174174
import static org.mockito.Mockito.when;
175175
import org.learning.math.Stuff;
176-
176+
177177
class AaTest {
178178
@Mock
179179
MyMathService myMathService;
180-
180+
181181
@Test
182182
public void methodTest() {
183183
when(myMathService.addIntegers("1", "2")).thenReturn(3);
@@ -193,11 +193,11 @@ class TestsShouldIncludeAssertionsTest : JavaRecipeTest {
193193
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
194194
import static org.mockito.Mockito.when;
195195
import org.learning.math.Stuff;
196-
196+
197197
class AaTest {
198198
@Mock
199199
MyMathService myMathService;
200-
200+
201201
@Test
202202
public void methodTest() {
203203
assertDoesNotThrow(() -> {

src/test/kotlin/org/openrewrite/java/testing/junit5/AssertToAssertionsTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class AssertToAssertionsTest : JavaRecipeTest {
7777
public void test() {
7878
assertFalse(t.getName(), A.class.isAssignableFrom(t.getClass()));
7979
}
80-
80+
8181
class T {
8282
String getName() {
8383
return "World";
@@ -96,7 +96,7 @@ class AssertToAssertionsTest : JavaRecipeTest {
9696
public void test() {
9797
assertFalse(A.class.isAssignableFrom(t.getClass()), t.getName());
9898
}
99-
99+
100100
class T {
101101
String getName() {
102102
return "World";

src/test/kotlin/org/openrewrite/java/testing/junit5/ParameterizedRunnerToParameterizedTest.kt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,12 @@ class ParameterizedRunnerToParameterizedTest : JavaRecipeTest {
338338
import org.junit.Test;
339339
import org.junit.runner.RunWith;
340340
import org.junit.runners.Parameterized;
341-
341+
342342
public class NestedTests {
343343
@BeforeClass
344344
public static void setup() {
345345
}
346-
346+
347347
public static abstract class T1 extends NestedTests {
348348
final String path;
349349
public T1(String path) {
@@ -354,13 +354,13 @@ class ParameterizedRunnerToParameterizedTest : JavaRecipeTest {
354354
Assert.assertNotNull(path);
355355
}
356356
}
357-
357+
358358
static List<Object[]> valuesDataProvider() {
359359
List<Object[]> params = new ArrayList<>();
360360
params.add(new Object[] { "1", "2" });
361361
return params;
362362
}
363-
363+
364364
@RunWith(Parameterized.class)
365365
public static class I1 extends T1 {
366366
@Parameterized.Parameters(name = "{index}: {0}[{1}] = {2}")
@@ -375,7 +375,7 @@ class ParameterizedRunnerToParameterizedTest : JavaRecipeTest {
375375
Assert.assertNotNull(path);
376376
}
377377
}
378-
378+
379379
@RunWith(Parameterized.class)
380380
public static class I2 extends NestedTests {
381381
@Parameterized.Parameters(name = "{index}: {0}[{1}] = {2}")
@@ -400,12 +400,12 @@ class ParameterizedRunnerToParameterizedTest : JavaRecipeTest {
400400
import org.junit.Test;
401401
import org.junit.jupiter.params.ParameterizedTest;
402402
import org.junit.jupiter.params.provider.MethodSource;
403-
403+
404404
public class NestedTests {
405405
@BeforeClass
406406
public static void setup() {
407407
}
408-
408+
409409
public static abstract class T1 extends NestedTests {
410410
final String path;
411411
public T1(String path) {
@@ -416,40 +416,40 @@ class ParameterizedRunnerToParameterizedTest : JavaRecipeTest {
416416
Assert.assertNotNull(path);
417417
}
418418
}
419-
419+
420420
static List<Object[]> valuesDataProvider() {
421421
List<Object[]> params = new ArrayList<>();
422422
params.add(new Object[] { "1", "2" });
423423
return params;
424424
}
425-
425+
426426
public static class I1 extends T1 {
427427
public static Collection<Object[]> data1() {
428428
return valuesDataProvider();
429429
}
430-
430+
431431
public void initI1(String path) {
432432
super(path);
433433
}
434-
434+
435435
@MethodSource("data1")
436436
@ParameterizedTest(name = "{index}: {0}[{1}] = {2}")
437437
public void testI(String path) {
438438
initI1(path);
439439
Assert.assertNotNull(path);
440440
}
441441
}
442-
442+
443443
public static class I2 extends NestedTests {
444444
public static Collection<Object[]> data2() {
445445
return valuesDataProvider();
446446
}
447447
String path;
448-
448+
449449
public void initI2(String path) {
450450
this.path = path;
451451
}
452-
452+
453453
@MethodSource("data2")
454454
@ParameterizedTest(name = "{index}: {0}[{1}] = {2}")
455455
public void testI2(String path) {

src/test/kotlin/org/openrewrite/java/testing/junit5/TemporaryFolderToTempDirTest.kt

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ class TemporaryFolderToTempDirTest : JavaRecipeTest {
3535
before = """
3636
import org.junit.Rule;
3737
import org.junit.rules.TemporaryFolder;
38-
38+
3939
public class A {
4040
@Rule
4141
public TemporaryFolder tmpFolder = new TemporaryFolder();
42-
42+
4343
@After
4444
public void tearDown() {
4545
tmpFolder.delete();
@@ -50,11 +50,11 @@ class TemporaryFolderToTempDirTest : JavaRecipeTest {
5050
import org.junit.jupiter.api.io.TempDir;
5151
5252
import java.io.File;
53-
53+
5454
public class A {
5555
@TempDir
5656
public File tmpFolder;
57-
57+
5858
@After
5959
public void tearDown() {
6060
tmpFolder.delete();
@@ -147,12 +147,12 @@ class TemporaryFolderToTempDirTest : JavaRecipeTest {
147147
import org.junit.rules.TemporaryFolder;
148148
149149
import java.io.File;
150-
150+
151151
class A {
152-
152+
153153
@Rule
154154
TemporaryFolder tempDir = new TemporaryFolder();
155-
155+
156156
void foo() {
157157
File root = tempDir.getRoot();
158158
}
@@ -162,12 +162,12 @@ class TemporaryFolderToTempDirTest : JavaRecipeTest {
162162
import org.junit.jupiter.api.io.TempDir;
163163
164164
import java.io.File;
165-
165+
166166
class A {
167-
167+
168168
@TempDir
169169
File tempDir;
170-
170+
171171
void foo() {
172172
File root = tempDir;
173173
}
@@ -230,21 +230,21 @@ class TemporaryFolderToTempDirTest : JavaRecipeTest {
230230
231231
import java.io.File;
232232
import java.io.IOException;
233-
233+
234234
class A {
235-
235+
236236
@Rule
237237
TemporaryFolder tempDir1 = new TemporaryFolder();
238-
238+
239239
@Test
240240
public void someTest() {
241241
File subDir = tempDir1.newFolder("sub");
242242
File subDirs = tempDir1.newFolder("foo", "bar", "baz");
243-
243+
244244
String last = "z";
245245
File subDirs2 = tempDir1.newFolder("v", "w", getSubFolderName(), "y", last);
246246
}
247-
247+
248248
String getSubFolderName() {
249249
return "x";
250250
}
@@ -256,25 +256,25 @@ class TemporaryFolderToTempDirTest : JavaRecipeTest {
256256
257257
import java.io.File;
258258
import java.io.IOException;
259-
259+
260260
class A {
261-
261+
262262
@TempDir
263263
File tempDir1;
264-
264+
265265
@Test
266266
public void someTest() {
267267
File subDir = newFolder(tempDir1, "sub");
268268
File subDirs = newFolder(tempDir1, "foo", "bar", "baz");
269-
269+
270270
String last = "z";
271271
File subDirs2 = newFolder(tempDir1, "v", "w", getSubFolderName(), "y", last);
272272
}
273-
273+
274274
String getSubFolderName() {
275275
return "x";
276276
}
277-
277+
278278
private static File newFolder(File root, String... subDirs) throws IOException {
279279
String subFolder = String.join("/", subDirs);
280280
File result = new File(root, subFolder);
@@ -401,7 +401,7 @@ class TemporaryFolderToTempDirTest : JavaRecipeTest {
401401
static TemporaryFolder tempFolder = new TemporaryFolder();
402402
@Rule
403403
TemporaryFolder tempFolder2 = new TemporaryFolder();
404-
404+
405405
@Test
406406
public void newNamedFileIsCreatedUnderRootFolder() throws IOException {
407407
final String fileName = "SampleFile.txt";
@@ -419,13 +419,13 @@ class TemporaryFolderToTempDirTest : JavaRecipeTest {
419419
420420
import java.io.File;
421421
import java.io.IOException;
422-
422+
423423
public class T {
424424
@TempDir
425425
static File tempFolder;
426426
@TempDir
427427
File tempFolder2;
428-
428+
429429
@Test
430430
public void newNamedFileIsCreatedUnderRootFolder() throws IOException {
431431
final String fileName = "SampleFile.txt";
@@ -443,11 +443,11 @@ class TemporaryFolderToTempDirTest : JavaRecipeTest {
443443
before = """
444444
import org.junit.ClassRule;
445445
import org.junit.rules.TemporaryFolder;
446-
446+
447447
public class T {
448448
@ClassRule
449449
public static final TemporaryFolder temporaryFolder = new TemporaryFolder();
450-
450+
451451
public static void init() {
452452
File aDir = temporaryFolder.getRoot();
453453
}
@@ -457,11 +457,11 @@ class TemporaryFolderToTempDirTest : JavaRecipeTest {
457457
import org.junit.jupiter.api.io.TempDir;
458458
459459
import java.io.File;
460-
460+
461461
public class T {
462462
@TempDir
463463
public static final File temporaryFolder;
464-
464+
465465
public static void init() {
466466
File aDir = temporaryFolder;
467467
}

0 commit comments

Comments
 (0)