Skip to content

Commit 6329d1e

Browse files
committed
Delombok test code.
Closes #513
1 parent 15922ce commit 6329d1e

11 files changed

+294
-59
lines changed

src/test/java/org/springframework/data/keyvalue/Person.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package org.springframework.data.keyvalue;
1717

18-
import lombok.Data;
19-
2018
import org.springframework.data.annotation.Id;
2119

2220
import com.querydsl.core.annotations.QueryEntity;
@@ -26,7 +24,6 @@
2624
* @author Mark Paluch
2725
*/
2826
@QueryEntity
29-
@Data
3027
public class Person {
3128

3229
private @Id String id;
@@ -38,4 +35,28 @@ public Person(String firstname, int age) {
3835
this.firstname = firstname;
3936
this.age = age;
4037
}
38+
39+
public String getId() {
40+
return this.id;
41+
}
42+
43+
public String getFirstname() {
44+
return this.firstname;
45+
}
46+
47+
public int getAge() {
48+
return this.age;
49+
}
50+
51+
public void setId(String id) {
52+
this.id = id;
53+
}
54+
55+
public void setFirstname(String firstname) {
56+
this.firstname = firstname;
57+
}
58+
59+
public void setAge(int age) {
60+
this.age = age;
61+
}
4162
}

src/test/java/org/springframework/data/keyvalue/TypeWithCustomComposedKeySpaceAnnotationUsingAliasFor.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package org.springframework.data.keyvalue;
1717

18-
import lombok.Data;
19-
2018
import org.springframework.data.annotation.Id;
2119
import org.springframework.data.annotation.Persistent;
2220

@@ -27,7 +25,6 @@
2725
* @author Mark Paluch
2826
*/
2927
@CustomKeySpaceAnnotationWithAliasFor(name = "aliased")
30-
@Data
3128
public class TypeWithCustomComposedKeySpaceAnnotationUsingAliasFor {
3229

3330
@Id String id;
@@ -36,4 +33,20 @@ public class TypeWithCustomComposedKeySpaceAnnotationUsingAliasFor {
3633
public TypeWithCustomComposedKeySpaceAnnotationUsingAliasFor(String name) {
3734
this.name = name;
3835
}
36+
37+
public String getId() {
38+
return this.id;
39+
}
40+
41+
public String getName() {
42+
return this.name;
43+
}
44+
45+
public void setId(String id) {
46+
this.id = id;
47+
}
48+
49+
public void setName(String name) {
50+
this.name = name;
51+
}
3952
}

src/test/java/org/springframework/data/keyvalue/core/KeyValueTemplateTests.java

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717

1818
import static org.assertj.core.api.Assertions.*;
1919

20-
import lombok.AllArgsConstructor;
21-
import lombok.Data;
22-
2320
import java.io.Serializable;
2421
import java.lang.annotation.ElementType;
2522
import java.lang.annotation.Retention;
@@ -30,7 +27,6 @@
3027
import org.junit.jupiter.api.AfterEach;
3128
import org.junit.jupiter.api.BeforeEach;
3229
import org.junit.jupiter.api.Test;
33-
3430
import org.springframework.core.annotation.AliasFor;
3531
import org.springframework.dao.DuplicateKeyException;
3632
import org.springframework.data.annotation.Id;
@@ -216,31 +212,64 @@ void insertShouldRespectTypeAlias() {
216212
assertThat((List) operations.findAll(ALIASED.getClass())).contains(ALIASED, SUBCLASS_OF_ALIASED);
217213
}
218214

219-
@Data
220-
@AllArgsConstructor
221215
static class Foo {
222216

223217
String foo;
224218

219+
public Foo(String foo) {
220+
this.foo = foo;
221+
}
222+
223+
public String getFoo() {
224+
return this.foo;
225+
}
226+
227+
public void setFoo(String foo) {
228+
this.foo = foo;
229+
}
225230
}
226231

227-
@Data
228-
@AllArgsConstructor
229232
static class Bar {
230233

231234
String bar;
235+
236+
public Bar(String bar) {
237+
this.bar = bar;
238+
}
239+
240+
public String getBar() {
241+
return this.bar;
242+
}
243+
244+
public void setBar(String bar) {
245+
this.bar = bar;
246+
}
232247
}
233248

234-
@Data
235249
static class ClassWithStringId implements Serializable {
236250

237251
private static final long serialVersionUID = -7481030649267602830L;
238252
@Id String id;
239253
String value;
254+
255+
public String getId() {
256+
return id;
257+
}
258+
259+
public void setId(String id) {
260+
this.id = id;
261+
}
262+
263+
public String getValue() {
264+
return value;
265+
}
266+
267+
public void setValue(String value) {
268+
this.value = value;
269+
}
240270
}
241271

242272
@ExplicitKeySpace(name = "aliased")
243-
@Data
244273
static class ClassWithTypeAlias implements Serializable {
245274

246275
private static final long serialVersionUID = -5921943364908784571L;
@@ -250,6 +279,22 @@ static class ClassWithTypeAlias implements Serializable {
250279
ClassWithTypeAlias(String name) {
251280
this.name = name;
252281
}
282+
283+
public String getId() {
284+
return this.id;
285+
}
286+
287+
public String getName() {
288+
return this.name;
289+
}
290+
291+
public void setId(String id) {
292+
this.id = id;
293+
}
294+
295+
public void setName(String name) {
296+
this.name = name;
297+
}
253298
}
254299

255300
static class SubclassOfAliasedType extends ClassWithTypeAlias {

src/test/java/org/springframework/data/keyvalue/core/KeyValueTemplateUnitTests.java

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
import static org.assertj.core.api.Assertions.*;
1919
import static org.mockito.Mockito.*;
2020

21-
import lombok.AllArgsConstructor;
22-
import lombok.Data;
23-
2421
import java.util.Arrays;
2522
import java.util.Collection;
2623
import java.util.Collections;
@@ -34,7 +31,6 @@
3431
import org.mockito.junit.jupiter.MockitoExtension;
3532
import org.mockito.junit.jupiter.MockitoSettings;
3633
import org.mockito.quality.Strictness;
37-
3834
import org.springframework.context.ApplicationEventPublisher;
3935
import org.springframework.dao.DuplicateKeyException;
4036
import org.springframework.dao.InvalidDataAccessApiUsageException;
@@ -572,24 +568,59 @@ private final void setEventsToPublish(Class<? extends KeyValueEvent>... events)
572568
template.setEventTypesToPublish(new HashSet<>(Arrays.asList(events)));
573569
}
574570

575-
@Data
576-
@AllArgsConstructor
577571
static class Foo {
578572

579573
String foo;
574+
575+
public Foo(String foo) {
576+
this.foo = foo;
577+
}
578+
579+
public String getFoo() {
580+
return this.foo;
581+
}
582+
583+
public void setFoo(String foo) {
584+
this.foo = foo;
585+
}
580586
}
581587

582-
@Data
583-
@AllArgsConstructor
584588
class Bar {
585589

586590
String bar;
591+
592+
public Bar(String bar) {
593+
this.bar = bar;
594+
}
595+
596+
public String getBar() {
597+
return this.bar;
598+
}
599+
600+
public void setBar(String bar) {
601+
this.bar = bar;
602+
}
587603
}
588604

589-
@Data
590605
static class ClassWithStringId {
591606

592607
@Id String id;
593608
String value;
609+
610+
public String getId() {
611+
return this.id;
612+
}
613+
614+
public String getValue() {
615+
return this.value;
616+
}
617+
618+
public void setId(String id) {
619+
this.id = id;
620+
}
621+
622+
public void setValue(String value) {
623+
this.value = value;
624+
}
594625
}
595626
}

src/test/java/org/springframework/data/keyvalue/repository/SimpleKeyValueRepositoryUnitTests.java

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
import static org.mockito.ArgumentMatchers.*;
2020
import static org.mockito.Mockito.*;
2121

22-
import lombok.Data;
23-
import lombok.NoArgsConstructor;
24-
2522
import java.util.Arrays;
2623
import java.util.Optional;
2724

@@ -30,7 +27,6 @@
3027
import org.junit.jupiter.api.extension.ExtendWith;
3128
import org.mockito.Mock;
3229
import org.mockito.junit.jupiter.MockitoExtension;
33-
3430
import org.springframework.data.annotation.Id;
3531
import org.springframework.data.annotation.Persistent;
3632
import org.springframework.data.domain.PageRequest;
@@ -197,8 +193,6 @@ private <T, S> EntityInformation<T, S> getEntityInformationFor(Class<T> type) {
197193
return new PersistentEntityInformation<>(requiredPersistentEntity);
198194
}
199195

200-
@Data
201-
@NoArgsConstructor
202196
static class Foo {
203197

204198
private @Id String id;
@@ -209,12 +203,53 @@ static class Foo {
209203
Foo(String name) {
210204
this.name = name;
211205
}
206+
207+
public Foo() {}
208+
209+
public String getId() {
210+
return this.id;
211+
}
212+
213+
public Long getLongValue() {
214+
return this.longValue;
215+
}
216+
217+
public String getName() {
218+
return this.name;
219+
}
220+
221+
public Bar getBar() {
222+
return this.bar;
223+
}
224+
225+
public void setId(String id) {
226+
this.id = id;
227+
}
228+
229+
public void setLongValue(Long longValue) {
230+
this.longValue = longValue;
231+
}
232+
233+
public void setName(String name) {
234+
this.name = name;
235+
}
236+
237+
public void setBar(Bar bar) {
238+
this.bar = bar;
239+
}
212240
}
213241

214-
@Data
215242
private static class Bar {
216243

217244
private String bar;
245+
246+
public String getBar() {
247+
return this.bar;
248+
}
249+
250+
public void setBar(String bar) {
251+
this.bar = bar;
252+
}
218253
}
219254

220255
@Persistent

0 commit comments

Comments
 (0)