summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-flow/src/test
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-09-30 14:45:42 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-03 17:17:40 +0200
commit4f5a1f88d0c6aa19ce4cab0ec7b9b13a24c92fbe (patch)
tree3b3566e70fa3aa43f31a4b51e52263ec98d4e694 /opendc-simulator/opendc-simulator-flow/src/test
parentb0fc93f818e5e735e972a04f5aa49e0ebe1de181 (diff)
refactor(simulator): Remove capacity event
This change removes the Capacity entry from FlowEvent. Since the source is always pulled on a capacity change, we do not need a separate event for this.
Diffstat (limited to 'opendc-simulator/opendc-simulator-flow/src/test')
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowConsumerContextTest.kt2
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowForwarderTest.kt2
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowSinkTest.kt2
3 files changed, 3 insertions, 3 deletions
diff --git a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowConsumerContextTest.kt b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowConsumerContextTest.kt
index f1a5cbe4..fe39eb2c 100644
--- a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowConsumerContextTest.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowConsumerContextTest.kt
@@ -99,6 +99,6 @@ class FlowConsumerContextTest {
context.start()
context.capacity = 4200.0
- verify(exactly = 0) { consumer.onEvent(any(), any(), FlowEvent.Capacity) }
+ verify(exactly = 1) { consumer.onPull(any(), any(), any()) }
}
}
diff --git a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowForwarderTest.kt b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowForwarderTest.kt
index d125c638..7fae918a 100644
--- a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowForwarderTest.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowForwarderTest.kt
@@ -197,7 +197,7 @@ internal class FlowForwarderTest {
}
assertEquals(3000, clock.millis())
- verify(exactly = 1) { consumer.onEvent(any(), any(), FlowEvent.Capacity) }
+ verify(exactly = 1) { consumer.onPull(any(), any(), any()) }
}
@Test
diff --git a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowSinkTest.kt b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowSinkTest.kt
index 010a985e..5d579e5d 100644
--- a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowSinkTest.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowSinkTest.kt
@@ -67,7 +67,7 @@ internal class FlowSinkTest {
provider.capacity = 0.5
}
assertEquals(3000, clock.millis())
- verify(exactly = 1) { consumer.onEvent(any(), any(), FlowEvent.Capacity) }
+ verify(exactly = 1) { consumer.onPull(any(), any(), any()) }
}
@Test