Search in sources :

Example 1 with StringChange

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);
}
Also used : TestActorRequestFactory(io.spine.test.TestActorRequestFactory) TenantId(io.spine.users.TenantId) Command(io.spine.base.Command) UpdateProjectName(io.spine.test.failure.command.UpdateProjectName) ProjectId(io.spine.test.failure.ProjectId) ProjectFailures(io.spine.test.failure.ProjectFailures) StringChange(io.spine.change.StringChange)

Example 2 with StringChange

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);
}
Also used : TestActorRequestFactory(io.spine.client.TestActorRequestFactory) TenantId(io.spine.core.TenantId) Command(io.spine.core.Command) ProjectRejections(io.spine.test.rejection.ProjectRejections) ProjectId(io.spine.test.rejection.ProjectId) RjUpdateProjectName(io.spine.test.rejection.command.RjUpdateProjectName) StringChange(io.spine.change.StringChange)

Aggregations

StringChange (io.spine.change.StringChange)2 Command (io.spine.base.Command)1 TestActorRequestFactory (io.spine.client.TestActorRequestFactory)1 Command (io.spine.core.Command)1 TenantId (io.spine.core.TenantId)1 TestActorRequestFactory (io.spine.test.TestActorRequestFactory)1 ProjectFailures (io.spine.test.failure.ProjectFailures)1 ProjectId (io.spine.test.failure.ProjectId)1 UpdateProjectName (io.spine.test.failure.command.UpdateProjectName)1 ProjectId (io.spine.test.rejection.ProjectId)1 ProjectRejections (io.spine.test.rejection.ProjectRejections)1 RjUpdateProjectName (io.spine.test.rejection.command.RjUpdateProjectName)1 TenantId (io.spine.users.TenantId)1