@@ -42,15 +42,15 @@ void templateError() {
4242 java (
4343 """
4444 import java.util.*;
45-
45+
4646 interface ConnectionListener {
4747 void onCreate();
4848 }
49-
49+
5050 class A {
5151 public void setConnectionListeners(List<? extends ConnectionListener> listeners) {
5252 }
53-
53+
5454 public void test() {
5555 setConnectionListeners(Collections.singletonList(new ConnectionListener() {
5656 @Override
@@ -62,15 +62,15 @@ public void onCreate() {
6262 """ ,
6363 """
6464 import java.util.List;
65-
65+
6666 interface ConnectionListener {
6767 void onCreate();
6868 }
69-
69+
7070 class A {
7171 public void setConnectionListeners(List<? extends ConnectionListener> listeners) {
7272 }
73-
73+
7474 public void test() {
7575 setConnectionListeners(List.of(new ConnectionListener() {
7676 @Override
@@ -93,14 +93,14 @@ void singletonList() {
9393 java (
9494 """
9595 import java.util.*;
96-
96+
9797 class Test {
9898 List<String> list = Collections.singletonList("ABC");
9999 }
100100 """ ,
101101 """
102102 import java.util.List;
103-
103+
104104 class Test {
105105 List<String> list = List.of("ABC");
106106 }
@@ -118,14 +118,14 @@ void singletonListStaticImport() {
118118 """
119119 import java.util.*;
120120 import static java.util.Collections.singletonList;
121-
121+
122122 class Test {
123123 List<String> list = singletonList("ABC");
124124 }
125125 """ ,
126126 """
127127 import java.util.List;
128-
128+
129129 class Test {
130130 List<String> list = List.of("ABC");
131131 }
@@ -143,15 +143,15 @@ void singletonListCustomType() {
143143 """
144144 import java.util.*;
145145 import java.time.LocalDate;
146-
146+
147147 class Test {
148148 List<LocalDate> list = Collections.singletonList(LocalDate.now());
149149 }
150150 """ ,
151151 """
152152 import java.util.List;
153153 import java.time.LocalDate;
154-
154+
155155 class Test {
156156 List<LocalDate> list = List.of(LocalDate.now());
157157 }
@@ -164,27 +164,40 @@ class Test {
164164 @ Test
165165 void lombokAllArgsConstructor () {
166166 rewriteRun (
167- spec -> spec .parser (JavaParser .fromJavaVersion ().classpath ("lombok" ))
168- .typeValidationOptions (TypeValidation .builder ().constructorInvocations (false ).build ()),
167+ spec -> spec .parser (JavaParser .fromJavaVersion ().classpath ("lombok" )),
169168 //language=java
170169 java (
171170 """
172171 import lombok.AllArgsConstructor;
173172 import java.util.List;
174-
173+
175174 import static java.util.Collections.singletonList;
176-
175+
177176 enum FooEnum {
178177 FOO, BAR;
179-
178+
180179 @AllArgsConstructor
181180 public enum BarEnum {
182181 foobar(singletonList(FOO));
183-
182+
184183 private final List<FooEnum> expectedStates;
185184 }
186185 }
187- """
186+ """ ,
187+ """
188+ import lombok.AllArgsConstructor;
189+ import java.util.List;
190+
191+ enum FooEnum {
192+ FOO, BAR;
193+
194+ @AllArgsConstructor
195+ public enum BarEnum {
196+ foobar(List.of(FOO));
197+
198+ private final List<FooEnum> expectedStates;
199+ }
200+ }"""
188201 )
189202 );
190203 }
@@ -197,7 +210,7 @@ void shouldNotConvertLiteralNull() {
197210 java (
198211 """
199212 import java.util.*;
200-
213+
201214 class Test {
202215 List<String> list = Collections.singletonList(null);
203216 }
0 commit comments