@Test @DisplayName("update columns for multiple entities") void updateColumnsForMultiple() { ProjectId id1 = createId(1); ProjectId id2 = createId(2); ProjectId id3 = createId(3); TestProjectionRepository repository = repository(); TestProjection projection1 = new TestProjection(id1); TestProjection projection2 = new TestProjection(id2); TestProjection projection3 = new TestProjection(id3); repository.store(projection1); repository.store(projection2); repository.store(projection3); repository.applyMigration(ImmutableSet.of(id1, id2), new UpdateProjectionColumns<>()); QueryFilter filter1 = QueryFilter.eq(Project.Column.idString(), id1.toString()); QueryFilter filter2 = QueryFilter.eq(Project.Column.idString(), id2.toString()); QueryFilter filter3 = QueryFilter.eq(Project.Column.idString(), id3.toString()); TargetFilters filters = targetFilters(filter1, filter2, filter3); Iterator<TestProjection> found = repository.find(filters, ResponseFormat.getDefaultInstance()); ImmutableList<TestProjection> results = ImmutableList.copyOf(found); Project expectedState1 = projection1 .state() .toBuilder() .setIdString(projection1.getIdString()) .build(); Project expectedState2 = projection2 .state() .toBuilder() .setIdString(projection2.getIdString()) .build(); assertThat(results).hasSize(2); assertThat(results) .comparingElementsUsing(entityState()) .containsExactly(expectedState1, expectedState2); }
@Override public final void store(P entity) { cache.store(entity); }
ProjectionRepository extends EventDispatchingRepository<I, P, S> { @Override public final void store(P entity) { cache.store(entity); } }
ProjectionRepository extends EventDispatchingRepository<I, P, S> { @Override public final void store(P entity) { cache.store(entity); }  }
ProjectionRepository extends EventDispatchingRepository<I, P, S> { @Override public final void store(P entity) { cache.store(entity); }  @Override @OverridingMethodsMustInvokeSuper void registerWith(BoundedContext context); @OverridingMethodsMustInvokeSuper @Override P create(I id); @Override final void store(P entity); @Override final ImmutableSet<EventClass> messageClasses(); @Override final ImmutableSet<EventClass> domesticEventClasses(); @Override final ImmutableSet<EventClass> externalEventClasses(); @OverridingMethodsMustInvokeSuper @Override final boolean canDispatch(EventEnvelope event); CatchUpId catchUp(Timestamp since, @Nullable Set<I> ids); CatchUpId catchUpAll(Timestamp since); @OverridingMethodsMustInvokeSuper @Override void close(); }
ProjectionRepository extends EventDispatchingRepository<I, P, S> { @Override public final void store(P entity) { cache.store(entity); }  @Override @OverridingMethodsMustInvokeSuper void registerWith(BoundedContext context); @OverridingMethodsMustInvokeSuper @Override P create(I id); @Override final void store(P entity); @Override final ImmutableSet<EventClass> messageClasses(); @Override final ImmutableSet<EventClass> domesticEventClasses(); @Override final ImmutableSet<EventClass> externalEventClasses(); @OverridingMethodsMustInvokeSuper @Override final boolean canDispatch(EventEnvelope event); CatchUpId catchUp(Timestamp since, @Nullable Set<I> ids); CatchUpId catchUpAll(Timestamp since); @OverridingMethodsMustInvokeSuper @Override void close();  }