use of io.spine.test.aggregate.user.User in project core-java by SpineEventEngine.
the class AggregatePartShould method throw_InvalidEntityStateException_if_state_is_invalid.
@Test
public void throw_InvalidEntityStateException_if_state_is_invalid() {
final User user = User.newBuilder().setFirstName("|").setLastName("|").build();
try {
aggregatePartOfClass(AnAggregatePart.class).withRoot(root).withId(getClass().getName()).withVersion(1).withState(user).build();
fail();
} catch (InvalidEntityStateException e) {
final List<ConstraintViolation> violations = e.getError().getValidationError().getConstraintViolationList();
assertSize(user.getAllFields().size(), violations);
}
}
use of io.spine.test.aggregate.user.User in project core-java by SpineEventEngine.
the class AggregateShould method throw_InvalidEntityStateException_if_state_is_invalid.
@Test
public void throw_InvalidEntityStateException_if_state_is_invalid() {
final User user = User.newBuilder().setFirstName("|").setLastName("|").build();
try {
aggregateOfClass(UserAggregate.class).withId(getClass().getName()).withVersion(1).withState(user).build();
fail();
} catch (InvalidEntityStateException e) {
final List<ConstraintViolation> violations = e.getError().getValidationError().getConstraintViolationList();
assertSize(user.getAllFields().size(), violations);
}
}
use of io.spine.test.aggregate.user.User in project core-java by SpineEventEngine.
the class AggregateShould method update_valid_entity_state.
@Test
public void update_valid_entity_state() {
final User user = User.newBuilder().setFirstName("Fname").setLastName("Lname").build();
aggregateOfClass(UserAggregate.class).withId(getClass().getName()).withVersion(1).withState(user).build();
}
use of io.spine.test.aggregate.user.User in project core-java by SpineEventEngine.
the class AggregatePartShould method update_valid_entity_state.
@Test
public void update_valid_entity_state() {
final User user = User.newBuilder().setFirstName("Firstname").setLastName("Lastname").build();
aggregatePartOfClass(AnAggregatePart.class).withRoot(root).withId(getClass().getName()).withVersion(1).withState(user).build();
}
Aggregations