Search in sources :

Example 1 with CannotModifyDeletedEntity

use of io.spine.server.entity.rejection.StandardRejections.CannotModifyDeletedEntity in project core-java by SpineEventEngine.

the class AggregateTestEnv method cannotModifyDeletedEntity.

public static RejectionEnvelope cannotModifyDeletedEntity(Class<? extends Message> commandMessageCls) {
    final CannotModifyDeletedEntity rejectionMsg = CannotModifyDeletedEntity.newBuilder().build();
    final Command command = io.spine.server.commandbus.Given.ACommand.withMessage(Sample.messageOfType(commandMessageCls));
    final Rejection rejection = Rejections.createRejection(rejectionMsg, command);
    return RejectionEnvelope.of(rejection);
}
Also used : Rejection(io.spine.core.Rejection) CannotModifyDeletedEntity(io.spine.server.entity.rejection.StandardRejections.CannotModifyDeletedEntity) Command(io.spine.core.Command)

Example 2 with CannotModifyDeletedEntity

use of io.spine.server.entity.rejection.StandardRejections.CannotModifyDeletedEntity 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);
}
Also used : CannotModifyDeletedEntity(io.spine.server.entity.rejection.StandardRejections.CannotModifyDeletedEntity) Command(io.spine.core.Command) ProjectId(io.spine.test.rejection.ProjectId) Any(com.google.protobuf.Any)

Aggregations

Command (io.spine.core.Command)2 CannotModifyDeletedEntity (io.spine.server.entity.rejection.StandardRejections.CannotModifyDeletedEntity)2 Any (com.google.protobuf.Any)1 Rejection (io.spine.core.Rejection)1 ProjectId (io.spine.test.rejection.ProjectId)1