@Test public void testDisableKnoxAutorestartIfCmVersionAtLeastWhenKnoxIsMissing() throws ApiException { setUpCMVersion(VERSION_7_1_0); ServicesResourceApi serviceResourceApi = mock(ServicesResourceApi.class); when(clouderaManagerApiFactory.getServicesResourceApi(any())).thenReturn(serviceResourceApi); ApiServiceList apiServiceList = new ApiServiceList().addItemsItem(new ApiService().name("hbase-a63").type("HBASE")); when(serviceResourceApi.readServices(TEST_CLUSTER_NAME, DataView.SUMMARY.name())).thenReturn(apiServiceList); underTest.disableKnoxAutorestartIfCmVersionAtLeast(CLOUDERAMANAGER_VERSION_7_1_0, new ApiClient(), TEST_CLUSTER_NAME); verify(serviceResourceApi, never()).updateServiceConfig(any(), any(), any(), any()); }
public void disableKnoxAutorestartIfCmVersionAtLeast(Versioned versionAtLeast, ApiClient client, String clusterName) { try { ClouderaManagerResourceApi resourceApiInstance = clouderaManagerApiFactory.getClouderaManagerResourceApi(client); if (isVersionAtLeast(versionAtLeast, resourceApiInstance)) { modifyKnoxAutorestart(client, clusterName, false); } } catch (ApiException e) { LOGGER.debug("Failed to initialize CM client.", e); } }
ClouderaManagerConfigService { public void disableKnoxAutorestartIfCmVersionAtLeast(Versioned versionAtLeast, ApiClient client, String clusterName) { try { ClouderaManagerResourceApi resourceApiInstance = clouderaManagerApiFactory.getClouderaManagerResourceApi(client); if (isVersionAtLeast(versionAtLeast, resourceApiInstance)) { modifyKnoxAutorestart(client, clusterName, false); } } catch (ApiException e) { LOGGER.debug("Failed to initialize CM client.", e); } } }
ClouderaManagerConfigService { public void disableKnoxAutorestartIfCmVersionAtLeast(Versioned versionAtLeast, ApiClient client, String clusterName) { try { ClouderaManagerResourceApi resourceApiInstance = clouderaManagerApiFactory.getClouderaManagerResourceApi(client); if (isVersionAtLeast(versionAtLeast, resourceApiInstance)) { modifyKnoxAutorestart(client, clusterName, false); } } catch (ApiException e) { LOGGER.debug("Failed to initialize CM client.", e); } }  }
ClouderaManagerConfigService { public void disableKnoxAutorestartIfCmVersionAtLeast(Versioned versionAtLeast, ApiClient client, String clusterName) { try { ClouderaManagerResourceApi resourceApiInstance = clouderaManagerApiFactory.getClouderaManagerResourceApi(client); if (isVersionAtLeast(versionAtLeast, resourceApiInstance)) { modifyKnoxAutorestart(client, clusterName, false); } } catch (ApiException e) { LOGGER.debug("Failed to initialize CM client.", e); } }  void disableKnoxAutorestartIfCmVersionAtLeast(Versioned versionAtLeast, ApiClient client, String clusterName); void enableKnoxAutorestartIfCmVersionAtLeast(Versioned versionAtLeast, ApiClient client, String clusterName); }
ClouderaManagerConfigService { public void disableKnoxAutorestartIfCmVersionAtLeast(Versioned versionAtLeast, ApiClient client, String clusterName) { try { ClouderaManagerResourceApi resourceApiInstance = clouderaManagerApiFactory.getClouderaManagerResourceApi(client); if (isVersionAtLeast(versionAtLeast, resourceApiInstance)) { modifyKnoxAutorestart(client, clusterName, false); } } catch (ApiException e) { LOGGER.debug("Failed to initialize CM client.", e); } }  void disableKnoxAutorestartIfCmVersionAtLeast(Versioned versionAtLeast, ApiClient client, String clusterName); void enableKnoxAutorestartIfCmVersionAtLeast(Versioned versionAtLeast, ApiClient client, String clusterName);  }