Minor cleanup

This commit is contained in:
alex-semenyuk 2015-08-15 20:30:19 +02:00
parent 971d62568e
commit c5fc2a714e
3 changed files with 5 additions and 21 deletions

View File

@ -9,18 +9,11 @@ public class EmailAddress {
private String id;
private String value;
public EmailAddress() {
}
public EmailAddress(String value) {
this.value = value;
}
public String getId() {
return id;
}
public void setId(String id) {
public void setId(final String id) {
this.id = id;
}
@ -28,7 +21,7 @@ public class EmailAddress {
return value;
}
public void setValue(String value) {
public void setValue(final String value) {
this.value = value;
}
}

View File

@ -26,15 +26,6 @@ public class User {
@CascadeSave
private EmailAddress emailAddress;
public User() {
}
public User(String name, Integer age, String value) {
this.name = name;
this.age = age;
this.emailAddress = new EmailAddress(value);
}
public String getId() {
return id;
}

View File

@ -137,7 +137,7 @@ public class MongoTemplateQueryIntegrationTest {
@Test
public void givenUserExistsWithIndexAddedFromMapping_whenCheckingIndex_thenIndexIsExisted() {
User user = new User();
final User user = new User();
user.setName("Brendan");
EmailAddress emailAddress = new EmailAddress();
emailAddress.setValue("a@gmail.com");
@ -151,7 +151,7 @@ public class MongoTemplateQueryIntegrationTest {
@Test
public void whenSavingUserWithEmailAddress_thenUserandEmailAddressSaved() {
User user = new User();
final User user = new User();
user.setName("Brendan");
EmailAddress emailAddress = new EmailAddress();
emailAddress.setValue("b@gmail.com");
@ -163,7 +163,7 @@ public class MongoTemplateQueryIntegrationTest {
@Test
public void givenUserExistsWithIndexAddedFromCode_whenCheckingIndex_thenIndexIsExisted() {
User user = new User();
final User user = new User();
user.setName("Brendan");
mongoTemplate.indexOps(User.class).ensureIndex(new Index().on("name", Direction.ASC));
mongoTemplate.insert(user);