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);
}
Aggregations