Skip to content
11 changes: 0 additions & 11 deletions packages/Ecotone/src/Lite/EcotoneLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,6 @@ private static function prepareForFlowTesting(
}
}

$aggregateAnnotation = TypeDescriptor::create(Aggregate::class);
foreach ($classesToResolve as $class) {
Assert::isTrue(is_string($class), 'Classes to resolve must be strings, instead given: ' . TypeDescriptor::createFromVariable($class)->toString());
$aggregateClass = ClassDefinition::createFor(TypeDescriptor::create($class));
if (! $aggregateClass->hasClassAnnotation($aggregateAnnotation)) {
continue;
}

$configuration = $configuration->addExtensionObject(new RegisterAggregateRepositoryChannels($aggregateClass->getClassType()->toString(), $aggregateClass->getSingleClassAnnotation($aggregateAnnotation) instanceof EventSourcingAggregate));
}

$configuration = $configuration
->withExtensionObjects(self::getExtensionObjectsWithoutTestConfiguration($configuration))
->addExtensionObject($testConfiguration);
Expand Down
8 changes: 4 additions & 4 deletions packages/Ecotone/src/Lite/Test/FlowTestSupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Ecotone\Modelling\AggregateMessage;
use Ecotone\Modelling\CommandBus;
use Ecotone\Modelling\Config\MessageBusChannel;
use Ecotone\Modelling\Config\ModellingHandlerModule;
use Ecotone\Modelling\Config\AggregrateHandlerModule;
use Ecotone\Modelling\Event;
use Ecotone\Modelling\EventBus;
use Ecotone\Modelling\QueryBus;
Expand Down Expand Up @@ -187,7 +187,7 @@ public function withEventsFor(string|object|array $identifiers, string $aggregat
AggregateMessage::RESULT_AGGREGATE_OBJECT => $aggregateClass,
AggregateMessage::RESULT_AGGREGATE_EVENTS => $events,
],
ModellingHandlerModule::getRegisterAggregateSaveRepositoryInputChannel($aggregateClass). '.test_setup_state'
AggregrateHandlerModule::getRegisterAggregateSaveRepositoryInputChannel($aggregateClass). '.test_setup_state'
);

return $this;
Expand All @@ -200,7 +200,7 @@ public function withStateFor(object $aggregate): self
[
AggregateMessage::RESULT_AGGREGATE_OBJECT => $aggregate,
],
ModellingHandlerModule::getRegisterAggregateSaveRepositoryInputChannel($aggregate::class). '.test_setup_state'
AggregrateHandlerModule::getRegisterAggregateSaveRepositoryInputChannel($aggregate::class). '.test_setup_state'
);

return $this;
Expand Down Expand Up @@ -339,7 +339,7 @@ public function getAggregate(string $className, string|int|array|object $identif
[
AggregateMessage::OVERRIDE_AGGREGATE_IDENTIFIER => is_object($identifiers) ? (string)$identifiers : $identifiers,
],
ModellingHandlerModule::getRegisterAggregateLoadRepositoryInputChannel($className)
AggregrateHandlerModule::getRegisterAggregateLoadRepositoryInputChannel($className, false)
);
}

Expand Down
10 changes: 6 additions & 4 deletions packages/Ecotone/src/Messaging/Config/ModuleClassList.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@
use Ecotone\Messaging\Handler\Logger\Config\LoggingModule;
use Ecotone\Messaging\Handler\Logger\Config\MessageHandlerLogger;
use Ecotone\Modelling\CommandBus;
use Ecotone\Modelling\Config\BusRoutingModule;
use Ecotone\Modelling\Config\MessageHandlerRoutingModule;
use Ecotone\Modelling\Config\DistributedGatewayModule;
use Ecotone\Modelling\Config\InstantRetry\InstantRetryModule;
use Ecotone\Modelling\Config\ModellingHandlerModule;
use Ecotone\Modelling\Config\AggregrateHandlerModule;
use Ecotone\Modelling\Config\ServiceHandlerModule;
use Ecotone\Modelling\EventBus;
use Ecotone\Modelling\MessageHandling\MetadataPropagator\MessageHeadersPropagatorInterceptor;
use Ecotone\Modelling\QueryBus;
Expand All @@ -67,8 +68,9 @@ class ModuleClassList
{
public const CORE_MODULES = [
DistributedGatewayModule::class,
ModellingHandlerModule::class,
BusRoutingModule::class,
AggregrateHandlerModule::class,
ServiceHandlerModule::class,
MessageHandlerRoutingModule::class,
MethodInterceptorModule::class,
MessagingCommandsModule::class,
EndpointHeadersInterceptorModule::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public function process(Message $message): Message
continue;
}

$payload = !is_object($payload) && $message->getHeaders()->containsKey(AggregateMessage::CALLED_AGGREGATE_OBJECT)
? $message->getHeaders()->get(AggregateMessage::CALLED_AGGREGATE_OBJECT)
: $payload;
$aggregateIdentifiers[$aggregateIdentifierName] =
$this->propertyReaderAccessor->hasPropertyValue(PropertyPath::createWith($aggregateIdentifierMappingName), $payload)
? $this->propertyReaderAccessor->getPropertyValue(PropertyPath::createWith($aggregateIdentifierMappingName), $payload)
Expand Down
Loading
Loading