Minor cleanup
This commit is contained in:
parent
971d62568e
commit
c5fc2a714e
@ -9,18 +9,11 @@ public class EmailAddress {
|
|||||||
private String id;
|
private String id;
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
public EmailAddress() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public EmailAddress(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public void setId(final String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,7 +21,7 @@ public class EmailAddress {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValue(String value) {
|
public void setValue(final String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,15 +26,6 @@ public class User {
|
|||||||
@CascadeSave
|
@CascadeSave
|
||||||
private EmailAddress emailAddress;
|
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() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ public class MongoTemplateQueryIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenUserExistsWithIndexAddedFromMapping_whenCheckingIndex_thenIndexIsExisted() {
|
public void givenUserExistsWithIndexAddedFromMapping_whenCheckingIndex_thenIndexIsExisted() {
|
||||||
User user = new User();
|
final User user = new User();
|
||||||
user.setName("Brendan");
|
user.setName("Brendan");
|
||||||
EmailAddress emailAddress = new EmailAddress();
|
EmailAddress emailAddress = new EmailAddress();
|
||||||
emailAddress.setValue("a@gmail.com");
|
emailAddress.setValue("a@gmail.com");
|
||||||
@ -151,7 +151,7 @@ public class MongoTemplateQueryIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenSavingUserWithEmailAddress_thenUserandEmailAddressSaved() {
|
public void whenSavingUserWithEmailAddress_thenUserandEmailAddressSaved() {
|
||||||
User user = new User();
|
final User user = new User();
|
||||||
user.setName("Brendan");
|
user.setName("Brendan");
|
||||||
EmailAddress emailAddress = new EmailAddress();
|
EmailAddress emailAddress = new EmailAddress();
|
||||||
emailAddress.setValue("b@gmail.com");
|
emailAddress.setValue("b@gmail.com");
|
||||||
@ -163,7 +163,7 @@ public class MongoTemplateQueryIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenUserExistsWithIndexAddedFromCode_whenCheckingIndex_thenIndexIsExisted() {
|
public void givenUserExistsWithIndexAddedFromCode_whenCheckingIndex_thenIndexIsExisted() {
|
||||||
User user = new User();
|
final User user = new User();
|
||||||
user.setName("Brendan");
|
user.setName("Brendan");
|
||||||
mongoTemplate.indexOps(User.class).ensureIndex(new Index().on("name", Direction.ASC));
|
mongoTemplate.indexOps(User.class).ensureIndex(new Index().on("name", Direction.ASC));
|
||||||
mongoTemplate.insert(user);
|
mongoTemplate.insert(user);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user