use of io.spine.test.rejection.ProjectId in project core-java by SpineEventEngine.
the class Given method missingOwnerRejection.
public static Rejection missingOwnerRejection() {
final ProjectId projectId = newProjectId();
final ProjectRejections.MissingOwner msg = ProjectRejections.MissingOwner.newBuilder().setProjectId(projectId).build();
final Command command = io.spine.server.commandbus.Given.ACommand.withMessage(Sample.messageOfType(RjRemoveOwner.class));
return Rejections.createRejection(msg, command);
}
use of io.spine.test.rejection.ProjectId in project core-java by SpineEventEngine.
the class Given method cannotModifyDeletedEntity.
public static Rejection cannotModifyDeletedEntity(Class<? extends Message> commandMessage) {
final ProjectId projectId = newProjectId();
final Any idAny = AnyPacker.pack(projectId);
final CannotModifyDeletedEntity rejectionMsg = CannotModifyDeletedEntity.newBuilder().setEntityId(idAny).build();
final Command command = io.spine.server.commandbus.Given.ACommand.withMessage(Sample.messageOfType(commandMessage));
return Rejections.createRejection(rejectionMsg, command);
}
use of io.spine.test.rejection.ProjectId 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