From e0856b26c3e1961e7ff4bb3ca038adc4892bbc22 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 1 Nov 2022 10:52:46 +0100 Subject: 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. --- .../test/kotlin/org/opendc/compute/service/ComputeServiceTest.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'opendc-compute/opendc-compute-service/src/test') 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(relaxUnitFun = true) + val server = mockk(relaxUnitFun = true) val listeners = mutableListOf() 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 { listeners.forEach { it.onStateChanged(host, server, ServerState.RUNNING) } } -- cgit v1.2.3