-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#236 return default value Unspecified for the C4Location
- Loading branch information
Showing
2 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/test/kotlin/com/github/chriskn/structurizrextension/view/StructurizrCompatibilityTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.github.chriskn.structurizrextension.view | ||
|
||
import com.github.chriskn.structurizrextension.api.writeDiagrams | ||
import com.structurizr.Workspace | ||
import com.structurizr.model.Model | ||
import org.junit.jupiter.api.BeforeEach | ||
import org.junit.jupiter.api.Test | ||
import java.io.File | ||
|
||
/** | ||
* Tests the combination of models created directly from Structurizr and models created with the extension. This | ||
* is especially required as the Location has been removed from the Structurizr API and is now part of the extension. | ||
* | ||
* @see https://github.com/chriskn/structurizr-c4puml-extension/issues/236 | ||
*/ | ||
class StructurizrCompatibilityTest { | ||
|
||
private lateinit var workspace: Workspace | ||
private lateinit var model: Model | ||
|
||
@BeforeEach | ||
fun setUp() { | ||
workspace = Workspace("", "") | ||
model = workspace.model | ||
} | ||
|
||
@Test | ||
fun `addPerson can be called directly on the Structurizr Methods`() { | ||
model.addPerson("Person 1", "Description") | ||
workspace.views.createSystemLandscapeView("SystemLandscape", "Description").addAllElements() | ||
workspace.writeDiagrams(File("build/structurizr")) | ||
} | ||
|
||
@Test | ||
fun `addSoftwareSystem can be called directly on the Structurizr Methods`() { | ||
model.addSoftwareSystem("Software System") | ||
workspace.views.createSystemLandscapeView("SystemLandscape", "Description").addAllElements() | ||
workspace.writeDiagrams(File("build/structurizr")) | ||
} | ||
|
||
@Test | ||
fun `addContainer can be called directly on the Structurizr Methods`() { | ||
val softwareSystem = model.addSoftwareSystem("Software System") | ||
softwareSystem.addContainer("Container") | ||
workspace.views.createContainerView(softwareSystem, "Container", "Container").addAllElements() | ||
workspace.writeDiagrams(File("build/structurizr")) | ||
} | ||
} |