chore(damn): detekt, build, tests, formatting
fixed detekt issues where possible. fixed disttar failing build because tools is added twice in the server module. added workflowId where required. fixed some tests not being recognized because of runBlocking without explicit return type. formatting + imports.
This commit is contained in:
+1
-1
@@ -32,4 +32,4 @@ object ConcurrencyRunner {
|
||||
done.await()
|
||||
executor.shutdown()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,4 +9,4 @@ class DeterministicBarrier(parties: Int) {
|
||||
fun await() {
|
||||
barrier.await()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,4 @@ class StageIdTest {
|
||||
|
||||
assertEquals(a, b)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,4 +29,4 @@ class TransitionIdTest {
|
||||
|
||||
assertEquals(a, b)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,4 +26,4 @@ class ValidationReportContractTest {
|
||||
|
||||
assertEquals(r1, r2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -17,6 +17,7 @@ class WorkflowGraphTest {
|
||||
@Test
|
||||
fun `graph stores immutable structure`() {
|
||||
val graph = WorkflowGraph(
|
||||
id = "workflow-test",
|
||||
stages = mapOf(s1 to StageConfig(), s2 to StageConfig()),
|
||||
transitions = setOf(
|
||||
TransitionEdge(
|
||||
@@ -39,6 +40,7 @@ class WorkflowGraphTest {
|
||||
val node = s1
|
||||
|
||||
val graph = WorkflowGraph(
|
||||
id = "workflow-test",
|
||||
stages = mapOf(node to StageConfig()),
|
||||
transitions = emptySet(),
|
||||
start = s1
|
||||
@@ -51,12 +53,14 @@ class WorkflowGraphTest {
|
||||
@Test
|
||||
fun `graph equality is structural`() {
|
||||
val g1 = WorkflowGraph(
|
||||
id = "workflow-test",
|
||||
stages = mapOf(s1 to StageConfig()),
|
||||
transitions = emptySet(),
|
||||
start = s1
|
||||
)
|
||||
|
||||
val g2 = WorkflowGraph(
|
||||
id = "workflow-test",
|
||||
stages = mapOf(s1 to StageConfig()),
|
||||
transitions = emptySet(),
|
||||
start = s1
|
||||
|
||||
+6
-1
@@ -14,11 +14,15 @@ import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class EventsTest {
|
||||
|
||||
private val workflowId = "workflow-test"
|
||||
|
||||
@Test
|
||||
fun `WorkflowStartedEvent survives round-trip`() {
|
||||
val event: EventPayload = WorkflowStartedEvent(
|
||||
sessionId = SessionId("s1"),
|
||||
startStageId = StageId("stage-a"),
|
||||
workflowId = workflowId,
|
||||
)
|
||||
|
||||
val json = eventJson.encodeToString(EventPayload.serializer(), event)
|
||||
@@ -33,6 +37,7 @@ class EventsTest {
|
||||
sessionId = SessionId("s1"),
|
||||
terminalStageId = StageId("stage-a"),
|
||||
totalStages = 1,
|
||||
workflowId = workflowId,
|
||||
)
|
||||
|
||||
val json = eventJson.encodeToString(EventPayload.serializer(), event)
|
||||
@@ -129,4 +134,4 @@ class EventsTest {
|
||||
|
||||
assertEquals(event, decoded)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user