summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2021-01-06 15:27:20 +0100
committerMartin Polden <mpolden@mpolden.no>2021-01-06 15:27:20 +0100
commit52b54234feff27a9ebf9dc12b93aec8ac735de46 (patch)
treeed20d0d925fe175076c229a6a4bd7ab511626d3e /controller-server
parentdfd33046d4a71a216c833d31c6eeb3c6d6a2126d (diff)
Make fields final
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/DeploymentQuotaCalculatorTest.java9
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/certificate/EndpointCertificateManagerTest.java8
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ControllerMaintainerTest.java2
4 files changed, 10 insertions, 11 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/DeploymentQuotaCalculatorTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/DeploymentQuotaCalculatorTest.java
index 4099de32e00..0a262a41138 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/DeploymentQuotaCalculatorTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/DeploymentQuotaCalculatorTest.java
@@ -8,13 +8,12 @@ import com.yahoo.vespa.hosted.controller.api.integration.billing.Quota;
import com.yahoo.vespa.hosted.controller.api.integration.noderepository.ApplicationData;
import org.junit.Test;
-import java.io.IOException;
-import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
public class DeploymentQuotaCalculatorTest {
@@ -55,7 +54,7 @@ public class DeploymentQuotaCalculatorTest {
}
@Test
- public void using_highest_resource_use() throws IOException, URISyntaxException {
+ public void using_highest_resource_use() throws Exception {
var content = new String(Files.readAllBytes(Paths.get("src/test/java/com/yahoo/vespa/hosted/controller/application/response/application.json")));
var mapper = new ObjectMapper();
var application = mapper.readValue(content, ApplicationData.class).toApplication();
@@ -69,4 +68,4 @@ public class DeploymentQuotaCalculatorTest {
var calculated = DeploymentQuotaCalculator.calculate(tenantQuota, List.of(), ApplicationId.defaultId(), ZoneId.from("test", "apac1"), DeploymentSpec.empty);
assertEquals(tenantQuota, calculated);
}
-} \ No newline at end of file
+}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/certificate/EndpointCertificateManagerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/certificate/EndpointCertificateManagerTest.java
index 7213407a236..1e3771dedb0 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/certificate/EndpointCertificateManagerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/certificate/EndpointCertificateManagerTest.java
@@ -50,7 +50,7 @@ public class EndpointCertificateManagerTest {
private final EndpointCertificateManager endpointCertificateManager =
new EndpointCertificateManager(zoneRegistryMock, mockCuratorDb, secretStore, endpointCertificateMock, clock, inMemoryFlagSource);
- private static List<String> expectedSans = List.of(
+ private static final List<String> expectedSans = List.of(
"vt2ktgkqme5zlnp4tj4ttyor7fj3v7q5o.vespa.oath.cloud",
"default.default.global.vespa.oath.cloud",
"*.default.default.global.vespa.oath.cloud",
@@ -62,17 +62,17 @@ public class EndpointCertificateManagerTest {
"*.default.default.us-east-3.staging.vespa.oath.cloud"
);
- private static List<String> expectedAdditionalSans = List.of(
+ private static final List<String> expectedAdditionalSans = List.of(
"default.default.ap-northeast-1.vespa.oath.cloud",
"*.default.default.ap-northeast-1.vespa.oath.cloud"
);
- private static List<String> expectedCombinedSans = new ArrayList<>() {{
+ private static final List<String> expectedCombinedSans = new ArrayList<>() {{
addAll(expectedSans);
addAll(expectedAdditionalSans);
}};
- private static List<String> expectedDevSans = List.of(
+ private static final List<String> expectedDevSans = List.of(
"vt2ktgkqme5zlnp4tj4ttyor7fj3v7q5o.vespa.oath.cloud",
"default.default.us-east-1.dev.vespa.oath.cloud",
"*.default.default.us-east-1.dev.vespa.oath.cloud"
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
index b73cf8e4896..ab31b7e21fe 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
@@ -88,13 +88,13 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer
private final Map<DeploymentId, List<Log>> warnings = new HashMap<>();
private final Map<DeploymentId, Set<String>> rotationNames = new HashMap<>();
private final Map<DeploymentId, List<ClusterMetrics>> clusterMetrics = new HashMap<>();
+ private final Map<DeploymentId, TestReport> testReport = new HashMap<>();
private List<ProtonMetrics> protonMetrics;
private Version lastPrepareVersion = null;
private RuntimeException prepareException = null;
private ConfigChangeActions configChangeActions = null;
private String log = "INFO - All good";
- private Map<DeploymentId, TestReport> testReport = new HashMap<>();
@Inject
public ConfigServerMock(ZoneRegistryMock zoneRegistry) {
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ControllerMaintainerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ControllerMaintainerTest.java
index 6a2feba1d47..27b4f3744e7 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ControllerMaintainerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ControllerMaintainerTest.java
@@ -44,7 +44,7 @@ public class ControllerMaintainerTest {
maintainer.run();
assertEquals(2L, consecutiveFailuresMetric());
maintainer.success = true;
- maintainer.run();;
+ maintainer.run();
assertEquals(0, consecutiveFailuresMetric());
}