public void CanCreateDataLakeClusterWithCertificateFileContents()
        {
            var clusterIdentityCmdlet = new NewAzureHDInsightClusterConfigCommand()
            {
                CommandRuntime            = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ObjectId = ObjectId,
                CertificateFileContents   = CertificateFileContents,
                AadTenantId               = AadTenantId,
                CertificatePassword       = CertificatePassword,
                DefaultStorageAccountName = StorageName
            };

            clusterIdentityCmdlet.ExecuteCmdlet();
            commandRuntimeMock.Verify(
                f =>
                f.WriteObject(
                    It.Is <AzureHDInsightConfig>(
                        c =>
                        c.AADTenantId == AadTenantId &&
                        c.CertificatePassword == CertificatePassword &&
                        c.ObjectId == ObjectId &&
                        c.CertificateFileContents == CertificateFileContents &&
                        c.DefaultStorageAccountName == StorageName
                        )),
                Times.Once);
        }
        public void CreateNewConfig(bool setEdgeNodeVmSize = false)
        {
            var newconfigcmdlet = new NewAzureHDInsightClusterConfigCommand
            {
                CommandRuntime            = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ClusterType = ClusterType
            };

            if (setEdgeNodeVmSize)
            {
                newconfigcmdlet.EdgeNodeSize = "edgeNodeVmSizeSetTest";
            }

            newconfigcmdlet.ExecuteCmdlet();
            commandRuntimeMock.Verify(
                f =>
                f.WriteObject(
                    It.Is <AzureHDInsightConfig>(
                        c =>
                        c.ClusterType == ClusterType &&
                        c.AdditionalStorageAccounts.Count == 0 &&
                        c.Configurations.Count == 0 &&
                        string.IsNullOrEmpty(c.WorkerNodeSize) &&
                        string.IsNullOrEmpty(c.DefaultStorageAccountKey) &&
                        string.IsNullOrEmpty(c.DefaultStorageAccountName) &&
                        string.IsNullOrEmpty(c.HeadNodeSize) &&
                        string.IsNullOrEmpty(c.ZookeeperNodeSize) &&
                        ((!setEdgeNodeVmSize && string.IsNullOrEmpty(c.EdgeNodeSize)) || (setEdgeNodeVmSize && c.EdgeNodeSize == "edgeNodeVmSizeSetTest")) &&
                        c.HiveMetastore == null &&
                        c.OozieMetastore == null &&
                        c.ScriptActions.Count == 0)),
                Times.Once);
        }
        public void CanCreateClusterConfigWithDataLakeStoreParameters()
        {
            var newclusteridentitycmdlet = new NewAzureHDInsightClusterConfigCommand()
            {
                CommandRuntime            = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ObjectId            = ObjectId,
                CertificateFilePath = Certificate,
                AadTenantId         = AadTenantId,
                CertificatePassword = CertificatePassword
            };

            newclusteridentitycmdlet.ExecuteCmdlet();
            commandRuntimeMock.Verify(
                f =>
                f.WriteObject(
                    It.Is <AzureHDInsightConfig>(
                        c =>
                        c.AADTenantId == AadTenantId &&
                        c.CertificatePassword == CertificatePassword &&
                        c.ObjectId == ObjectId &&
                        c.CertificateFilePath == Certificate
                        )),
                Times.Once);
        }
        public void CanCreateNewConfig()
        {
            var newconfigcmdlet = new NewAzureHDInsightClusterConfigCommand
            {
                CommandRuntime = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ClusterType = ClusterType
            };

            newconfigcmdlet.ExecuteCmdlet();
            commandRuntimeMock.Verify(
                f =>
                    f.WriteObject(
                        It.Is<AzureHDInsightConfig>(
                            c =>
                                c.ClusterType == ClusterType &&
                                c.AdditionalStorageAccounts.Count == 0 &&
                                c.Configurations.Count == 0 &&
                                string.IsNullOrEmpty(c.WorkerNodeSize) &&
                                string.IsNullOrEmpty(c.DefaultStorageAccountKey) &&
                                string.IsNullOrEmpty(c.DefaultStorageAccountName) &&
                                string.IsNullOrEmpty(c.HeadNodeSize) &&
                                string.IsNullOrEmpty(c.ZookeeperNodeSize) &&
                                c.HiveMetastore == null &&
                                c.OozieMetastore == null &&
                                c.ScriptActions.Count == 0)),
                Times.Once);
        }
Exemple #5
0
        public void CanCreateNewConfig()
        {
            var newconfigcmdlet = new NewAzureHDInsightClusterConfigCommand
            {
                CommandRuntime            = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ClusterType = HDInsightClusterType.Hadoop
            };

            newconfigcmdlet.ExecuteCmdlet();
            commandRuntimeMock.Verify(
                f =>
                f.WriteObject(
                    It.Is <AzureHDInsightConfig>(
                        c =>
                        c.ClusterType == HDInsightClusterType.Hadoop &&
                        c.AdditionalStorageAccounts.Count == 0 &&
                        c.Configurations.Count == 0 &&
                        string.IsNullOrEmpty(c.WorkerNodeSize) &&
                        string.IsNullOrEmpty(c.DefaultStorageAccountKey) &&
                        string.IsNullOrEmpty(c.DefaultStorageAccountName) &&
                        string.IsNullOrEmpty(c.HeadNodeSize) &&
                        string.IsNullOrEmpty(c.ZookeeperNodeSize) &&
                        c.HiveMetastore == null &&
                        c.OozieMetastore == null &&
                        c.ScriptActions.Count == 0)),
                Times.Once);
        }