use of io.spine.change.StringChange in project core-java by SpineEventEngine.
the class FailureBusShould method invalidProjectNameFailure.
private static Failure invalidProjectNameFailure() {
final ProjectId projectId = ProjectId.newBuilder().setId(newUuid()).build();
final ProjectFailures.InvalidProjectName invalidProjectName = ProjectFailures.InvalidProjectName.newBuilder().setProjectId(projectId).build();
final StringChange nameChange = StringChange.newBuilder().setNewValue("Too short").build();
final UpdateProjectName updateProjectName = UpdateProjectName.newBuilder().setId(projectId).setNameUpdate(nameChange).build();
final TenantId generatedTenantId = TenantId.newBuilder().setValue(newUuid()).build();
final TestActorRequestFactory factory = TestActorRequestFactory.newInstance(FailureBusShould.class, generatedTenantId);
final Command command = factory.createCommand(updateProjectName);
return Failures.createFailure(invalidProjectName, command);
}
use of io.spine.change.StringChange in project core-java by SpineEventEngine.
the class Given method invalidProjectNameRejection.
public static Rejection invalidProjectNameRejection() {
final ProjectId projectId = newProjectId();
final ProjectRejections.InvalidProjectName invalidProjectName = ProjectRejections.InvalidProjectName.newBuilder().setProjectId(projectId).build();
final StringChange nameChange = StringChange.newBuilder().setNewValue("Too short").build();
final RjUpdateProjectName updateProjectName = RjUpdateProjectNameVBuilder.newBuilder().setId(projectId).setNameUpdate(nameChange).build();
final TenantId generatedTenantId = TenantId.newBuilder().setValue(newUuid()).build();
final TestActorRequestFactory factory = TestActorRequestFactory.newInstance(RejectionBusShould.class, generatedTenantId);
final Command command = factory.createCommand(updateProjectName);
return Rejections.createRejection(invalidProjectName, command);
}
Aggregations