Package com.vmware.bdd.plugin.ambari.service.am

Examples of com.vmware.bdd.plugin.ambari.service.am.FakeApiManager


   @Test(groups = { "TestAmbariImpl" })
   public void testStopAlreadyStoppedCluster() {
      AmbariImpl spy = Mockito.spy(provider);

      AmbariManagerClientbuilder clientbuilder = makeClientBuilder();
      ApiManager apiManager = new FakeApiManager(clientbuilder);

      Mockito.when(spy.isProvisioned(blueprint.getName())).thenReturn(true);
      Mockito.doReturn(true).when(spy).isClusterProvisionedByBDE(Mockito.<AmClusterDef>any());

      ApiManager backup = spy.getApiManager();
View Full Code Here


   @Test(groups = { "TestAmbariImpl" })
   public void testStopStartedCluster() {
      AmbariImpl spy = Mockito.spy(provider);
      AmbariManagerClientbuilder clientbuilder = makeClientBuilder();
      ApiManager apiManager = new FakeApiManager(clientbuilder) {
         @Override
         public ApiRequest stopAllServicesInCluster(String clusterName) throws AmbariApiException {
            ApiRequest apiRequest = new ApiRequest();
            apiRequest.setApiRequestInfo(new ApiRequestInfo());
            return apiRequest;
View Full Code Here

      AmbariImpl spy = Mockito.spy(provider);
      Mockito.when(spy.echo()).thenReturn(true);
      Mockito.when(spy.isProvisioned(Mockito.anyString())).thenReturn(true);
      Mockito.doReturn(true).when(spy).isClusterProvisionedByBDE(Mockito.<AmClusterDef>any());
      Mockito.doReturn(false).when(spy).onStopCluster(Mockito.<ClusterBlueprint>any(), Mockito.<ClusterReportQueue>any());
      ApiManager apiManager = new FakeApiManager(makeClientBuilder());
      ApiManager backup = spy.getApiManager();
      spy.setApiManager(apiManager);
      Assert.assertTrue(spy.onDeleteCluster(blueprint, reportQueue));
      spy.setApiManager(backup);
   }
View Full Code Here

      AmbariImpl spy = Mockito.spy(provider);
      Mockito.when(spy.echo()).thenReturn(true);
      Mockito.when(spy.isProvisioned(Mockito.anyString())).thenReturn(true);
      Mockito.doReturn(true).when(spy).isClusterProvisionedByBDE(Mockito.<AmClusterDef>any());
      Mockito.doReturn(true).when(spy).onStopCluster(Mockito.<ClusterBlueprint>any(), Mockito.<ClusterReportQueue>any());
      ApiManager apiManager = new FakeApiManager(makeClientBuilder());
      ApiManager backup = spy.getApiManager();
      spy.setApiManager(apiManager);
      Assert.assertTrue(spy.onDeleteCluster(blueprint, reportQueue));
      spy.setApiManager(backup);
   }
View Full Code Here

   @Test(groups = { "TestAmbariImpl" })
   public void testStartAlreadyStartedCluster() {
      AmbariImpl spy = Mockito.spy(provider);

      AmbariManagerClientbuilder clientbuilder = makeClientBuilder();
      ApiManager apiManager = new FakeApiManager(clientbuilder);

      Mockito.when(spy.isProvisioned(blueprint.getName())).thenReturn(true);
      provider.isProvisioned(blueprint.getName());
      Mockito.doReturn(true).when(spy).isClusterProvisionedByBDE(Mockito.<AmClusterDef>any());
View Full Code Here

   @Test(groups = { "TestAmbariImpl" })
   public void testStartClusterFailed() {
      AmbariImpl spy = Mockito.spy(provider);

      AmbariManagerClientbuilder clientbuilder = makeClientBuilder();
      ApiManager apiManager = new FakeApiManager(clientbuilder) {
         @Override
         public ApiRequest startAllServicesInCluster(String clusterName) throws AmbariApiException {
            throw AmbariApiException.RESPONSE_EXCEPTION(400, "Faked exception");
         }
      };
View Full Code Here

   @Test(groups = { "TestAmbariImpl" })
   public void testStartStoppedCluster() {
      AmbariImpl spy = Mockito.spy(provider);

      AmbariManagerClientbuilder clientbuilder = makeClientBuilder();
      ApiManager apiManager = new FakeApiManager(clientbuilder) {
         @Override
         public ApiRequest startAllServicesInCluster(String clusterName) throws AmbariApiException {
            ApiRequest apiRequest = new ApiRequest();
            apiRequest.setApiRequestInfo(new ApiRequestInfo());
            return apiRequest;
View Full Code Here

   @Test(groups = { "TestAmbariImpl" })
   public void testDoSoftwareOperation() {
      ClusterReport clusterReport = new ClusterReport(blueprint);
      AmbariImpl spy = Mockito.spy(provider);
      ApiManager apiManager = new FakeApiManager(makeClientBuilder());
      ApiManager backup = spy.getApiManager();
      spy.setApiManager(apiManager);
      ApiRequest request = new ApiRequest();
      ApiRequestInfo requestInfo = new ApiRequestInfo();
      request.setApiRequestInfo(requestInfo);
View Full Code Here

TOP

Related Classes of com.vmware.bdd.plugin.ambari.service.am.FakeApiManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.