Search in sources :

Example 1 with ProjectDefinition

use of io.spine.test.aggregate.ProjectDefinition in project core-java by SpineEventEngine.

the class AggregateRootShould method have_different_cache_for_different_instances.

@Test
public void have_different_cache_for_different_instances() {
    final ProjectId projectId = ProjectId.getDefaultInstance();
    final AggregateRoot firstRoot = new ProjectRoot(boundedContext, projectId);
    final AggregateRoot secondRoot = new ProjectRoot(boundedContext, projectId);
    final AggregateRoot firstRootSpy = spy(firstRoot);
    final AggregateRoot secondRootSpy = spy(secondRoot);
    final Class<ProjectDefinition> partClass = ProjectDefinition.class;
    firstRootSpy.getPartState(partClass);
    secondRootSpy.getPartState(partClass);
    verify(firstRootSpy, times(1)).lookup(partClass);
    verify(secondRootSpy, times(1)).lookup(partClass);
}
Also used : ProjectId(io.spine.test.aggregate.ProjectId) ProjectDefinition(io.spine.test.aggregate.ProjectDefinition) Test(org.junit.Test)

Aggregations

ProjectDefinition (io.spine.test.aggregate.ProjectDefinition)1 ProjectId (io.spine.test.aggregate.ProjectId)1 Test (org.junit.Test)1