@@ -0,0 +1,3015 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.%0Apackage com.yahoo.vespa.hosted.node.admin.orchestrator;%0A%0Aimport com.yahoo.vespa.applicationmodel.HostName;%0A%0Aimport com.yahoo.vespa.orchestrator.restapi.HostApi;%0Aimport com.yahoo.vespa.orchestrator.restapi.HostSuspensionApi;%0Aimport com.yahoo.vespa.orchestrator.restapi.wire.BatchOperationResult;%0Aimport com.yahoo.vespa.orchestrator.restapi.wire.HostStateChangeDenialReason;%0Aimport com.yahoo.vespa.orchestrator.restapi.wire.UpdateHostResponse;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Mockito;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Optional;%0A%0Aimport static org.hamcrest.core.Is.is;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A/**%0A * @author bakksjo%0A * @author dybis%0A */%0Apublic class OrchestratorImplTest %7B%0A    private HostApi hostApi;%0A    private OrchestratorImpl orchestrator;%0A    private HostSuspensionApi hostSuspensionApi;%0A    final String hostNameString = %22host%22;%0A    final HostName hostName = new HostName(hostNameString);%0A    final List%3CString%3E hosts = new ArrayList%3C%3E();%0A%0A    @Before%0A    public void before() %7B%0A        hostApi = mock(HostApi.class);%0A     //   final JaxRsStrategy%3CHostApi%3E hostApiClient = new LocalPassThroughJaxRsStrategy%3C%3E(hostApi);%0A%0A        hostSuspensionApi = mock(HostSuspensionApi.class);%0A       // final JaxRsStrategy%3CHostSuspensionApi%3E hostSuspendClient = new LocalPassThroughJaxRsStrategy%3C%3E(hostSuspensionApi);%0A%0A      //  orchestrator = new OrchestratorImpl(hostApiClient, hostSuspendClient);%0A    %7D%0A/*%0A    @Test%0A    public void testSingleOperations() throws Exception %7B%0A        // Make resume and suspend always succeed.%0A        when(hostApi.resume(hostNameString)).thenReturn(new UpdateHostResponse(hostNameString, null));%0A        when(hostApi.suspend(hostNameString)).thenReturn(new UpdateHostResponse(hostNameString, null));%0A%0A        orchestrator.resume(hostName);%0A        verify(hostApi, times(1)).resume(hostNameString);%0A%0A        orchestrator.suspend(hostName);%0A        verify(hostApi, times(1)).suspend(hostNameString);%0A%0A        hosts.add(hostNameString);%0A    %7D%0A%0A    @Test%0A    public void testListSuspendOk() throws Exception %7B%0A        hosts.add(hostNameString);%0A        when(hostSuspensionApi.suspendAll(Mockito.any())).thenReturn(new BatchOperationResult(null));%0A        assertThat(orchestrator.suspend(%22parent%22, hosts), is(Optional.empty()));%0A    %7D%0A%0A    @Test%0A    public void testListSuspendFailed() throws Exception %7B%0A        hosts.add(hostNameString);%0A        when(hostSuspensionApi.suspendAll(Mockito.any())).thenReturn(new BatchOperationResult(%22no no%22));%0A        assertThat(orchestrator.suspend(%22parent%22, hosts), is(Optional.of(%22no no%22)));%0A    %7D*/%0A%7D%0A

Revert "remove test"