use of com.sequenceiq.cloudbreak.domain.Credential in project cloudbreak by hortonworks.
the class AbstractFileSystemConfiguratorTest method testGetScriptsWhenNoReplace.
@Test
public void testGetScriptsWhenNoReplace() {
Credential credential = new Credential();
credential.setId(1L);
FileSystemConfiguration fsConfig = new FileSystemConfiguration();
List<RecipeScript> actual = underTest.getScripts(credential, fsConfig);
List<RecipeScript> expected = singletonList(new RecipeScript("echo '$replace'", ExecutionType.ALL_NODES, RecipeType.POST_AMBARI_START));
Assert.assertEquals(expected, actual);
}
use of com.sequenceiq.cloudbreak.domain.Credential in project cloudbreak by hortonworks.
the class AbstractFileSystemConfiguratorTest method testGetScriptsWhenFileNotFound.
@Test
public void testGetScriptsWhenFileNotFound() {
Credential credential = new Credential();
credential.setId(2L);
FileSystemConfiguration fsConfig = new FileSystemConfiguration();
thrown.expectMessage("Filesystem configuration scripts cannot be read.");
thrown.expect(FileSystemConfigException.class);
underTest.getScripts(credential, fsConfig);
}
use of com.sequenceiq.cloudbreak.domain.Credential in project cloudbreak by hortonworks.
the class GcsFileSystemConfiguratorTest method testGetScriptConfigs.
@Test
public void testGetScriptConfigs() throws JsonProcessingException {
Credential credential = new Credential();
credential.setAttributes(new Json(singletonMap("serviceAccountPrivateKey", "private-key")));
GcsFileSystemConfiguration notProcessed = null;
List<FileSystemScriptConfig> actual = underTest.getScriptConfigs(credential, notProcessed);
List<FileSystemScriptConfig> expected = Arrays.asList(new FileSystemScriptConfig("scripts/gcs-p12.sh", POST_AMBARI_START, ALL_NODES, singletonMap("P12KEY", "private-key")), new FileSystemScriptConfig("scripts/gcs-connector-local.sh", POST_AMBARI_START, ALL_NODES), new FileSystemScriptConfig("scripts/gcs-connector-hdfs.sh", POST_CLUSTER_INSTALL, ONE_NODE));
Assert.assertEquals(expected, actual);
}
use of com.sequenceiq.cloudbreak.domain.Credential in project cloudbreak by hortonworks.
the class GcsFileSystemConfiguratorTest method testGetScriptConfigsWhenPrivateKeyNotSet.
@Test
public void testGetScriptConfigsWhenPrivateKeyNotSet() throws JsonProcessingException {
Credential credential = new Credential();
credential.setAttributes(new Json(emptyMap()));
GcsFileSystemConfiguration notProcessed = null;
List<FileSystemScriptConfig> actual = underTest.getScriptConfigs(credential, notProcessed);
List<FileSystemScriptConfig> expected = Arrays.asList(new FileSystemScriptConfig("scripts/gcs-p12.sh", POST_AMBARI_START, ALL_NODES, singletonMap("P12KEY", "")), new FileSystemScriptConfig("scripts/gcs-connector-local.sh", POST_AMBARI_START, ALL_NODES), new FileSystemScriptConfig("scripts/gcs-connector-hdfs.sh", POST_CLUSTER_INSTALL, ONE_NODE));
Assert.assertEquals(expected, actual);
}
use of com.sequenceiq.cloudbreak.domain.Credential in project cloudbreak by hortonworks.
the class WasbFileSystemConfiguratorTest method testGetScriptConfigs.
@Test
public void testGetScriptConfigs() {
List<FileSystemScriptConfig> actual = underTest.getScriptConfigs(new Credential(), new WasbFileSystemConfiguration());
Assert.assertEquals(emptyList(), actual);
}
Aggregations