|
14 | 14 | use Ecotone\Lite\Test\FlowTestSupport; |
15 | 15 | use Ecotone\Messaging\Config\ModulePackageList; |
16 | 16 | use Ecotone\Messaging\Config\ServiceConfiguration; |
| 17 | +use Ecotone\Messaging\Config\ConfigurationException; |
17 | 18 | use Ecotone\Messaging\Endpoint\ExecutionPollingMetadata; |
18 | 19 | use Ecotone\Messaging\MessageHeaders; |
19 | 20 | use Ecotone\Modelling\Attribute\EventHandler; |
@@ -51,7 +52,6 @@ public function test_building_multi_stream_synchronous_projection(): void |
51 | 52 | $this->expectExceptionMessage('Calendar with id cal-build-1 not found'); |
52 | 53 | $ecotone->sendQueryWithRouting('getCalendar', 'cal-build-1'); |
53 | 54 |
|
54 | | - // create calendar and schedule meeting to drive projection entries |
55 | 55 | $calendarId = 'cal-build-1'; |
56 | 56 | $meetingId = 'm-build-1'; |
57 | 57 | $ecotone->sendCommand(new CreateCalendar($calendarId)); |
@@ -150,10 +150,21 @@ public function test_reset_and_delete_on_polling_multi_stream_projection(): void |
150 | 150 | $ecotone->sendQueryWithRouting('getCalendar', 'cal-poll-reset'); |
151 | 151 | } |
152 | 152 |
|
| 153 | + public function test_declaring_partitioned_multi_stream_projection_throws_exception(): void |
| 154 | + { |
| 155 | + $projection = new #[ProjectionV2(self::NAME), Partitioned(MessageHeaders::EVENT_AGGREGATE_ID), FromStream(CalendarWithInternalRecorder::class), FromStream(MeetingWithEventSourcing::class)] class () { |
| 156 | + public const NAME = 'calendar_multi_stream_projection'; |
| 157 | + }; |
| 158 | + |
| 159 | + $this->expectException(ConfigurationException::class); |
| 160 | + $this->expectExceptionMessage('Partitioned projection calendar_multi_stream_projection cannot declare multiple streams'); |
| 161 | + |
| 162 | + // Bootstrapping should fail due to invalid configuration |
| 163 | + $this->bootstrapEcotone([$projection::class], [$projection]); |
| 164 | + } |
| 165 | + |
153 | 166 | private function createMultiStreamProjection(): object |
154 | 167 | { |
155 | | - // Configure FromStream with multiple streams: Calendar/Meeting aggregates |
156 | | - // Real-world usage: projection reacts to Calendar/Meeting events to generate a read model |
157 | 168 | return new #[ProjectionV2(self::NAME), FromStream(CalendarWithInternalRecorder::class), FromStream(MeetingWithEventSourcing::class)] class () { |
158 | 169 | public const NAME = 'calendar_multi_stream_projection'; |
159 | 170 |
|
|
0 commit comments