diff --git a/README.md b/README.md index 3c9896c..594dccf 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Structurizr C4-PlantUML extension aims to bridge the gap between the [structuriz ## Examples -The following examples diagrams demonstrate the additional features the Structurizr C4-PlantUML extension provides: +The following examples diagrams demonstrate the features the Structurizr C4-PlantUML provides: * links, icons and properties for elements and relationships * external containers @@ -20,6 +20,8 @@ The following examples diagrams demonstrate the additional features the Structur * differentiation between synchronous and asynchronous relationships * nested numbered parallel sequences for dynamic diagrams * advanced layout configuration for C4-PlantUML diagrams +* sprite api allowing to use the PlantUML StdLib and custom sprite definitions +* custom styles for model elements and relationships More examples can be found under `src/test/kotlin` @@ -30,110 +32,140 @@ More examples can be found under `src/test/kotlin` The following code creates and writes the example container diagram: ```kotlin -val workspace = Workspace("My Workspace", "") -val model = workspace.model -val properties = C4Properties(values = listOf(listOf("prop 1", "value 1"))) -val softwareSystem = model.softwareSystem( - name = "My Software System", - description = "system description", - link = "https://www.google.de" -) -val backendApplication = softwareSystem.container( - name = "Backend App", - description = "some backend app", - technology = "Kotlin", - tags = listOf("Tag2"), - icon = "docker", - link = "https://www.google.de", - properties = properties -) -val app = softwareSystem.container( - name = "App", - description = "android app", - technology = "Android", - icon = "android", -) -val database = softwareSystem.container( - name = "Database", - description = "some database", - c4Type = C4Type.DATABASE, - technology = "postgres", - icon = "postgresql", - usedBy = listOf(Dependency(backendApplication, "CRUD", "JPA")) -) -val broker = model.softwareSystem( - name = "Broker", - description = "Message Broker", - location = Location.External, - c4Type = C4Type.QUEUE, - icon = "kafka", -) -val topic = broker.container( - "my.topic", - "external topic", - c4Type = C4Type.QUEUE, - icon = "kafka", - usedBy = listOf( - Dependency(backendApplication, "reads topic", "Avro", interactionStyle = InteractionStyle.Asynchronous) + val workspace = Workspace("My Workspace", "") + val model = workspace.model + val properties = C4Properties(values = listOf(listOf("prop 1", "value 1"))) + val softwareSystem = model.softwareSystem( + name = "My Software System", + description = "system description", + link = "https://www.google.de" ) -) -val graphql = model.softwareSystem( - name = "GraphQL", - description = "Federated GraphQL", - location = Location.External, - icon = "graphql" -) -val internalSchema = graphql.container( - name = "Internal Schema", - description = "Schema provided by our app", - location = Location.Internal, - usedBy = listOf( - Dependency(backendApplication, "provides subgraph to"), - Dependency(app, "reuqest data using", "GraphQL", icon = "graphql", link = "https://graphql.org/") + val backendApplication = softwareSystem.container( + name = "Backend App", + description = "some backend app", + technology = "Kotlin", + tags = listOf("Tag2"), + sprite = SpriteLibrary.spriteByName("logos-docker-icon"), + link = "https://www.google.de", + properties = properties ) -) -val externalSchema = graphql.container( - name = "External Schema", - description = "Schema provided by another team", - uses = listOf(Dependency(internalSchema, "extends schema")) -) -val androidUser = model.person( - name = "Android User", - description = "some Android user", - location = Location.External, - icon = "android", - uses = listOf(Dependency(app, "uses app")) -) -val maintainer = model.person( - name = "Maintainer", - description = "some employee", - location = Location.Internal, - link = "https://www.google.de", - uses = listOf( - Dependency(backendApplication, "Admin UI", "REST") - ), - properties = properties -) - -fun createAndWriteContainerView(){ + val app = softwareSystem.container( + name = "App", + description = "android app", + technology = "Android", + sprite = SpriteLibrary.spriteByName("logos-android-icon"), + ) + val database = softwareSystem.container( + name = "Database", + description = "some database", + c4Type = C4Type.DATABASE, + technology = "postgres", + sprite = SpriteLibrary.spriteByName("logos-postgresql-img"), + usedBy = listOf( + Dependency( + destination = backendApplication, + description = "CRUD", + technology = "JPA" + ) + ) + ) + val broker = model.softwareSystem( + name = "Broker", + description = "Message Broker", + location = Location.External, + c4Type = C4Type.QUEUE, + sprite = SpriteLibrary.spriteByName("logos-kafka-icon"), + ) + val topic = broker.container( + "my.topic", + "external topic", + c4Type = C4Type.QUEUE, + sprite = SpriteLibrary.spriteByName("logos-kafka-icon"), + usedBy = listOf( + Dependency( + destination = backendApplication, + description = "reads topic", + technology = "Avro", + interactionStyle = InteractionStyle.Asynchronous + ) + ) + ) + val graphql = model.softwareSystem( + name = "GraphQL", + description = "Federated GraphQL", + location = Location.External, + sprite = SpriteLibrary.spriteByName("logos-graphql") + ) + val internalSchema = graphql.container( + name = "Internal Schema", + description = "Schema provided by our app", + location = Location.Internal, + usedBy = listOf( + Dependency( + destination = backendApplication, + description = "provides subgraph to" + ), + Dependency( + destination = app, + description = "reuqest data using", + technology = "GraphQL", + sprite = SpriteLibrary.spriteByName("logos-graphql"), + link = "https://graphql.org/" + ) + ) + ) + val externalSchema = graphql.container( + name = "External Schema", + description = "Schema provided by another team", + uses = listOf(Dependency(destination = internalSchema, description = "extends schema")) + ) + model.person( + name = "Android User", + description = "some Android user", + location = Location.External, + sprite = SpriteLibrary.spriteByName("logos-android-icon"), + uses = listOf(Dependency(destination = app, description = "uses app")) + ) + model.person( + name = "Maintainer", + description = "some employee", + location = Location.Internal, + link = "https://www.google.de", + uses = listOf( + Dependency( + destination = backendApplication, + description = "Admin UI", + technology = "REST" + ) + ), + properties = properties + ) + + val diagramKey = "ExampleContainerView" val containerView = workspace.views.containerView( - softwareSystem, - "ContainerWithBoundary", - "Example container view", - C4PlantUmlLayout( + system = softwareSystem, + key = diagramKey, + description = "example container view", + layout = C4PlantUmlLayout( legend = Legend.ShowLegend, layout = Layout.TopDown, lineType = LineType.Ortho, nodeSep = 100, rankSep = 130, dependencyConfigurations = listOf( - DependencyConfiguration(filter = { it.destination == database }, direction = Direction.Right), - DependencyConfiguration(filter = { it.destination == topic }, direction = Direction.Up) + DependencyConfiguration( + filter = { it.destination == database }, + direction = Direction.Right + ), + DependencyConfiguration( + filter = { it.destination == topic }, + direction = Direction.Up + ) ) ) ) containerView.addAllContainers() - containerView.externalSoftwareSystemBoundariesVisible = true + containerView.showExternalSoftwareSystemBoundaries = true containerView.add(topic) containerView.add(internalSchema) containerView.add(externalSchema) @@ -147,27 +179,56 @@ fun createAndWriteContainerView(){ As the following example shows, the C4-PlantUML extension provides, in addition to the parallel sequences provided by the Structurizr library, nested numbered parallel sequences for dynamic diagrams. -![Example dynamic diagram](./docs/dynamic_example_nested.svg) +![Example dynamic diagram](./docs/dynamic_example_nested.png) ```kotlin -dynamicView.add(customer, customerFrontend, "Uses") -dynamicView.add(customerFrontend, customerService, "Updates customer information using") -dynamicView.add(customerService, customerDatabase, "Stores data in") -dynamicView.add(customerService, messageBus, "Sends customer update events to") +val dynamicView: DynamicView = workspace.views.dynamicView( + system = customerInformationSystem, + key = diagramKey, + description = "This diagram shows what happens when a customer updates their details", + layout = C4PlantUmlLayout( + dependencyConfigurations = listOf( + DependencyConfiguration( + filter = { it.source == customerFrontend || it.destination == messageBus }, + direction = Right + ), + DependencyConfiguration( + filter = { it.source == customerService && it.destination == customerFrontend }, + direction = Left + ), + DependencyConfiguration( + filter = { it.source == customer }, + direction = Right + ), + DependencyConfiguration( + filter = { it.destination == customer }, + direction = Left + ) + ) + ) +) + +dynamicView.add(source = customer, destination = customerFrontend, description = "Uses") +dynamicView.add(source = customerFrontend, destination = customerService, description = "Updates customer information using") +dynamicView.add(source = customerService, destination = customerDatabase, description = "Stores data in") +dynamicView.add(source = customerService, destination = messageBus, description = "Sends customer update events to") with(dynamicView.startNestedParallelSequence()) { - add(messageBus, reportingService, "Sends customer update events to") + add(source = messageBus, destination = reportingService, description = "Sends customer update events to") with(this.startNestedParallelSequence()) { - add(reportingService, reportingDatabase, "Stores data in") + add(source = reportingService, destination = reportingDatabase, description = "Stores data in") endParallelSequence() } - add(messageBus, auditingService, "Sends customer update events to") + add(source = messageBus, destination = auditingService, description = "Sends customer update events to") with(this.startNestedParallelSequence()) { - add(auditingService, auditStore, "Stores events in") + add(source = auditingService, destination = auditStore, description = "Stores events in") endParallelSequence() } - add(customerService, customerFrontend, "Confirms update to") + add(source = customerService, destination = customerFrontend, description = "Confirms update to") endParallelSequence() } +dynamicView.add(source = customerFrontend, destination = customer, description = "Sends feedback to") + +assertExpectedDiagramWasWrittenForView(workspace, pathToExpectedDiagrams, diagramKey) ``` Dynamic diagrams can also be rendered as sequence diagram by setting the property `DynamicView.renderAsSequenceDiagram` to true. @@ -181,7 +242,7 @@ As the following example demonstrates how to model deployments and create deploy ![Example deployment diagram](./docs/deployment_example.svg) ```kotlin -val mySystem = model.softwareSystem( + val mySystem = model.softwareSystem( "System container", "Example System", Location.Internal @@ -195,22 +256,22 @@ val webApplication: Container = mySystem.container( "Web Application", "Spring Boot web application", technology = "Java and Spring MVC", - icon = "springboot" + sprite = SpriteLibrary.spriteByName("logos-spring"), ) val database: Container = mySystem.container( "Database", "Stores data", technology = "PostgreSql", - icon = "postgresql", + sprite = SpriteLibrary.spriteByName("logos-postgresql"), c4Type = C4Type.DATABASE, properties = C4Properties(values = listOf(listOf("region", "eu-central-1"))), usedBy = listOf(Dependency(webApplication, "stores data in", "JDBC")) ) val failoverDatabase: Container = mySystem.container( - "Failover Database", - database.description, + name = "Failover Database", + description = database.description, technology = database.technology, - icon = database.icon, + sprite = database.sprite, c4Type = database.c4Type, properties = C4Properties(values = listOf(listOf("region", "eu-west-1"))), usedBy = listOf(Dependency(database, "replicates data to")) @@ -218,7 +279,7 @@ val failoverDatabase: Container = mySystem.container( val aws = model.deploymentNode( "AWS", "Production AWS environment", - icon = "aws", + sprite = SpriteLibrary.spriteByName("aws-Groups-AWSCloudAlt"), properties = C4Properties( header = listOf("Property", "Value", "Description"), values = listOf( @@ -229,12 +290,12 @@ val aws = model.deploymentNode( ) aws.deploymentNode( "AWS RDS", - icon = "rds", + sprite = SpriteLibrary.spriteByName("aws-database-AuroraPostgreSQLInstance"), hostsContainers = listOf(failoverDatabase, database) ) val eks = aws.deploymentNode( "EKS cluster", - icon = "awsEKSCloud", + sprite = SpriteLibrary.spriteByName("aws-containers-EKSCloud"), ) val webAppPod = eks.deploymentNode( @@ -242,30 +303,42 @@ val webAppPod = eks.deploymentNode( "Web App POD" ).deploymentNode( "Web App container", - icon = "docker", + sprite = SpriteLibrary.spriteByName("logos-docker-img"), hostsContainers = listOf(webApplication) ) +val jaegerSprite = ( + SpriteLibrary.spriteByName("tupadr3-devicons2-jaegertracing") as PlantUmlSprite + ).copy(color = "lightblue") val jaegerSidecar = webAppPod.infrastructureNode( "Jaeger Sidecar", - "Jaeger sidecar sending Traces" + "Jaeger sidecar sending Traces", + sprite = jaegerSprite ) -model.deploymentNode( +val aws2 = model.deploymentNode( "Another AWS Account", - icon = "aws" -).deploymentNode( - "Jaeger Container", + sprite = SpriteLibrary.spriteByName("aws-groups-AWSCloudAlt") +) +val jaegerContainer = aws2.deploymentNode( + name = "Jaeger Container", + sprite = SpriteLibrary.spriteByName("logos-docker-img"), usedBy = listOf( Dependency( jaegerSidecar, "writes traces to", - interactionStyle = InteractionStyle.Asynchronous, + interactionStyle = Asynchronous, link = "https://www.jaegertracing.io/", + sprite = SpriteLibrary.spriteByName("k8s-KubernetesCronjob"), + properties = C4Properties( + header = listOf("key", "value"), + values = listOf(listOf("ip", "10.234.12.13")) + ) ) ) -).infrastructureNode("Jaeger") +) +jaegerContainer.infrastructureNode("Jaeger", sprite = jaegerSprite) val appleDevice = model.deploymentNode( "Apple Device", - icon = "apple", + sprite = SpriteLibrary.spriteByName("tupadr3-devicons-apple"), hostsSystems = listOf(iosApp) ) @@ -273,7 +346,7 @@ val loadBalancer = eks.infrastructureNode( name = "Load Balancer", description = "Nginx Load Balancer", technology = "nginx", - icon = "nginx", + sprite = SpriteLibrary.spriteByName("logos-nginx"), link = "https://www.google.de", uses = listOf(Dependency(webAppPod, "forwards requests to")), usedBy = listOf(Dependency(appleDevice, "requests data from")), @@ -283,21 +356,22 @@ val loadBalancer = eks.infrastructureNode( ) ) -val deploymentView = views.deploymentView( +val deploymentView = + views.deploymentView( mySystem, - "Deployment", + diagramKey, "A deployment diagram showing the environment.", C4PlantUmlLayout( nodeSep = 50, rankSep = 50, - layout = Layout.LeftToRight, + layout = LeftToRight, dependencyConfigurations = listOf( DependencyConfiguration( filter = { it.source == loadBalancer || it.destination.name == failoverDatabase.name }, - direction = Direction.Left + direction = Right ) ) ) diff --git a/build.gradle.kts b/build.gradle.kts index b6c33a9..a76be0c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ plugins { } group = "io.github.chriskn" -version = "0.12.1" +version = "0.13.1" java.sourceCompatibility = JavaVersion.VERSION_17 repositories { diff --git a/docs/container_example.svg b/docs/container_example.svg index 4e6defa..6c7494d 100644 --- a/docs/container_example.svg +++ b/docs/container_example.svg @@ -1 +1 @@ -My Software System - ContainersMy Software System[System]Broker[System]GraphQL[System]Backend App[Kotlin] some backend appprop 1value 1App[Android] android appDatabase[postgres] some databasemy.topic external topicExternal Schema Schema provided by anotherteamInternal Schema Schema provided by our appAndroid User some Android userMaintainer some employeeprop 1value 1uses appreuqest data using[GraphQL]CRUD[JPA]provides subgraph toreads topic[Avro]extends schemaAdmin UI[REST]Legend  person  container  external_person  external_container  system boundary(dashed)  async relationship(dashed) Example container view \ No newline at end of file +My Software System - ContainersMy Software System - ContainersBroker[system]GraphQL[system]My Software System[system]my.topic external topicExternal Schema Schema provided by anotherteamInternal Schema Schema provided by our appApp[Android] android appBackend App[Kotlin] some backend appprop 1value 1Database[postgres] some databaseAndroid User some Android userMaintainer some employeeprop 1value 1uses appreuqest data using[GraphQL]CRUD[JPA]provides subgraph toreads topic[Avro]extends schemaAdmin UI[REST]Legend  person  container  external person  external container  system boundary  async relationship (dashed) example container view \ No newline at end of file diff --git a/docs/deployment_example.svg b/docs/deployment_example.svg index 6786dd6..e52e9da 100644 --- a/docs/deployment_example.svg +++ b/docs/deployment_example.svg @@ -1 +1 @@ -System container - Deployment - DefaultAWS Production AWS environmentPropertyValueDescriptionProperty1Value1Description1Property2Value2Description2AWS RDSEKS clustermy.web.app Web App PODWeb App containerAnother AWS AccountJaeger ContainerApple DeviceDatabase[PostgreSql] Stores dataregioneu-central-1Failover Database[PostgreSql] Stores dataregioneu-west-1Load Balancer[nginx] Nginx Load BalancerPropertyvalueIP10.234.234.132Jaeger Sidecar Jaeger sidecar sending TracesWeb Application[Java and Spring MVC] Spring Boot web applicationJaegeriOS App iOS Applicationrequests data fromreplicates data towrites traces toforwards requests tostores data in[JDBC]Legend  container  external_system  node  async relationship(dashed) A deployment diagram showing the environment. \ No newline at end of file +System container - Deployment - DefaultSystem container - Deployment - DefaultAWS Production AWS environmentPropertyValueDescriptionProperty1Value1Description1Property2Value2Description2AWS RDSEKS clustermy.web.app Web App PODWeb App containerAnother AWS AccountJaeger ContainerApple DeviceDatabase[PostgreSql] Stores dataregioneu-central-1Failover Database[PostgreSql] Stores dataregioneu-west-1Load Balancer[nginx] Nginx Load BalancerPropertyvalueIP10.234.234.132Jaeger Sidecar Jaeger sidecar sending TracesWeb Application[Java and Spring MVC] Spring Boot web applicationJaegeriOS App iOS Applicationrequests data fromreplicates data towrites traces tokeyvalueip10.234.12.13forwards requests tostores data in[JDBC]Legend  container  external system  node  async relationship (dashed) A deployment diagram showing the environment. \ No newline at end of file diff --git a/docs/dynamic_example_nested.png b/docs/dynamic_example_nested.png new file mode 100644 index 0000000..ee51525 Binary files /dev/null and b/docs/dynamic_example_nested.png differ diff --git a/docs/dynamic_example_nested.svg b/docs/dynamic_example_nested.svg deleted file mode 100644 index e2152f2..0000000 --- a/docs/dynamic_example_nested.svg +++ /dev/null @@ -1,1237 +0,0 @@ -Customer Information System - DynamicCustomer A costumerCustomer FrontendApplication[Angular] Allows customers to managetheir profileCustomer Service[Java and Spring Boot] The point of access forcustomer information.Customer Database[Oracle] Stores customer informationMessage Bus[RabbitMQ] Transport for business events.Reporting Service[Ruby] Creates normalised data forreporting purposes.Reporting Database[MySql] Stores a normalised version ofall business data for ad hocreporting purposesAuditing Service[C#, Net] Provides organisation-wideauditing facilities.Audit Store[Event Store] Stores information aboutevents that have happened1: Uses2: Updates customerinformation using[JSON/HTTPS]5.3: Confirms update to[WebSocket]3: Stores data in[JDBC]4: Sends customer updateevents tofieldvalueEvent Typecreate5.1: Sends customerupdate events to5.1.1: Stores data in5.2: Sends customerupdate events to5.2.1: Stores events inLegend  person  container  async relationship(dashed) This diagram shows what happens when a customer updates their details \ No newline at end of file diff --git a/docs/dynamic_example_nested_as_sequence.svg b/docs/dynamic_example_nested_as_sequence.svg index 0e9fecf..3bf8bae 100644 --- a/docs/dynamic_example_nested_as_sequence.svg +++ b/docs/dynamic_example_nested_as_sequence.svg @@ -1 +1 @@ -Customer Information System - DynamicCustomerCustomer Frontend Application[Angular]Customer Service[Java and Spring Boot]Customer Database[Oracle]Message Bus[RabbitMQ]Reporting Service[Ruby]Reporting Database[MySql]Auditing Service[C#, Net]Audit Store[Event Store]1 Uses2 Updates customerinformation using[JSON/HTTPS]3 Stores data in[JDBC]4 Sends customer updateevents tofieldvalueEvent Typecreate5.1 Sends customerupdate events to 5.1.1Stores data in5.2 Sends customerupdate events to5.2.1 Stores events in5.3 Confirms update to[WebSocket]Legend  person  container  async relationship(last text color, last line color, dashed) This diagram shows what happens when a customer updates their details \ No newline at end of file +Customer Information System - DynamicCustomer Information System - DynamicCustomerCustomer Frontend Application[Angular]Customer Service[Java and Spring Boot]Customer Database[Oracle]Message Bus[RabbitMQ]Reporting Service[Ruby]Reporting Database[MySql]Auditing Service[C#, Net]Audit Store[Event Store]1 Uses2 Updates customerinformation using[JSON/HTTPS]3 Stores data in[JDBC]4 Sends customer updateevents tofieldvalueEvent Typecreate5.1 Sends customerupdate events to5.1.1 Stores data in5.2 Sends customerupdate events to5.2.1 Stores events in5.3 Confirms update to[WebSocket]6 Sends feedback toLegend  person  container  async relationship (dashed) This diagram shows what happens when a customer updates their details \ No newline at end of file diff --git a/src/main/kotlin/com/github/chriskn/structurizrextension/internal/export/writer/StyleWriter.kt b/src/main/kotlin/com/github/chriskn/structurizrextension/internal/export/writer/StyleWriter.kt index 3a749bd..732a944 100644 --- a/src/main/kotlin/com/github/chriskn/structurizrextension/internal/export/writer/StyleWriter.kt +++ b/src/main/kotlin/com/github/chriskn/structurizrextension/internal/export/writer/StyleWriter.kt @@ -197,11 +197,9 @@ internal object StyleWriter { if (scaleString.isBlank()) { """"$url"""" } else { - """"$url,$scaleString"""" + """"$url{$scaleString}"""" } } - - else -> throw IllegalArgumentException("Unknown sprite type ${this::class}") } private fun spriteString( diff --git a/src/main/resources/sprites/k8s_stdlib_sprites.json b/src/main/resources/sprites/k8s_stdlib_sprites.json index 1642648..a0f604f 100644 --- a/src/main/resources/sprites/k8s_stdlib_sprites.json +++ b/src/main/resources/sprites/k8s_stdlib_sprites.json @@ -1 +1,495 @@ -{"name": "Kubernetes plantuml-stdlib Sprites", "source": "https://github.com/plantuml/plantuml-stdlib/tree/master/stdlib/k8s/", "additionalIncludes": [""], "sprites": [{"@type": "PlantUmlSprite", "name": "k8s-C4", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-Common", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-Container", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-Context", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-Simplified", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesApi", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCcm", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCm", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCrb", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCrd", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCrole", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCronjob", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesDeploy", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesDs", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesEp", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesEtcd", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesGroup", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesHpa", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesIng", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesJob", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesKproxy", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesKubelet", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesLimits", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesMaster", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesNetpol", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesNode", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesNs", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesPod", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesPsp", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesPv", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesPvc", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesQuota", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesRb", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesRole", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesRs", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSa", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSc", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSched", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSecret", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSts", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSvc", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesUser", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesVol", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesApi", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCcm", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCm", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCrb", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCrd", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCrole", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesCronjob", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesDeploy", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesDs", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesEp", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesEtcd", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesGroup", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesHpa", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesIng", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesJob", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesKproxy", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesKubelet", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesLimits", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesMaster", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesNetpol", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesNode", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesNs", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesPod", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesPsp", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesPv", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesPvc", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesQuota", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesRb", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesRole", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesRs", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSa", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSc", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSched", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSecret", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSts", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesSvc", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesUser", "path": "", "color": "#66ABDD"}, {"@type": "PlantUmlSprite", "name": "k8s-KubernetesVol", "path": "", "color": "#66ABDD"}]} \ No newline at end of file +{ + "name": "Kubernetes plantuml-stdlib Sprites", + "source": "https://github.com/plantuml/plantuml-stdlib/tree/master/stdlib/k8s/", + "additionalIncludes": [ + "" + ], + "sprites": [ + { + "@type": "PlantUmlSprite", + "name": "k8s-C4", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-Common", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-Container", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-Context", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-Simplified", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesApi", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCcm", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCm", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCrb", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCrd", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCrole", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCronjob", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesDeploy", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesDs", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesEp", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesEtcd", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesGroup", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesHpa", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesIng", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesJob", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesKproxy", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesKubelet", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesLimits", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesMaster", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesNetpol", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesNode", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesNs", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesPod", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesPsp", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesPv", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesPvc", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesQuota", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesRb", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesRole", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesRs", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSa", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSc", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSched", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSecret", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSts", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSvc", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesUser", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesVol", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesApi", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCcm", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCm", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCrb", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCrd", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCrole", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesCronjob", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesDeploy", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesDs", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesEp", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesEtcd", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesGroup", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesHpa", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesIng", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesJob", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesKproxy", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesKubelet", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesLimits", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesMaster", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesNetpol", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesNode", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesNs", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesPod", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesPsp", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesPv", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesPvc", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesQuota", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesRb", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesRole", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesRs", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSa", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSc", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSched", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSecret", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSts", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesSvc", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesUser", + "path": "", + "color": "#66ABDD" + }, + { + "@type": "PlantUmlSprite", + "name": "k8s-KubernetesVol", + "path": "", + "color": "#66ABDD" + } + ] +} \ No newline at end of file diff --git a/src/test/kotlin/com/github/chriskn/structurizrextension/view/DeploymentViewTest.kt b/src/test/kotlin/com/github/chriskn/structurizrextension/view/DeploymentViewTest.kt index 0ad688e..7ab645f 100644 --- a/src/test/kotlin/com/github/chriskn/structurizrextension/view/DeploymentViewTest.kt +++ b/src/test/kotlin/com/github/chriskn/structurizrextension/view/DeploymentViewTest.kt @@ -15,6 +15,7 @@ import com.github.chriskn.structurizrextension.api.view.layout.DependencyConfigu import com.github.chriskn.structurizrextension.api.view.layout.Direction.Right import com.github.chriskn.structurizrextension.api.view.layout.Layout.LeftToRight import com.github.chriskn.structurizrextension.api.view.sprite.library.SpriteLibrary +import com.github.chriskn.structurizrextension.api.view.sprite.sprites.PlantUmlSprite import com.github.chriskn.structurizrextension.assertExpectedDiagramWasWrittenForView import com.structurizr.Workspace import com.structurizr.model.Container @@ -97,33 +98,39 @@ class DeploymentViewTest { "Web App POD" ).deploymentNode( "Web App container", - sprite = SpriteLibrary.spriteByName("logos-docker-icon"), + sprite = SpriteLibrary.spriteByName("logos-docker-img"), hostsContainers = listOf(webApplication) ) + val jaegerSprite = ( + SpriteLibrary.spriteByName("tupadr3-devicons2-jaegertracing") as PlantUmlSprite + ).copy(color = "lightblue") val jaegerSidecar = webAppPod.infrastructureNode( "Jaeger Sidecar", "Jaeger sidecar sending Traces", - sprite = SpriteLibrary.spriteByName("tupadr3-devicons2-jaegertracing") + sprite = jaegerSprite ) - model.deploymentNode( + val aws2 = model.deploymentNode( "Another AWS Account", sprite = SpriteLibrary.spriteByName("aws-groups-AWSCloudAlt") - ).deploymentNode( - "Jaeger Container", + ) + val jaegerContainer = aws2.deploymentNode( + name = "Jaeger Container", + sprite = SpriteLibrary.spriteByName("logos-docker-img"), usedBy = listOf( Dependency( jaegerSidecar, "writes traces to", interactionStyle = Asynchronous, - sprite = SpriteLibrary.spriteByName("logos-kafka-icon"), link = "https://www.jaegertracing.io/", + sprite = SpriteLibrary.spriteByName("k8s-KubernetesCronjob"), properties = C4Properties( header = listOf("key", "value"), values = listOf(listOf("ip", "10.234.12.13")) ) ) ) - ).infrastructureNode("Jaeger") + ) + jaegerContainer.infrastructureNode("Jaeger", sprite = jaegerSprite) val appleDevice = model.deploymentNode( "Apple Device", sprite = SpriteLibrary.spriteByName("tupadr3-devicons-apple"), diff --git a/src/test/kotlin/com/github/chriskn/structurizrextension/view/DynamicViewTest.kt b/src/test/kotlin/com/github/chriskn/structurizrextension/view/DynamicViewTest.kt index adcdc52..7c1a9d2 100644 --- a/src/test/kotlin/com/github/chriskn/structurizrextension/view/DynamicViewTest.kt +++ b/src/test/kotlin/com/github/chriskn/structurizrextension/view/DynamicViewTest.kt @@ -1,7 +1,8 @@ package com.github.chriskn.structurizrextension.view import com.github.chriskn.structurizrextension.api.model.C4Properties -import com.github.chriskn.structurizrextension.api.model.C4Type +import com.github.chriskn.structurizrextension.api.model.C4Type.DATABASE +import com.github.chriskn.structurizrextension.api.model.C4Type.QUEUE import com.github.chriskn.structurizrextension.api.model.Dependency import com.github.chriskn.structurizrextension.api.model.component import com.github.chriskn.structurizrextension.api.model.container @@ -18,6 +19,7 @@ import com.github.chriskn.structurizrextension.api.view.layout.Direction.Right import com.github.chriskn.structurizrextension.api.view.layout.Mode.Neighbor import com.github.chriskn.structurizrextension.api.view.showExternalBoundaries import com.github.chriskn.structurizrextension.api.view.sprite.library.SpriteLibrary +import com.github.chriskn.structurizrextension.api.view.sprite.sprites.ImageSprite import com.github.chriskn.structurizrextension.assertExpectedDiagramWasWrittenForView import com.structurizr.Workspace import com.structurizr.model.InteractionStyle.Asynchronous @@ -101,12 +103,21 @@ class DynamicViewTest { DependencyConfiguration( filter = { it.source == customerService && it.destination == customerFrontend }, direction = Left + ), + DependencyConfiguration( + filter = { it.source == customer }, + direction = Right + ), + DependencyConfiguration( + filter = { it.destination == customer }, + direction = Left ) ) ) ) configureWithNestedParallelNumbering(dynamicView) + dynamicView.renderAsSequenceDiagram = asSequenceDiagram assertExpectedDiagramWasWrittenForView(workspace, pathToExpectedDiagrams, diagramKey) @@ -282,14 +293,17 @@ class DynamicViewTest { "Customer Database", "Stores customer information", technology = "Oracle", - c4Type = C4Type.DATABASE, + sprite = SpriteLibrary.spriteByName("tupadr3-devicons2-oracle-original"), + c4Type = DATABASE, usedBy = listOf(Dependency(customerService, "", technology = "JDBC", link = "www.google.com")) ) + val rabbitMqSprite = SpriteLibrary.spriteByName("logos-rabbitmq-icon-img") as ImageSprite private val messageBus = customerInformationSystem.container( "Message Bus", "Transport for business events.", technology = "RabbitMQ", - c4Type = C4Type.QUEUE, + c4Type = QUEUE, + sprite = rabbitMqSprite.copy(scale = 0.3), usedBy = listOf( Dependency( customerService, @@ -312,8 +326,9 @@ class DynamicViewTest { "Reporting Database", "Stores a normalised version of all business data for ad hoc reporting purposes", technology = "MySql", - c4Type = C4Type.DATABASE, - usedBy = listOf(Dependency(reportingService, "", sprite = SpriteLibrary.spriteByName("tupadr3-devicons-mysql"))) + c4Type = DATABASE, + sprite = SpriteLibrary.spriteByName("tupadr3-devicons-mysql"), + usedBy = listOf(Dependency(reportingService, "")) ) private val auditingService = customerInformationSystem.container( "Auditing Service", @@ -325,7 +340,7 @@ class DynamicViewTest { "Audit Store", "Stores information about events that have happened", technology = "Event Store", - c4Type = C4Type.DATABASE, + c4Type = DATABASE, usedBy = listOf(Dependency(auditingService, "")) ) private val reportingController = reportingService.component( @@ -337,6 +352,8 @@ class DynamicViewTest { "Reporting Repository", "Reporting repository", technology = "JDBC", - usedBy = listOf(Dependency(reportingController, "")) + usedBy = listOf( + Dependency(reportingController, "", sprite = SpriteLibrary.spriteByName("tupadr3-devicons2-openapi")) + ) ) } diff --git a/src/test/kotlin/com/github/chriskn/structurizrextension/view/style/StyleIntegrationTest.kt b/src/test/kotlin/com/github/chriskn/structurizrextension/view/style/StyleIntegrationTest.kt index 4abf1f2..ee4d067 100644 --- a/src/test/kotlin/com/github/chriskn/structurizrextension/view/style/StyleIntegrationTest.kt +++ b/src/test/kotlin/com/github/chriskn/structurizrextension/view/style/StyleIntegrationTest.kt @@ -135,7 +135,7 @@ class StyleIntegrationTest { technology = "REST", c4Shape = ROUNDED_BOX, sprite = OpenIconicSprite("&compass"), - legendSprite = OpenIconicSprite("&compass"), + legendSprite = OpenIconicSprite("&compass", scale = 1.1, color = "red"), legendText = "this is a legend text" ) private val androidSprite = SpriteLibrary.spriteByName( diff --git a/src/test/resources/expected/view/deployment/Deployment.puml b/src/test/resources/expected/view/deployment/Deployment.puml index 51a4f26..60c5c5f 100644 --- a/src/test/resources/expected/view/deployment/Deployment.puml +++ b/src/test/resources/expected/view/deployment/Deployment.puml @@ -1,11 +1,12 @@ @startuml(id=Deployment) +!define GILBARBARA_PNG_URL https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.1/pngs !includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Deployment.puml !includeurl +!includeurl !includeurl !includeurl !includeurl -!includeurl -!includeurl +!includeurl !includeurl !includeurl !includeurl @@ -35,8 +36,8 @@ Node(Default.AWS, "AWS", "", "Production AWS environment", $sprite="AWSCloudAlt, } Node(Default.AWS.EKScluster, "EKS cluster", "", "", $sprite="EKSCloud,color=#ed7100") { Node(Default.AWS.EKScluster.mywebapp, "my.web.app", "", "Web App POD", "") { - Node(Default.AWS.EKScluster.mywebapp.WebAppcontainer, "Web App container", "", "", $sprite="docker-icon") { - Node(Default.AWS.EKScluster.mywebapp.WebAppcontainer.JaegerSidecar, "Jaeger Sidecar", "", "Jaeger sidecar sending Traces", $sprite="jaegertracing") + Node(Default.AWS.EKScluster.mywebapp.WebAppcontainer, "Web App container", "", "", $sprite="img:GILBARBARA_PNG_URL/docker.png") { + Node(Default.AWS.EKScluster.mywebapp.WebAppcontainer.JaegerSidecar, "Jaeger Sidecar", "", "Jaeger sidecar sending Traces", $sprite="jaegertracing,color=#add8e6") Container(Default.AWS.EKScluster.mywebapp.WebAppcontainer.WebApplication_1, "Web Application", "Java and Spring MVC", "Spring Boot web application", $sprite="spring") } } @@ -46,8 +47,8 @@ Node(Default.AWS, "AWS", "", "Production AWS environment", $sprite="AWSCloudAlt, } } Node(Default.AnotherAWSAccount, "Another AWS Account", "", "", $sprite="AWSCloudAlt,color=#232f3e") { - Node(Default.AnotherAWSAccount.JaegerContainer, "Jaeger Container", "", "", "") { - Node(Default.AnotherAWSAccount.JaegerContainer.Jaeger, "Jaeger", "", "", "") + Node(Default.AnotherAWSAccount.JaegerContainer, "Jaeger Container", "", "", $sprite="img:GILBARBARA_PNG_URL/docker.png") { + Node(Default.AnotherAWSAccount.JaegerContainer.Jaeger, "Jaeger", "", "", $sprite="jaegertracing,color=#add8e6") } } Node(Default.AppleDevice, "Apple Device", "", "", $sprite="apple") { @@ -57,7 +58,7 @@ Rel(Default.AppleDevice, Default.AWS.EKScluster.LoadBalancer, "requests data fro Rel_R(Default.AWS.AWSRDS.Database_1, Default.AWS.AWSRDS.FailoverDatabase_1, "replicates data to") SetPropertyHeader("key", "value") AddProperty("ip", "10.234.12.13") -Rel(Default.AWS.EKScluster.mywebapp.WebAppcontainer.JaegerSidecar, Default.AnotherAWSAccount.JaegerContainer, "writes traces to", $sprite="kafka-icon", $link="https://www.jaegertracing.io/", $tags="async relationship") +Rel(Default.AWS.EKScluster.mywebapp.WebAppcontainer.JaegerSidecar, Default.AnotherAWSAccount.JaegerContainer, "writes traces to", $sprite="KubernetesCronjob,color=#66abdd", $link="https://www.jaegertracing.io/", $tags="async relationship") Rel_R(Default.AWS.EKScluster.LoadBalancer, Default.AWS.EKScluster.mywebapp.WebAppcontainer, "forwards requests to") Rel(Default.AWS.EKScluster.mywebapp.WebAppcontainer.WebApplication_1, Default.AWS.AWSRDS.Database_1, "stores data in", "JDBC") diff --git a/src/test/resources/expected/view/dynamic/DynamicView.puml b/src/test/resources/expected/view/dynamic/DynamicView.puml index d12cfd4..e88ed4b 100644 --- a/src/test/resources/expected/view/dynamic/DynamicView.puml +++ b/src/test/resources/expected/view/dynamic/DynamicView.puml @@ -1,6 +1,8 @@ @startuml(id=DynamicView) +!define GILBARBARA_PNG_URL https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.1/pngs !includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Dynamic.puml !includeurl +!includeurl title Customer Information System - Dynamic caption desc @@ -13,10 +15,10 @@ AddRelTag("async relationship", $lineStyle=DashedLine(), $legendText=async relat Person(Customer, "Customer", "A costumer", "") Container(CustomerInformationSystem.CustomerFrontendApplication, "Customer Frontend Application", "Angular", "Allows customers to manage their profile", "") Container(CustomerInformationSystem.CustomerService, "Customer Service", "Java and Spring Boot", "The point of access for customer information.", "") -ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", "") -ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", "") +ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", $sprite="oracle_original") +ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", $sprite="img:GILBARBARA_PNG_URL/rabbitmq-icon.png{scale=0.3}") Container(CustomerInformationSystem.ReportingService, "Reporting Service", "Ruby", "Creates normalised data for reporting purposes.", "") -ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", "") +ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", $sprite="mysql") Container(CustomerInformationSystem.AuditingService, "Auditing Service", "C#, Net", "Provides organisation-wide auditing facilities.", "") ContainerDb(CustomerInformationSystem.AuditStore, "Audit Store", "Event Store", "Stores information about events that have happened", "") RelIndex(1,Customer, CustomerInformationSystem.CustomerFrontendApplication, "Uses") @@ -26,7 +28,7 @@ SetPropertyHeader("field", "value") AddProperty("Event Type", "create") RelIndex(4,CustomerInformationSystem.CustomerService, CustomerInformationSystem.MessageBus, "Sends customer update events to", $tags="async relationship") RelIndex(5.1,CustomerInformationSystem.MessageBus, CustomerInformationSystem.ReportingService, "Sends customer update events to", $tags="async relationship") -RelIndex(5.1.1,CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "Stores data in", $sprite="mysql") +RelIndex(5.1.1,CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "Stores data in") RelIndex(5.2,CustomerInformationSystem.MessageBus, CustomerInformationSystem.AuditingService, "Sends customer update events to", $tags="async relationship") RelIndex(5.2.1,CustomerInformationSystem.AuditingService, CustomerInformationSystem.AuditStore, "Stores events in") RelIndex(5.3,CustomerInformationSystem.CustomerService, CustomerInformationSystem.CustomerFrontendApplication, "Confirms update to", "WebSocket", $link="www.bing.com", $tags="async relationship") diff --git a/src/test/resources/expected/view/dynamic/DynamicWithBoundary.puml b/src/test/resources/expected/view/dynamic/DynamicWithBoundary.puml index 86a5c89..78084fd 100644 --- a/src/test/resources/expected/view/dynamic/DynamicWithBoundary.puml +++ b/src/test/resources/expected/view/dynamic/DynamicWithBoundary.puml @@ -1,5 +1,6 @@ @startuml(id=DynamicWithBoundary) !includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Dynamic.puml +!includeurl title Reporting Service - Dynamic caption This diagram shows what happens when a customer updates their details @@ -8,12 +9,12 @@ SHOW_PERSON_OUTLINE() LAYOUT_TOP_DOWN() System_Boundary(CustomerInformationSystem, Customer Information System) { - Container_Boundary("CustomerInformationSystem.ReportingService_boundary", "Reporting Service") { + Container_Boundary("CustomerInformationSystem.ReportingService_boundary", "Reporting Service" ){ Component(CustomerInformationSystem.ReportingService.ReportingController, "Reporting Controller", "REST", "Reporting Controller", "") Component(CustomerInformationSystem.ReportingService.ReportingRepository, "Reporting Repository", "JDBC", "Reporting repository", "") } } -RelIndex(1,CustomerInformationSystem.ReportingService.ReportingController, CustomerInformationSystem.ReportingService.ReportingRepository, "Stores entity") +RelIndex(1,CustomerInformationSystem.ReportingService.ReportingController, CustomerInformationSystem.ReportingService.ReportingRepository, "Stores entity", $sprite="openapi") SHOW_LEGEND(true) diff --git a/src/test/resources/expected/view/dynamic/DynamicWithBoundarySequence.puml b/src/test/resources/expected/view/dynamic/DynamicWithBoundarySequence.puml index e7dddda..593d256 100644 --- a/src/test/resources/expected/view/dynamic/DynamicWithBoundarySequence.puml +++ b/src/test/resources/expected/view/dynamic/DynamicWithBoundarySequence.puml @@ -1,5 +1,6 @@ @startuml(id=DynamicWithBoundarySequence) !includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Sequence.puml +!includeurl title Reporting Service - Dynamic caption This diagram shows what happens when a customer updates their details @@ -7,12 +8,12 @@ caption This diagram shows what happens when a customer updates their details SHOW_PERSON_OUTLINE() System_Boundary(CustomerInformationSystem, Customer Information System) - Container_Boundary("CustomerInformationSystem.ReportingService_boundary", "Reporting Service") + Container_Boundary("CustomerInformationSystem.ReportingService_boundary", "Reporting Service" ) Component(CustomerInformationSystem.ReportingService.ReportingController, "Reporting Controller", "REST", "Reporting Controller", "") Component(CustomerInformationSystem.ReportingService.ReportingRepository, "Reporting Repository", "JDBC", "Reporting repository", "") Boundary_End() Boundary_End() -Rel(CustomerInformationSystem.ReportingService.ReportingController, CustomerInformationSystem.ReportingService.ReportingRepository, "1 Stores entity" ) +Rel(CustomerInformationSystem.ReportingService.ReportingController, CustomerInformationSystem.ReportingService.ReportingRepository, "1 Stores entity" , $sprite="openapi") SHOW_LEGEND(true) diff --git a/src/test/resources/expected/view/dynamic/DynamicWithLayout.puml b/src/test/resources/expected/view/dynamic/DynamicWithLayout.puml index f1b7f73..cf4b55c 100644 --- a/src/test/resources/expected/view/dynamic/DynamicWithLayout.puml +++ b/src/test/resources/expected/view/dynamic/DynamicWithLayout.puml @@ -1,6 +1,8 @@ @startuml(id=DynamicWithLayout) +!define GILBARBARA_PNG_URL https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.1/pngs !includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Dynamic.puml !includeurl +!includeurl title Customer Information System - Dynamic caption This diagram shows what happens when a customer updates their details @@ -13,24 +15,24 @@ AddRelTag("async relationship", $lineStyle=DashedLine(), $legendText=async relat Person(Customer, "Customer", "A costumer", "") Container(CustomerInformationSystem.CustomerFrontendApplication, "Customer Frontend Application", "Angular", "Allows customers to manage their profile", "") Container(CustomerInformationSystem.CustomerService, "Customer Service", "Java and Spring Boot", "The point of access for customer information.", "") -ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", "") -ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", "") +ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", $sprite="oracle_original") +ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", $sprite="img:GILBARBARA_PNG_URL/rabbitmq-icon.png{scale=0.3}") Container(CustomerInformationSystem.ReportingService, "Reporting Service", "Ruby", "Creates normalised data for reporting purposes.", "") -ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", "") +ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", $sprite="mysql") Container(CustomerInformationSystem.AuditingService, "Auditing Service", "C#, Net", "Provides organisation-wide auditing facilities.", "") ContainerDb(CustomerInformationSystem.AuditStore, "Audit Store", "Event Store", "Stores information about events that have happened", "") -RelIndex(1,Customer, CustomerInformationSystem.CustomerFrontendApplication, "Uses") +RelIndex_R(1,Customer, CustomerInformationSystem.CustomerFrontendApplication, "Uses") RelIndex_R(2,CustomerInformationSystem.CustomerFrontendApplication, CustomerInformationSystem.CustomerService, "Updates customer information using", "JSON/HTTPS") RelIndex(3,CustomerInformationSystem.CustomerService, CustomerInformationSystem.CustomerDatabase, "Stores data in", "JDBC", $link="www.google.com") SetPropertyHeader("field", "value") AddProperty("Event Type", "create") RelIndex_R(4,CustomerInformationSystem.CustomerService, CustomerInformationSystem.MessageBus, "Sends customer update events to", $tags="async relationship") RelIndex(5.1,CustomerInformationSystem.MessageBus, CustomerInformationSystem.ReportingService, "Sends customer update events to", $tags="async relationship") -RelIndex(5.1.1,CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "Stores data in", $sprite="mysql") +RelIndex(5.1.1,CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "Stores data in") RelIndex(5.2,CustomerInformationSystem.MessageBus, CustomerInformationSystem.AuditingService, "Sends customer update events to", $tags="async relationship") RelIndex(5.2.1,CustomerInformationSystem.AuditingService, CustomerInformationSystem.AuditStore, "Stores events in") RelIndex_L(5.3,CustomerInformationSystem.CustomerService, CustomerInformationSystem.CustomerFrontendApplication, "Confirms update to", "WebSocket", $link="www.bing.com", $tags="async relationship") -RelIndex(6,CustomerInformationSystem.CustomerFrontendApplication, Customer, "Sends feedback to") +RelIndex_L(6,CustomerInformationSystem.CustomerFrontendApplication, Customer, "Sends feedback to") SHOW_LEGEND(true) diff --git a/src/test/resources/expected/view/dynamic/DynamicWithLayoutSequence.puml b/src/test/resources/expected/view/dynamic/DynamicWithLayoutSequence.puml index d1e8903..91d4b9f 100644 --- a/src/test/resources/expected/view/dynamic/DynamicWithLayoutSequence.puml +++ b/src/test/resources/expected/view/dynamic/DynamicWithLayoutSequence.puml @@ -1,6 +1,8 @@ @startuml(id=DynamicWithLayoutSequence) +!define GILBARBARA_PNG_URL https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.1/pngs !includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Sequence.puml !includeurl +!includeurl title Customer Information System - Dynamic caption This diagram shows what happens when a customer updates their details @@ -12,10 +14,10 @@ AddRelTag("async relationship", $lineStyle=DashedLine(), $legendText=async relat Person(Customer, "Customer", "A costumer", "") Container(CustomerInformationSystem.CustomerFrontendApplication, "Customer Frontend Application", "Angular", "Allows customers to manage their profile", "") Container(CustomerInformationSystem.CustomerService, "Customer Service", "Java and Spring Boot", "The point of access for customer information.", "") -ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", "") -ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", "") +ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", $sprite="oracle_original") +ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", $sprite="img:GILBARBARA_PNG_URL/rabbitmq-icon.png{scale=0.3}") Container(CustomerInformationSystem.ReportingService, "Reporting Service", "Ruby", "Creates normalised data for reporting purposes.", "") -ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", "") +ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", $sprite="mysql") Container(CustomerInformationSystem.AuditingService, "Auditing Service", "C#, Net", "Provides organisation-wide auditing facilities.", "") ContainerDb(CustomerInformationSystem.AuditStore, "Audit Store", "Event Store", "Stores information about events that have happened", "") Rel(Customer, CustomerInformationSystem.CustomerFrontendApplication, "1 Uses" ) @@ -25,7 +27,7 @@ SetPropertyHeader("field", "value") AddProperty("Event Type", "create") Rel(CustomerInformationSystem.CustomerService, CustomerInformationSystem.MessageBus, "4 Sends customer update events to" , $tags="async relationship") Rel(CustomerInformationSystem.MessageBus, CustomerInformationSystem.ReportingService, "5.1 Sends customer update events to" , $tags="async relationship") -Rel(CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "5.1.1 Stores data in" , $sprite="mysql") +Rel(CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "5.1.1 Stores data in" ) Rel(CustomerInformationSystem.MessageBus, CustomerInformationSystem.AuditingService, "5.2 Sends customer update events to" , $tags="async relationship") Rel(CustomerInformationSystem.AuditingService, CustomerInformationSystem.AuditStore, "5.2.1 Stores events in" ) Rel(CustomerInformationSystem.CustomerService, CustomerInformationSystem.CustomerFrontendApplication, "5.3 Confirms update to" , $techn="WebSocket", $tags="async relationship", $link="www.bing.com") diff --git a/src/test/resources/expected/view/dynamic/DynamicWithNestedParallelFlow.puml b/src/test/resources/expected/view/dynamic/DynamicWithNestedParallelFlow.puml index a6dcbe5..5be2d86 100644 --- a/src/test/resources/expected/view/dynamic/DynamicWithNestedParallelFlow.puml +++ b/src/test/resources/expected/view/dynamic/DynamicWithNestedParallelFlow.puml @@ -1,6 +1,8 @@ @startuml(id=DynamicWithNestedParallelFlow) +!define GILBARBARA_PNG_URL https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.1/pngs !includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Dynamic.puml !includeurl +!includeurl title Customer Information System - Dynamic caption This diagram shows what happens when a customer updates their details @@ -13,10 +15,10 @@ AddRelTag("async relationship", $lineStyle=DashedLine(), $legendText=async relat Person(Customer, "Customer", "A costumer", "") Container(CustomerInformationSystem.CustomerFrontendApplication, "Customer Frontend Application", "Angular", "Allows customers to manage their profile", "") Container(CustomerInformationSystem.CustomerService, "Customer Service", "Java and Spring Boot", "The point of access for customer information.", "") -ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", "") -ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", "") +ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", $sprite="oracle_original") +ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", $sprite="img:GILBARBARA_PNG_URL/rabbitmq-icon.png{scale=0.3}") Container(CustomerInformationSystem.ReportingService, "Reporting Service", "Ruby", "Creates normalised data for reporting purposes.", "") -ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", "") +ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", $sprite="mysql") Container(CustomerInformationSystem.AuditingService, "Auditing Service", "C#, Net", "Provides organisation-wide auditing facilities.", "") ContainerDb(CustomerInformationSystem.AuditStore, "Audit Store", "Event Store", "Stores information about events that have happened", "") RelIndex(1,Customer, CustomerInformationSystem.CustomerFrontendApplication, "Uses") @@ -26,7 +28,7 @@ SetPropertyHeader("field", "value") AddProperty("Event Type", "create") RelIndex(4,CustomerInformationSystem.CustomerService, CustomerInformationSystem.MessageBus, "Sends customer update events to", $tags="async relationship") RelIndex(5.1,CustomerInformationSystem.MessageBus, CustomerInformationSystem.ReportingService, "Sends customer update events to", $tags="async relationship") -RelIndex(5.1.1,CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "Stores data in", $sprite="mysql") +RelIndex(5.1.1,CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "Stores data in") RelIndex(5.2,CustomerInformationSystem.MessageBus, CustomerInformationSystem.AuditingService, "Sends customer update events to", $tags="async relationship") RelIndex(5.2.1,CustomerInformationSystem.AuditingService, CustomerInformationSystem.AuditStore, "Stores events in") RelIndex(5.3,CustomerInformationSystem.CustomerService, CustomerInformationSystem.CustomerFrontendApplication, "Confirms update to", "WebSocket", $link="www.bing.com", $tags="async relationship") diff --git a/src/test/resources/expected/view/dynamic/DynamicWithNestedParallelFlowSequence.puml b/src/test/resources/expected/view/dynamic/DynamicWithNestedParallelFlowSequence.puml index d416f12..551fe65 100644 --- a/src/test/resources/expected/view/dynamic/DynamicWithNestedParallelFlowSequence.puml +++ b/src/test/resources/expected/view/dynamic/DynamicWithNestedParallelFlowSequence.puml @@ -1,6 +1,8 @@ @startuml(id=DynamicWithNestedParallelFlowSequence) +!define GILBARBARA_PNG_URL https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.1/pngs !includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Sequence.puml !includeurl +!includeurl title Customer Information System - Dynamic caption This diagram shows what happens when a customer updates their details @@ -12,10 +14,10 @@ AddRelTag("async relationship", $lineStyle=DashedLine(), $legendText=async relat Person(Customer, "Customer", "A costumer", "") Container(CustomerInformationSystem.CustomerFrontendApplication, "Customer Frontend Application", "Angular", "Allows customers to manage their profile", "") Container(CustomerInformationSystem.CustomerService, "Customer Service", "Java and Spring Boot", "The point of access for customer information.", "") -ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", "") -ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", "") +ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", $sprite="oracle_original") +ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", $sprite="img:GILBARBARA_PNG_URL/rabbitmq-icon.png{scale=0.3}") Container(CustomerInformationSystem.ReportingService, "Reporting Service", "Ruby", "Creates normalised data for reporting purposes.", "") -ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", "") +ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", $sprite="mysql") Container(CustomerInformationSystem.AuditingService, "Auditing Service", "C#, Net", "Provides organisation-wide auditing facilities.", "") ContainerDb(CustomerInformationSystem.AuditStore, "Audit Store", "Event Store", "Stores information about events that have happened", "") Rel(Customer, CustomerInformationSystem.CustomerFrontendApplication, "1 Uses" ) @@ -25,7 +27,7 @@ SetPropertyHeader("field", "value") AddProperty("Event Type", "create") Rel(CustomerInformationSystem.CustomerService, CustomerInformationSystem.MessageBus, "4 Sends customer update events to" , $tags="async relationship") Rel(CustomerInformationSystem.MessageBus, CustomerInformationSystem.ReportingService, "5.1 Sends customer update events to" , $tags="async relationship") -Rel(CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "5.1.1 Stores data in" , $sprite="mysql") +Rel(CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "5.1.1 Stores data in" ) Rel(CustomerInformationSystem.MessageBus, CustomerInformationSystem.AuditingService, "5.2 Sends customer update events to" , $tags="async relationship") Rel(CustomerInformationSystem.AuditingService, CustomerInformationSystem.AuditStore, "5.2.1 Stores events in" ) Rel(CustomerInformationSystem.CustomerService, CustomerInformationSystem.CustomerFrontendApplication, "5.3 Confirms update to" , $techn="WebSocket", $tags="async relationship", $link="www.bing.com") diff --git a/src/test/resources/expected/view/dynamic/DynamicWithParallelFlow.puml b/src/test/resources/expected/view/dynamic/DynamicWithParallelFlow.puml index aad08c4..28c1153 100644 --- a/src/test/resources/expected/view/dynamic/DynamicWithParallelFlow.puml +++ b/src/test/resources/expected/view/dynamic/DynamicWithParallelFlow.puml @@ -1,6 +1,8 @@ @startuml(id=DynamicWithParallelFlow) +!define GILBARBARA_PNG_URL https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.1/pngs !includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Dynamic.puml !includeurl +!includeurl title Customer Information System - Dynamic caption This diagram shows what happens when a customer updates their details @@ -13,11 +15,11 @@ AddRelTag("async relationship", $lineStyle=DashedLine(), $legendText=async relat Person(Customer, "Customer", "A costumer", "") Container(CustomerInformationSystem.CustomerFrontendApplication, "Customer Frontend Application", "Angular", "Allows customers to manage their profile", "") Container(CustomerInformationSystem.CustomerService, "Customer Service", "Java and Spring Boot", "The point of access for customer information.", "") -ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", "") -ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", "") +ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", $sprite="oracle_original") +ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", $sprite="img:GILBARBARA_PNG_URL/rabbitmq-icon.png{scale=0.3}") Container(CustomerInformationSystem.ReportingService, "Reporting Service", "Ruby", "Creates normalised data for reporting purposes.", "") Container(CustomerInformationSystem.AuditingService, "Auditing Service", "C#, Net", "Provides organisation-wide auditing facilities.", "") -ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", "") +ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", $sprite="mysql") ContainerDb(CustomerInformationSystem.AuditStore, "Audit Store", "Event Store", "Stores information about events that have happened", "") RelIndex(1,Customer, CustomerInformationSystem.CustomerFrontendApplication, "Uses") RelIndex(2,CustomerInformationSystem.CustomerFrontendApplication, CustomerInformationSystem.CustomerService, "Updates customer information using", "JSON/HTTPS") @@ -28,7 +30,7 @@ RelIndex(4,CustomerInformationSystem.CustomerService, CustomerInformationSystem. RelIndex(5,CustomerInformationSystem.MessageBus, CustomerInformationSystem.ReportingService, "Sends customer update events to", $tags="async relationship") RelIndex(5,CustomerInformationSystem.MessageBus, CustomerInformationSystem.AuditingService, "Sends customer update events to", $tags="async relationship") RelIndex(5,CustomerInformationSystem.CustomerService, CustomerInformationSystem.CustomerFrontendApplication, "Confirms update to", "WebSocket", $link="www.bing.com", $tags="async relationship") -RelIndex(6,CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "Stores data in", $sprite="mysql") +RelIndex(6,CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "Stores data in") RelIndex(6,CustomerInformationSystem.AuditingService, CustomerInformationSystem.AuditStore, "Stores events in") SHOW_LEGEND(true) diff --git a/src/test/resources/expected/view/dynamic/DynamicWithParallelFlowSequence.puml b/src/test/resources/expected/view/dynamic/DynamicWithParallelFlowSequence.puml index 4f21576..78f4b74 100644 --- a/src/test/resources/expected/view/dynamic/DynamicWithParallelFlowSequence.puml +++ b/src/test/resources/expected/view/dynamic/DynamicWithParallelFlowSequence.puml @@ -1,6 +1,8 @@ @startuml(id=DynamicWithParallelFlowSequence) +!define GILBARBARA_PNG_URL https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.1/pngs !includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Sequence.puml !includeurl +!includeurl title Customer Information System - Dynamic caption This diagram shows what happens when a customer updates their details @@ -12,11 +14,11 @@ AddRelTag("async relationship", $lineStyle=DashedLine(), $legendText=async relat Person(Customer, "Customer", "A costumer", "") Container(CustomerInformationSystem.CustomerFrontendApplication, "Customer Frontend Application", "Angular", "Allows customers to manage their profile", "") Container(CustomerInformationSystem.CustomerService, "Customer Service", "Java and Spring Boot", "The point of access for customer information.", "") -ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", "") -ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", "") +ContainerDb(CustomerInformationSystem.CustomerDatabase, "Customer Database", "Oracle", "Stores customer information", $sprite="oracle_original") +ContainerQueue(CustomerInformationSystem.MessageBus, "Message Bus", "RabbitMQ", "Transport for business events.", $sprite="img:GILBARBARA_PNG_URL/rabbitmq-icon.png{scale=0.3}") Container(CustomerInformationSystem.ReportingService, "Reporting Service", "Ruby", "Creates normalised data for reporting purposes.", "") Container(CustomerInformationSystem.AuditingService, "Auditing Service", "C#, Net", "Provides organisation-wide auditing facilities.", "") -ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", "") +ContainerDb(CustomerInformationSystem.ReportingDatabase, "Reporting Database", "MySql", "Stores a normalised version of all business data for ad hoc reporting purposes", $sprite="mysql") ContainerDb(CustomerInformationSystem.AuditStore, "Audit Store", "Event Store", "Stores information about events that have happened", "") Rel(Customer, CustomerInformationSystem.CustomerFrontendApplication, "1 Uses" ) Rel(CustomerInformationSystem.CustomerFrontendApplication, CustomerInformationSystem.CustomerService, "2 Updates customer information using" , $techn="JSON/HTTPS") @@ -27,7 +29,7 @@ Rel(CustomerInformationSystem.CustomerService, CustomerInformationSystem.Message Rel(CustomerInformationSystem.MessageBus, CustomerInformationSystem.ReportingService, "5 Sends customer update events to" , $tags="async relationship") Rel(CustomerInformationSystem.MessageBus, CustomerInformationSystem.AuditingService, "5 Sends customer update events to" , $tags="async relationship") Rel(CustomerInformationSystem.CustomerService, CustomerInformationSystem.CustomerFrontendApplication, "5 Confirms update to" , $techn="WebSocket", $tags="async relationship", $link="www.bing.com") -Rel(CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "6 Stores data in" , $sprite="mysql") +Rel(CustomerInformationSystem.ReportingService, CustomerInformationSystem.ReportingDatabase, "6 Stores data in" ) Rel(CustomerInformationSystem.AuditingService, CustomerInformationSystem.AuditStore, "6 Stores events in" ) SHOW_LEGEND(true) diff --git a/src/test/resources/expected/view/style/ComponentStyleTest.puml b/src/test/resources/expected/view/style/ComponentStyleTest.puml index 045a505..134fcc0 100644 --- a/src/test/resources/expected/view/style/ComponentStyleTest.puml +++ b/src/test/resources/expected/view/style/ComponentStyleTest.puml @@ -10,7 +10,7 @@ SHOW_PERSON_OUTLINE() LAYOUT_TOP_DOWN() AddRelTag("Dependency Style", $sprite="cell_phone_android_stand_alone", $lineColor=#008000, $textColor=#aa9999, $techn=Android, $lineStyle=DottedLine(), $lineThickness=2, $legendSprite="cell_phone_android_stand_alone,scale=0.3,color=#008000", $legendText=Android user uses) -AddElementTag("Component Style", $sprite="&compass", $bgColor=#ffffff, $fontColor=#ff0000, $borderColor=#800080, $borderStyle=BoldLine(), $borderThickness=5, $shadowing=false, $shape=RoundedBoxShape(), $techn=REST, $legendSprite="&compass", $legendText=this is a legend text) +AddElementTag("Component Style", $sprite="&compass", $bgColor=#ffffff, $fontColor=#ff0000, $borderColor=#800080, $borderStyle=BoldLine(), $borderThickness=5, $shadowing=false, $shape=RoundedBoxShape(), $techn=REST, $legendSprite="&compass,scale=1.1,color=#ff0000", $legendText=this is a legend text) AddBoundaryTag("Boundary Style", $bgColor=#00ffff, $fontColor=#008000, $borderColor=#ff0000, $borderStyle=DottedLine(), $borderThickness=4, $shadowing=false, $legendText=this is a system) AddPersonTag("Person Style", $sprite="apple,scale=0.5,color=#008000", $bgColor=#00ff00, $fontColor=#0000ff, $borderColor=#ff0000, $borderStyle=DashedLine(), $borderThickness=4, $shadowing=false, $shape=EightSidedShape(), $legendText=this is a apple) diff --git a/src/test/resources/expected/view/style/SystemStyleTest.puml b/src/test/resources/expected/view/style/SystemStyleTest.puml index 66cfa3e..9b5e5e0 100644 --- a/src/test/resources/expected/view/style/SystemStyleTest.puml +++ b/src/test/resources/expected/view/style/SystemStyleTest.puml @@ -10,7 +10,7 @@ SHOW_PERSON_OUTLINE() LAYOUT_TOP_DOWN() AddRelTag("Dependency Style", $sprite="cell_phone_android_stand_alone", $lineColor=#008000, $textColor=#aa9999, $techn=Android, $lineStyle=DottedLine(), $lineThickness=2, $legendSprite="cell_phone_android_stand_alone,scale=0.3,color=#008000", $legendText=Android user uses) -AddElementTag("System Style", $sprite="img:https://plantuml.com/logo3.png,scale=0.4", $bgColor=#000000, $fontColor=#ffff00, $borderColor=#008000, $borderStyle=DashedLine(), $borderThickness=4, $shadowing=true, $shape=EightSidedShape(), $techn=Kafka, $legendSprite="&compass,scale=3.0", $legendText=this is a legend) +AddElementTag("System Style", $sprite="img:https://plantuml.com/logo3.png{scale=0.4}", $bgColor=#000000, $fontColor=#ffff00, $borderColor=#008000, $borderStyle=DashedLine(), $borderThickness=4, $shadowing=true, $shape=EightSidedShape(), $techn=Kafka, $legendSprite="&compass,scale=3.0", $legendText=this is a legend) AddPersonTag("Person Style", $sprite="apple,scale=0.5,color=#008000", $bgColor=#00ff00, $fontColor=#0000ff, $borderColor=#ff0000, $borderStyle=DashedLine(), $borderThickness=4, $shadowing=false, $shape=EightSidedShape(), $legendText=this is a apple) System(MySoftwareSystem, "My Software System", "system", "", $tags="System Style+Boundary Style")