Hi,
Is possible with AggregateTestFixture test 2 different Aggregate of same type?
so I have to update 2 different aggregate with same propeties, on external CommandHandler i received a command with 2 different id to update and load it with repository.load and execute a aggregate method for any aggregate.
Is possible to simulate it on test?
`
@CommandHandler
public void handle(final ChangeStationMainDataCommand command) {
validateCommandValue(command.getStationId(), command.getDraftId());
repository.load(command.getStationId())
.execute(sa -> sa.handle(command));
if (command.getMappingOneToOne()) {
if (command.isElementary()) {
final StationEntity networkStation = stationRepository.findStationByLevelAndCode(command.getDraftId(), StationType.NETWORK.id(), command.getCode())
.orElseThrow(() -> new StationNotFoundException("Network with code: " + command.getCode() + " not found in draft: " + command.getDraftId()));
repository.load(networkStation.getStationId())
.execute(sa -> sa.handle(new ChangeStationMainDataCommand(networkStation.getStationId(),
command.getDraftId(), networkStation.getLevel(), networkStation.getCode(),
command.getLongDesc(), command.getShortDesc(), command.getMappingOneToOne())));
}
if (command.isNetwork()) {
final StationEntity elementaryStation = stationRepository.findStationByLevelAndCode(command.getDraftId(), StationType.ELEMENTARY.id(), command.getCode())
.orElseThrow(() -> new StationNotFoundException("Elementary with code: " + command.getCode() + " not found in draft: " + command.getDraftId()));
repository.load(elementaryStation.getStationId())
.execute(sa -> sa.handle(new ChangeStationMainDataCommand(elementaryStation.getStationId(),
command.getDraftId(), elementaryStation.getLevel(), elementaryStation.getCode(),
command.getLongDesc(), command.getShortDesc(), command.getMappingOneToOne())));
}
}
}
`
Up my CommandHandler