Search in sources :

Example 1 with UpdateProjectName

use of io.spine.test.failure.command.UpdateProjectName 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)

Aggregations

Command (io.spine.base.Command)1 StringChange (io.spine.change.StringChange)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 TenantId (io.spine.users.TenantId)1