summaryrefslogtreecommitdiffstats
path: root/orchestrator
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2023-03-24 07:28:57 +0100
committerHarald Musum <musum@yahooinc.com>2023-03-24 07:28:57 +0100
commitd3aded0218514e6a45cd2aee4548e705095c0e90 (patch)
tree1828757164528cec99caa00496c0fdf83a766625 /orchestrator
parentbf3e82c63ae8e983bde4425c9cfa9c01bf0b8b32 (diff)
Cleanup code, no functional changes
Diffstat (limited to 'orchestrator')
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApi.java1
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java29
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ContentService.java1
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/NodeGroup.java4
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/StorageNodeImpl.java8
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java6
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostSuspensionRequestHandler.java7
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZkApplicationLock.java11
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/DummyServiceMonitor.java18
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/OrchestratorImplTest.java2
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientImplTest.java6
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientTimeoutsTest.java3
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandlerTest.java12
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandlerTest.java14
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandlerTest.java4
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/status/ZkStatusService2Test.java1
16 files changed, 44 insertions, 83 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApi.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApi.java
index 4198c572431..cb2a2fe5f62 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApi.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApi.java
@@ -34,7 +34,6 @@ public interface ClusterApi {
int percentageOfServicesDownIfGroupIsAllowedToBeDown();
Optional<StorageNode> storageNodeInGroup();
- Optional<StorageNode> upStorageNodeInGroup();
String downDescription();
}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java
index 41302a3cabb..1fb1ad4b2ff 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java
@@ -273,11 +273,6 @@ class ClusterApiImpl implements ClusterApi {
}
@Override
- public Optional<StorageNode> upStorageNodeInGroup() {
- return storageNodeInGroup(serviceInstance-> !serviceEffectivelyDown(serviceInstance));
- }
-
- @Override
public String clusterInfo() {
return "{ clusterId=" + clusterId() + ", serviceType=" + serviceType() + " }";
}
@@ -294,19 +289,15 @@ class ClusterApiImpl implements ClusterApi {
}
private boolean serviceEffectivelyDown(ServiceInstance service) throws HostStateChangeDeniedException {
- if (hostStatus(service.hostName()).isSuspended()) {
- return true;
- }
-
- switch (service.serviceStatus()) {
- case DOWN: return true;
- case UNKNOWN:
- throw new HostStateChangeDeniedException(
- nodeGroup,
- HostedVespaPolicy.UNKNOWN_SERVICE_STATUS,
- "Service status of " + service.descriptiveName() + " is not yet known");
- default:
- return false;
- }
+ if (hostStatus(service.hostName()).isSuspended()) return true;
+
+ return switch (service.serviceStatus()) {
+ case DOWN -> true;
+ case UNKNOWN -> throw new HostStateChangeDeniedException(
+ nodeGroup,
+ HostedVespaPolicy.UNKNOWN_SERVICE_STATUS,
+ "Service status of " + service.descriptiveName() + " is not yet known");
+ default -> false;
+ };
}
}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ContentService.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ContentService.java
index f611bada264..db429a77b13 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ContentService.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ContentService.java
@@ -11,4 +11,5 @@ public enum ContentService {
}
public String nameInClusterController() { return nameInClusterController; }
+
}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/NodeGroup.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/NodeGroup.java
index 9a6fc75944d..f93ee4b191f 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/NodeGroup.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/NodeGroup.java
@@ -61,8 +61,7 @@ public class NodeGroup {
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (!(o instanceof NodeGroup)) return false;
- NodeGroup nodeGroup = (NodeGroup) o;
+ if (!(o instanceof NodeGroup nodeGroup)) return false;
return Objects.equals(application, nodeGroup.application) &&
Objects.equals(hostNames, nodeGroup.hostNames);
}
@@ -71,4 +70,5 @@ public class NodeGroup {
public int hashCode() {
return Objects.hash(application, hostNames);
}
+
}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/StorageNodeImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/StorageNodeImpl.java
index 29f7700ef54..3691562dd45 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/StorageNodeImpl.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/StorageNodeImpl.java
@@ -3,7 +3,6 @@ package com.yahoo.vespa.orchestrator.model;
import com.yahoo.vespa.applicationmodel.ApplicationInstance;
import com.yahoo.vespa.applicationmodel.ClusterId;
-import com.yahoo.vespa.applicationmodel.ConfigId;
import com.yahoo.vespa.applicationmodel.HostName;
import com.yahoo.vespa.applicationmodel.ServiceInstance;
import com.yahoo.vespa.orchestrator.OrchestratorContext;
@@ -11,7 +10,6 @@ import com.yahoo.vespa.orchestrator.controller.ClusterControllerClient;
import com.yahoo.vespa.orchestrator.controller.ClusterControllerClientFactory;
import com.yahoo.vespa.orchestrator.controller.ClusterControllerNodeState;
import com.yahoo.vespa.orchestrator.policy.HostStateChangeDeniedException;
-
import java.util.List;
import java.util.Objects;
import java.util.logging.Level;
@@ -89,8 +87,7 @@ public class StorageNodeImpl implements StorageNode {
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (!(o instanceof StorageNodeImpl)) return false;
- StorageNodeImpl that = (StorageNodeImpl) o;
+ if (!(o instanceof StorageNodeImpl that)) return false;
return Objects.equals(storageService, that.storageService);
}
@@ -101,10 +98,9 @@ public class StorageNodeImpl implements StorageNode {
@Override
public int compareTo(StorageNode otherStorageNode) {
- if (!(otherStorageNode instanceof StorageNodeImpl)) {
+ if (!(otherStorageNode instanceof StorageNodeImpl that)) {
throw new IllegalArgumentException("Unable to compare our class to any StorageNode object");
}
- StorageNodeImpl that = (StorageNodeImpl) otherStorageNode;
// We're guaranteed there's only one storage service per node.
return this.storageService.hostName().compareTo(that.storageService.hostName());
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java
index 914929f9cfb..092ed531c92 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java
@@ -165,7 +165,7 @@ public class VespaModelUtil {
*/
public static int getStorageNodeIndex(ApplicationInstance application, HostName hostName) {
Optional<ServiceInstance> storageNode = getStorageNodeAtHost(application, hostName);
- if (!storageNode.isPresent()) {
+ if (storageNode.isEmpty()) {
throw new IllegalArgumentException("Failed to find a storage node for application " +
application.applicationInstanceId() + " at host " + hostName);
}
@@ -210,7 +210,7 @@ public class VespaModelUtil {
throw new IllegalArgumentException("Unable to extract cluster controller index from config ID " + configId);
}
- return Integer.valueOf(matcher.group(1));
+ return Integer.parseInt(matcher.group(1));
}
// See getStorageNodeIndex()
@@ -227,6 +227,6 @@ public class VespaModelUtil {
throw new IllegalArgumentException("Unable to extract node index from config ID " + configId);
}
- return Integer.valueOf(matcher.group(1));
+ return Integer.parseInt(matcher.group(1));
}
}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostSuspensionRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostSuspensionRequestHandler.java
index 205fea4dfcf..7e464bc41dd 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostSuspensionRequestHandler.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostSuspensionRequestHandler.java
@@ -15,11 +15,9 @@ import com.yahoo.vespa.orchestrator.BatchInternalErrorException;
import com.yahoo.vespa.orchestrator.Orchestrator;
import com.yahoo.vespa.orchestrator.policy.BatchHostStateChangeDeniedException;
import com.yahoo.vespa.orchestrator.restapi.wire.BatchOperationResult;
-
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
-import java.util.stream.Collectors;
/**
* @author hakonhall
@@ -53,10 +51,7 @@ public class HostSuspensionRequestHandler extends RestApiRequestHandler<HostSusp
List<HostName> hostnames = hostnamesAsStrings.stream().map(HostName::new).toList();
try {
orchestrator.suspendAll(parentHostname, hostnames);
- } catch (BatchHostStateChangeDeniedException e) {
- log.log(Level.FINE, e, () -> "Failed to suspend nodes " + hostnames + " with parent host " + parentHostname);
- throw createRestApiException(e.getMessage(), Response.Status.CONFLICT, e);
- } catch (UncheckedTimeoutException e) {
+ } catch (BatchHostStateChangeDeniedException | UncheckedTimeoutException e) {
log.log(Level.FINE, e, () -> "Failed to suspend nodes " + hostnames + " with parent host " + parentHostname);
throw createRestApiException(e.getMessage(), Response.Status.CONFLICT, e);
} catch (BatchHostNameNotFoundException e) {
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZkApplicationLock.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZkApplicationLock.java
index 85e9829b8de..6f863e87a42 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZkApplicationLock.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZkApplicationLock.java
@@ -2,12 +2,11 @@
package com.yahoo.vespa.orchestrator.status;
-import java.util.logging.Level;
import com.yahoo.vespa.applicationmodel.ApplicationInstanceReference;
import com.yahoo.vespa.applicationmodel.HostName;
import com.yahoo.vespa.curator.Curator;
import org.apache.zookeeper.KeeperException;
-
+import java.util.logging.Level;
import java.util.logging.Logger;
/**
@@ -67,12 +66,8 @@ class ZkApplicationLock implements ApplicationLock {
String path = statusService.applicationInstanceSuspendedPath(reference);
switch (applicationInstanceStatus) {
- case NO_REMARKS:
- deleteNode_ignoreNoNodeException(path);
- break;
- case ALLOWED_TO_BE_DOWN:
- createNode_ignoreNodeExistsException(path);
- break;
+ case NO_REMARKS -> deleteNode_ignoreNoNodeException(path);
+ case ALLOWED_TO_BE_DOWN -> createNode_ignoreNodeExistsException(path);
}
}
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/DummyServiceMonitor.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/DummyServiceMonitor.java
index 757e6a1bf70..853dc17a3fc 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/DummyServiceMonitor.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/DummyServiceMonitor.java
@@ -19,10 +19,8 @@ import com.yahoo.vespa.service.monitor.AntiServiceMonitor;
import com.yahoo.vespa.service.monitor.CriticalRegion;
import com.yahoo.vespa.service.monitor.ServiceModel;
import com.yahoo.vespa.service.monitor.ServiceMonitor;
-
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
@@ -168,15 +166,13 @@ public class DummyServiceMonitor implements ServiceMonitor, AntiServiceMonitor {
}
public static Set<HostName> getContentHosts(ApplicationInstanceReference appRef) {
- Set<HostName> hosts = apps.stream()
- .filter(application -> application.reference().equals(appRef))
- .flatMap(appReference -> appReference.serviceClusters().stream())
- .filter(VespaModelUtil::isContent)
- .flatMap(serviceCluster -> serviceCluster.serviceInstances().stream())
- .map(ServiceInstance::hostName)
- .collect(Collectors.toSet());
-
- return hosts;
+ return apps.stream()
+ .filter(application -> application.reference().equals(appRef))
+ .flatMap(appReference -> appReference.serviceClusters().stream())
+ .filter(VespaModelUtil::isContent)
+ .flatMap(serviceCluster -> serviceCluster.serviceInstances().stream())
+ .map(ServiceInstance::hostName)
+ .collect(Collectors.toSet());
}
public static List<ApplicationInstance> getApplications() {
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/OrchestratorImplTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/OrchestratorImplTest.java
index 9fd7b9dade9..70a8381c9ac 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/OrchestratorImplTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/OrchestratorImplTest.java
@@ -404,7 +404,7 @@ public class OrchestratorImplTest {
}
@Test
- public void testIsQuiescent() throws Exception {
+ public void testIsQuiescent() {
StatusService statusService = new ZkStatusService(new MockCurator(),
mock(Metric.class),
new TestTimer(),
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientImplTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientImplTest.java
index 81615f59be9..fa8b0fbc7eb 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientImplTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientImplTest.java
@@ -23,12 +23,6 @@ import static com.yahoo.vespa.orchestrator.controller.ClusterControllerNodeState
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
/**
* @author jonmv
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientTimeoutsTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientTimeoutsTest.java
index 9a34ddc7d64..93d8d9adc8a 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientTimeoutsTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientTimeoutsTest.java
@@ -29,12 +29,11 @@ public class ClusterControllerClientTimeoutsTest {
private final ManualClock clock = new ManualClock();
private Duration originalTimeout;
- private TimeBudget timeBudget;
private ClusterControllerClientTimeouts timeouts;
private void makeTimeouts(Duration originalTimeout) {
this.originalTimeout = originalTimeout;
- this.timeBudget = TimeBudget.from(clock, clock.instant(), Optional.of(originalTimeout));
+ TimeBudget timeBudget = TimeBudget.from(clock, clock.instant(), Optional.of(originalTimeout));
this.timeouts = new ClusterControllerClientTimeouts(timeBudget);
}
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandlerTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandlerTest.java
index 1a89c1a4ab4..021cea6cd5c 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandlerTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandlerTest.java
@@ -19,9 +19,7 @@ import com.yahoo.vespa.orchestrator.controller.ClusterControllerClientFactoryMoc
import com.yahoo.vespa.orchestrator.status.ZkStatusService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-
import java.io.ByteArrayInputStream;
-import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Set;
@@ -57,7 +55,7 @@ class ApplicationSuspensionRequestHandlerTest {
@Test
- void get_all_suspended_applications_return_empty_list_initially() throws IOException {
+ void get_all_suspended_applications_return_empty_list_initially() {
HttpResponse httpResponse = executeRequest(Method.GET, "", null);
assertEquals(200, httpResponse.getStatus());
Set<String> set = parseResponseContent(httpResponse, new TypeReference<>() {});
@@ -65,13 +63,13 @@ class ApplicationSuspensionRequestHandlerTest {
}
@Test
- void invalid_application_id_throws_http_400() throws IOException {
+ void invalid_application_id_throws_http_400() {
HttpResponse httpResponse = executeRequest(Method.POST, "", INVALID_RESOURCE_NAME);
assertEquals(400, httpResponse.getStatus());
}
@Test
- void get_application_status_returns_404_for_not_suspended_and_204_for_suspended() throws IOException {
+ void get_application_status_returns_404_for_not_suspended_and_204_for_suspended() {
// Get on application that is not suspended
HttpResponse httpResponse = executeRequest(Method.GET, "/"+RESOURCE_1, null);
assertEquals(404, httpResponse.getStatus());
@@ -86,7 +84,7 @@ class ApplicationSuspensionRequestHandlerTest {
}
@Test
- void delete_works_on_suspended_and_not_suspended_applications() throws IOException {
+ void delete_works_on_suspended_and_not_suspended_applications() {
// Delete an application that is not suspended
HttpResponse httpResponse = executeRequest(Method.DELETE, "/"+RESOURCE_1, null);
assertEquals(204, httpResponse.getStatus());
@@ -109,7 +107,7 @@ class ApplicationSuspensionRequestHandlerTest {
}
@Test
- void list_applications_returns_the_correct_list_of_suspended_applications() throws IOException {
+ void list_applications_returns_the_correct_list_of_suspended_applications() {
// Test that initially we have the empty set
HttpResponse httpResponse = executeRequest(Method.GET, "", null);
assertEquals(200, httpResponse.getStatus());
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandlerTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandlerTest.java
index 242c8e5b495..b9dab4b3aeb 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandlerTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandlerTest.java
@@ -167,7 +167,7 @@ class HostRequestHandlerTest {
}
@Test
- void returns_200_on_success() throws IOException {
+ void returns_200_on_success() {
RestApiTestDriver testDriver = createTestDriver(alwaysAllowOrchestrator);
HttpResponse response = executeRequest(testDriver, Method.PUT, "/orchestrator/v1/hosts/hostname/suspended", null);
@@ -176,7 +176,7 @@ class HostRequestHandlerTest {
}
@Test
- void throws_404_when_host_unknown() throws IOException {
+ void throws_404_when_host_unknown() {
RestApiTestDriver testDriver = createTestDriver(hostNotFoundOrchestrator);
HttpResponse response = executeRequest(testDriver, Method.PUT, "/orchestrator/v1/hosts/hostname/suspended", null);
@@ -216,7 +216,7 @@ class HostRequestHandlerTest {
}
@Test
- void throws_409_when_request_rejected_by_policies() throws IOException {
+ void throws_409_when_request_rejected_by_policies() {
RestApiTestDriver testDriver = createTestDriver(alwaysRejectOrchestrator);
HttpResponse response = executeRequest(testDriver, Method.PUT, "/orchestrator/v1/hosts/hostname/suspended", null);
@@ -224,7 +224,7 @@ class HostRequestHandlerTest {
}
@Test
- void patch_state_may_throw_bad_request() throws IOException {
+ void patch_state_may_throw_bad_request() {
Orchestrator orchestrator = mock(Orchestrator.class);
RestApiTestDriver testDriver = createTestDriver(orchestrator);
@@ -236,7 +236,7 @@ class HostRequestHandlerTest {
}
@Test
- void patch_works() throws OrchestrationException, IOException {
+ void patch_works() throws OrchestrationException {
Orchestrator orchestrator = mock(Orchestrator.class);
RestApiTestDriver testDriver = createTestDriver(orchestrator);
@@ -251,7 +251,7 @@ class HostRequestHandlerTest {
}
@Test
- void patch_handles_exception_in_orchestrator() throws OrchestrationException, IOException {
+ void patch_handles_exception_in_orchestrator() throws OrchestrationException {
Orchestrator orchestrator = mock(Orchestrator.class);
RestApiTestDriver testDriver = createTestDriver(orchestrator);
@@ -265,7 +265,7 @@ class HostRequestHandlerTest {
}
@Test
- void getHost_works() throws Exception {
+ void getHost_works() {
Orchestrator orchestrator = mock(Orchestrator.class);
RestApiTestDriver testDriver = createTestDriver(orchestrator);
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandlerTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandlerTest.java
index d8bc0a91b87..a72afe8ba46 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandlerTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandlerTest.java
@@ -17,8 +17,6 @@ import com.yahoo.vespa.orchestrator.restapi.wire.SlobrokEntryResponse;
import com.yahoo.vespa.service.manager.UnionMonitorManager;
import com.yahoo.vespa.service.monitor.SlobrokApi;
import org.junit.jupiter.api.Test;
-
-import java.io.IOException;
import java.util.Arrays;
import java.util.List;
@@ -58,7 +56,7 @@ class InstanceRequestHandlerTest {
}
@Test
- void testGetServiceStatusInfo() throws IOException {
+ void testGetServiceStatusInfo() {
ServiceType serviceType = new ServiceType("serviceType");
ConfigId configId = new ConfigId("configId");
ServiceStatus serviceStatus = ServiceStatus.UP;
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/status/ZkStatusService2Test.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/status/ZkStatusService2Test.java
index e6898667b49..a107eceeaa3 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/status/ZkStatusService2Test.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/status/ZkStatusService2Test.java
@@ -85,7 +85,6 @@ public class ZkStatusService2Test {
verify(mutex, times(2)).acquire(anyLong(), any());
verify(mutex, times(2)).release();
- ArgumentCaptor<Runnable> runnableCaptor = ArgumentCaptor.forClass(Runnable.class);
verify(context, times(2)).hasLock(any());
verify(context, times(2)).registerLockAcquisition(any(), any());
verifyNoMoreInteractions(mutex, antiServiceMonitor, criticalRegion);