diff --git a/src/test/java/org/openrewrite/java/migrate/UpgradeToJava17Test.java b/src/test/java/org/openrewrite/java/migrate/UpgradeToJava17Test.java index 8dcf3d90a3..4f1fe2fba4 100644 --- a/src/test/java/org/openrewrite/java/migrate/UpgradeToJava17Test.java +++ b/src/test/java/org/openrewrite/java/migrate/UpgradeToJava17Test.java @@ -81,39 +81,18 @@ void upgradeFromJava8ToJava17() { """ package com.abc; - import java.util.Collections; - import java.util.List; - import java.util.Map; - import java.util.Set; - class A { - private static final List staticList = Collections.singletonList("0"); - - /* This is a comment */ - public void test() { - // This is a comment - Set stringSet = Collections.singleton("aaa"); - List stringList = Collections.singletonList("bbb"); - Map stringMap = Collections.singletonMap("a-key", "a-value"); + public String test() { + return String.format("Hello %s", "world"); } } """, """ package com.abc; - import java.util.List; - import java.util.Map; - import java.util.Set; - class A { - private static final List staticList = List.of("0"); - - /* This is a comment */ - public void test() { - // This is a comment - Set stringSet = Set.of("aaa"); - List stringList = List.of("bbb"); - Map stringMap = Map.of("a-key", "a-value"); + public String test() { + return "Hello %s".formatted("world"); } } """ @@ -168,20 +147,9 @@ void referenceToJavaVersionProperty() { """ package com.abc; - import java.util.Collections; - import java.util.List; - import java.util.Map; - import java.util.Set; - class A { - private static final List staticList = Collections.singletonList("0"); - - /* This is a comment */ - public void test() { - // This is a comment - Set stringSet = Collections.singleton("aaa"); - List stringList = Collections.singletonList("bbb"); - Map stringMap = Collections.singletonMap("a-key", "a-value"); + public String test() { + return String.format("Hello %s", "world"); } } """, @@ -189,19 +157,9 @@ public void test() { """ package com.abc; - import java.util.List; - import java.util.Map; - import java.util.Set; - class A { - private static final List staticList = List.of("0"); - - /* This is a comment */ - public void test() { - // This is a comment - Set stringSet = Set.of("aaa"); - List stringList = List.of("bbb"); - Map stringMap = Map.of("a-key", "a-value"); + public String test() { + return "Hello %s".formatted("world"); } } """,