summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorn.christian@seime.no>2019-11-27 15:21:41 +0100
committerGitHub <noreply@github.com>2019-11-27 15:21:41 +0100
commit11789266eeeeeb5665834985c662e232147b4317 (patch)
tree43134bbee12d07ab9da3d5d95f785c2dd03c0d51 /controller-server
parent52c0f0aa8be1e4dcb2d611240f1e1df166cf0c8b (diff)
Revert "Fix bug in wire conversion"
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResult.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResultTest.java36
2 files changed, 0 insertions, 38 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResult.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResult.java
index bca7b18c284..3809bf6b400 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResult.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResult.java
@@ -74,7 +74,6 @@ class SystemFlagsDeployResult {
wireChange.targets = change.targets().stream().map(FlagsTarget::asString).collect(toList());
wireChange.data = change.data().map(FlagData::toWire).orElse(null);
wireChange.previousData = change.previousData().map(FlagData::toWire).orElse(null);
- wireResult.changes.add(wireChange);
}
wireResult.errors = new ArrayList<>();
for (OperationError error : errors) {
@@ -84,7 +83,6 @@ class SystemFlagsDeployResult {
wireError.target = error.target().asString();
wireError.flagId = error.flagId().map(FlagId::toString).orElse(null);
wireError.data = error.flagData().map(FlagData::toWire).orElse(null);
- wireResult.errors.add(wireError);
}
return wireResult;
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResultTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResultTest.java
deleted file mode 100644
index 3d8deb76a48..00000000000
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/SystemFlagsDeployResultTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.hosted.controller.restapi.systemflags;
-
-import com.yahoo.config.provision.SystemName;
-import com.yahoo.vespa.flags.FlagId;
-import com.yahoo.vespa.hosted.controller.api.systemflags.v1.FlagsTarget;
-import com.yahoo.vespa.hosted.controller.api.systemflags.v1.wire.WireSystemFlagsDeployResult;
-import org.junit.Test;
-
-import java.util.List;
-
-import static com.yahoo.vespa.hosted.controller.restapi.systemflags.SystemFlagsDeployResult.*;
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * @author bjorncs
- */
-public class SystemFlagsDeployResultTest {
- @Test
- public void changes_and_errors_are_present_in_wire_format() {
- FlagsTarget controllerTarget = FlagsTarget.forController(SystemName.cd);
- FlagId flagOne = new FlagId("flagone");
- FlagId flagTwo = new FlagId("flagtwo");
- SystemFlagsDeployResult result = new SystemFlagsDeployResult(
- List.of(
- FlagDataChange.deleted(flagOne, controllerTarget)),
- List.of(
- OperationError.deleteFailed("delete failed", controllerTarget, flagTwo)));
- WireSystemFlagsDeployResult wire = result.toWire();
-
- assertThat(wire.changes).hasSize(1);
- assertThat(wire.changes.get(0).flagId).isEqualTo(flagOne.toString());
- assertThat(wire.errors).hasSize(1);
- assertThat(wire.errors.get(0).flagId).isEqualTo(flagOne.toString());
- }
-} \ No newline at end of file