@@ -294,8 +294,8 @@ public void canCreateCustomerSupplierRelationship() {
294294 assertTrue (plantUML .contains ("component [myContext1]" + System .lineSeparator ()));
295295 assertTrue (plantUML .contains ("component [myContext2]" + System .lineSeparator ()));
296296 assertTrue (plantUML .contains ("interface \" Customer-Supplier (SOAP)\" as myContext2_to_myContext1" + System .lineSeparator ()));
297- assertTrue (plantUML .contains ("[myContext1] --> myContext2_to_myContext1 : OPEN_HOST_SERVICE" + System .lineSeparator ()));
298- assertTrue (plantUML .contains ("myContext2_to_myContext1 <.. [myContext2] : use via ANTICORRUPTION_LAYER" + System .lineSeparator ()));
297+ assertTrue (plantUML .contains ("[myContext1] --> myContext2_to_myContext1 : Supplier of OPEN_HOST_SERVICE" + System .lineSeparator ()));
298+ assertTrue (plantUML .contains ("myContext2_to_myContext1 <.. [myContext2] : Customer via ANTICORRUPTION_LAYER" + System .lineSeparator ()));
299299 }
300300
301301 @ Test
@@ -314,7 +314,7 @@ public void canCreateCustomerSupplierRelationshipWithName() {
314314 relationship .setImplementationTechnology ("SOAP" );
315315 relationship .setName ("MyCS" );
316316 relationship .getUpstreamRoles ().add (UpstreamRole .OPEN_HOST_SERVICE );
317- relationship .getDownstreamRoles ().add (DownstreamRole .ANTICORRUPTION_LAYER );
317+ relationship .getDownstreamRoles ().add (DownstreamRole .CONFORMIST );
318318 contextMap .getRelationships ().add (relationship );
319319
320320 // when
@@ -324,8 +324,8 @@ public void canCreateCustomerSupplierRelationshipWithName() {
324324 assertTrue (plantUML .contains ("component [myContext1]" + System .lineSeparator ()));
325325 assertTrue (plantUML .contains ("component [myContext2]" + System .lineSeparator ()));
326326 assertTrue (plantUML .contains ("interface \" MyCS (SOAP)\" as MyCS" + System .lineSeparator ()));
327- assertTrue (plantUML .contains ("[myContext1] --> MyCS : OPEN_HOST_SERVICE" + System .lineSeparator ()));
328- assertTrue (plantUML .contains ("MyCS <.. [myContext2] : use via ANTICORRUPTION_LAYER " + System .lineSeparator ()));
327+ assertTrue (plantUML .contains ("[myContext1] --> MyCS : Supplier of OPEN_HOST_SERVICE" + System .lineSeparator ()));
328+ assertTrue (plantUML .contains ("MyCS <.. [myContext2] : Customer as CONFORMIST " + System .lineSeparator ()));
329329 }
330330
331331 @ Test
@@ -351,7 +351,7 @@ public void canCreateUpstreamDownstreamRelationshipWithoutNameAndTechnology() {
351351 assertTrue (plantUML .contains ("component [myContext2]" + System .lineSeparator ()));
352352 assertTrue (plantUML .contains ("interface \" Upstream-Downstream\" as myContext2_to_myContext1" + System .lineSeparator ()));
353353 assertTrue (plantUML .contains ("[myContext1] --> myContext2_to_myContext1" + System .lineSeparator ()));
354- assertTrue (plantUML .contains ("myContext2_to_myContext1 <.. [myContext2] : use " + System .lineSeparator ()));
354+ assertTrue (plantUML .contains ("myContext2_to_myContext1 <.. [myContext2] : consume " + System .lineSeparator ()));
355355 }
356356
357357 @ Test
@@ -390,6 +390,43 @@ public void canAddExposedAggregatesToServiceUsageLabel() {
390390 assertTrue (plantUML1 .contains ("myContext2_to_myContext1 <.. [myContext2] : use Aggregate ExposedAggregate1 " + System .lineSeparator ()));
391391 assertTrue (plantUML2 .contains ("myContext2_to_myContext1 <.. [myContext2] : use Aggregates ExposedAggregate1, ExposedAggregate2 " + System .lineSeparator ()));
392392 }
393+
394+ @ Test
395+ public void canAddExposedAggregatesToCustomerSupplierUsageLabel () {
396+ // given
397+ ContextMap contextMap = ContextMappingDSLFactory .eINSTANCE .createContextMap ();
398+ BoundedContext boundedContext1 = ContextMappingDSLFactory .eINSTANCE .createBoundedContext ();
399+ boundedContext1 .setName ("myContext1" );
400+ Aggregate aggregate1 = ContextMappingDSLFactory .eINSTANCE .createAggregate ();
401+ aggregate1 .setName ("ExposedAggregate1" );
402+ Aggregate aggregate2 = ContextMappingDSLFactory .eINSTANCE .createAggregate ();
403+ aggregate2 .setName ("ExposedAggregate2" );
404+ boundedContext1 .getAggregates ().add (aggregate1 );
405+ boundedContext1 .getAggregates ().add (aggregate2 );
406+ BoundedContext boundedContext2 = ContextMappingDSLFactory .eINSTANCE .createBoundedContext ();
407+ boundedContext2 .setName ("myContext2" );
408+ contextMap .getBoundedContexts ().add (boundedContext1 );
409+ contextMap .getBoundedContexts ().add (boundedContext2 );
410+ UpstreamDownstreamRelationship relationship = ContextMappingDSLFactory .eINSTANCE .createCustomerSupplierRelationship ();
411+ relationship .setUpstream (boundedContext1 );
412+ relationship .setDownstream (boundedContext2 );
413+ relationship .getUpstreamExposedAggregates ().add (aggregate1 );
414+ contextMap .getRelationships ().add (relationship );
415+
416+ // when
417+ String plantUML1 = this .creator .createDiagram (contextMap );
418+ relationship .getUpstreamExposedAggregates ().add (aggregate2 );
419+ this .creator = new PlantUMLComponentDiagramCreator ();
420+ String plantUML2 = this .creator .createDiagram (contextMap );
421+
422+ // then
423+ assertTrue (plantUML1 .contains ("component [myContext1]" + System .lineSeparator ()));
424+ assertTrue (plantUML1 .contains ("component [myContext2]" + System .lineSeparator ()));
425+ assertTrue (plantUML1 .contains ("interface \" Customer-Supplier\" as myContext2_to_myContext1" + System .lineSeparator ()));
426+ assertTrue (plantUML1 .contains ("[myContext1] --> myContext2_to_myContext1 : Supplier" + System .lineSeparator ()));
427+ assertTrue (plantUML1 .contains ("myContext2_to_myContext1 <.. [myContext2] : Customer of Aggregate ExposedAggregate1 " + System .lineSeparator ()));
428+ assertTrue (plantUML2 .contains ("myContext2_to_myContext1 <.. [myContext2] : Customer of Aggregates ExposedAggregate1, ExposedAggregate2 " + System .lineSeparator ()));
429+ }
393430
394431 @ Test
395432 public void createsNoteIfDiagramIsEmpty () {
0 commit comments