Search in sources :

Example 1 with ProjectId

use of io.spine.test.integration.ProjectId in project core-java by SpineEventEngine.

the class IntegrationBusTestEnv method projectStarted.

public static Event projectStarted() {
    final ProjectId projectId = projectId();
    final TestEventFactory eventFactory = newInstance(pack(projectId), IntegrationBusTestEnv.class);
    return eventFactory.createEvent(ItgProjectStarted.newBuilder().setProjectId(projectId).build());
}
Also used : TestEventFactory(io.spine.server.command.TestEventFactory) ProjectId(io.spine.test.integration.ProjectId)

Example 2 with ProjectId

use of io.spine.test.integration.ProjectId in project core-java by SpineEventEngine.

the class IntegrationBusTestEnv method cannotStartArchivedProject.

// used to create a rejection
@SuppressWarnings("ThrowableNotThrown")
public static Rejection cannotStartArchivedProject() {
    final ProjectId projectId = projectId();
    final ItgStartProject cmdMessage = ItgStartProject.newBuilder().setProjectId(projectId).build();
    final Command startProjectCmd = toCommand(cmdMessage);
    final io.spine.test.integration.rejection.ItgCannotStartArchivedProject throwable = new io.spine.test.integration.rejection.ItgCannotStartArchivedProject(projectId);
    throwable.initProducer(AnyPacker.pack(projectId));
    final Rejection rejection = toRejection(throwable, startProjectCmd);
    return rejection;
}
Also used : Rejections.toRejection(io.spine.core.Rejections.toRejection) Rejection(io.spine.core.Rejection) ItgStartProject(io.spine.test.integration.command.ItgStartProject) Command(io.spine.core.Command) ProjectId(io.spine.test.integration.ProjectId) ItgCannotStartArchivedProject(io.spine.test.integration.rejection.IntegrationRejections.ItgCannotStartArchivedProject)

Example 3 with ProjectId

use of io.spine.test.integration.ProjectId in project core-java by SpineEventEngine.

the class IntegrationBusTestEnv method projectCreated.

public static Event projectCreated() {
    final ProjectId projectId = projectId();
    final TestEventFactory eventFactory = newInstance(pack(projectId), IntegrationBusTestEnv.class);
    return eventFactory.createEvent(ItgProjectCreated.newBuilder().setProjectId(projectId).build());
}
Also used : TestEventFactory(io.spine.server.command.TestEventFactory) ProjectId(io.spine.test.integration.ProjectId)

Aggregations

ProjectId (io.spine.test.integration.ProjectId)3 TestEventFactory (io.spine.server.command.TestEventFactory)2 Command (io.spine.core.Command)1 Rejection (io.spine.core.Rejection)1 Rejections.toRejection (io.spine.core.Rejections.toRejection)1 ItgStartProject (io.spine.test.integration.command.ItgStartProject)1 ItgCannotStartArchivedProject (io.spine.test.integration.rejection.IntegrationRejections.ItgCannotStartArchivedProject)1