Skip to content

Commit c5fc2a7

Browse files
author
alex-semenyuk
committed
Minor cleanup
1 parent 971d625 commit c5fc2a7

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

spring-data-mongodb/src/main/java/org/baeldung/model/EmailAddress.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,19 @@ public class EmailAddress {
99
private String id;
1010
private String value;
1111

12-
public EmailAddress() {
13-
}
14-
15-
public EmailAddress(String value) {
16-
this.value = value;
17-
}
18-
1912
public String getId() {
2013
return id;
2114
}
2215

23-
public void setId(String id) {
16+
public void setId(final String id) {
2417
this.id = id;
2518
}
2619

2720
public String getValue() {
2821
return value;
2922
}
3023

31-
public void setValue(String value) {
24+
public void setValue(final String value) {
3225
this.value = value;
3326
}
3427
}

spring-data-mongodb/src/main/java/org/baeldung/model/User.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ public class User {
2626
@CascadeSave
2727
private EmailAddress emailAddress;
2828

29-
public User() {
30-
}
31-
32-
public User(String name, Integer age, String value) {
33-
this.name = name;
34-
this.age = age;
35-
this.emailAddress = new EmailAddress(value);
36-
}
37-
3829
public String getId() {
3930
return id;
4031
}

spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/MongoTemplateQueryIntegrationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void givenUsersExist_whenFindingUsersAndSortThem_thenUsersAreFoundAndSort
137137

138138
@Test
139139
public void givenUserExistsWithIndexAddedFromMapping_whenCheckingIndex_thenIndexIsExisted() {
140-
User user = new User();
140+
final User user = new User();
141141
user.setName("Brendan");
142142
EmailAddress emailAddress = new EmailAddress();
143143
emailAddress.setValue("[email protected]");
@@ -151,7 +151,7 @@ public void givenUserExistsWithIndexAddedFromMapping_whenCheckingIndex_thenIndex
151151

152152
@Test
153153
public void whenSavingUserWithEmailAddress_thenUserandEmailAddressSaved() {
154-
User user = new User();
154+
final User user = new User();
155155
user.setName("Brendan");
156156
EmailAddress emailAddress = new EmailAddress();
157157
emailAddress.setValue("[email protected]");
@@ -163,7 +163,7 @@ public void whenSavingUserWithEmailAddress_thenUserandEmailAddressSaved() {
163163

164164
@Test
165165
public void givenUserExistsWithIndexAddedFromCode_whenCheckingIndex_thenIndexIsExisted() {
166-
User user = new User();
166+
final User user = new User();
167167
user.setName("Brendan");
168168
mongoTemplate.indexOps(User.class).ensureIndex(new Index().on("name", Direction.ASC));
169169
mongoTemplate.insert(user);

0 commit comments

Comments
 (0)