Use the leaf withs in the test as well
@@ -796,10 +796,12 @@ public class ApplicationApiTest extends ControllerContainerTest {
clusterInfo.put(ClusterSpec.Id.from("cluster1"), new ClusterInfo("flavor1", 37, 2, 4, 50, ClusterSpec.Type.content, hostnames));
Map<ClusterSpec.Id, ClusterUtilization> clusterUtils = new HashMap<>();
clusterUtils.put(ClusterSpec.Id.from("cluster1"), new ClusterUtilization(0.3, 0.6, 0.4, 0.3));
- deployment = deployment.withClusterInfo(clusterInfo);
- deployment = deployment.withClusterUtils(clusterUtils);
- deployment = deployment.withMetrics(new DeploymentMetrics(1,2,3,4,5));
- controllerTester.controller().applications().store(lockedApplication.with(deployment));
+ DeploymentMetrics metrics = new DeploymentMetrics(1,2,3,4,5);
+
+ controllerTester.controller().applications().store(lockedApplication
+ .withClusterInfo(deployment.zone(), clusterInfo)
+ .withClusterUtilization(deployment.zone(), clusterUtils)
+ .with(deployment.zone(), metrics));
}
}
}
