summaryrefslogtreecommitdiff
path: root/opendc-compute/opendc-compute-service/src/test
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-11-01 10:52:46 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-11-27 20:49:39 +0000
commite0856b26c3e1961e7ff4bb3ca038adc4892bbc22 (patch)
tree03b5ebc1979392170b3032b54c4a2bc606595a65 /opendc-compute/opendc-compute-service/src/test
parent6bbfbd7aeb99475308a140222316f3e9006aeec3 (diff)
refactor(compute/service): Expose state directly to clients
This change updates the implementation of the compute service to expose state to clients created by the compute service.
Diffstat (limited to 'opendc-compute/opendc-compute-service/src/test')
-rw-r--r--opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/ComputeServiceTest.kt6
1 files changed, 1 insertions, 5 deletions
diff --git a/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/ComputeServiceTest.kt b/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/ComputeServiceTest.kt
index 13b926e8..a64c0885 100644
--- a/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/ComputeServiceTest.kt
+++ b/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/ComputeServiceTest.kt
@@ -302,6 +302,7 @@ internal class ComputeServiceTest {
@Test
fun testServerInvalidType() = scope.runSimulation {
val host = mockk<Host>(relaxUnitFun = true)
+ val server = mockk<Server>(relaxUnitFun = true)
val listeners = mutableListOf<HostListener>()
every { host.uid } returns UUID.randomUUID()
@@ -312,11 +313,6 @@ internal class ComputeServiceTest {
service.addHost(host)
- val client = service.newClient()
- val flavor = client.newFlavor("test", 1, 1024)
- val image = client.newImage("test")
- val server = client.newServer("test", image, flavor, start = false)
-
assertThrows<IllegalArgumentException> {
listeners.forEach { it.onStateChanged(host, server, ServerState.RUNNING) }
}