diff --git a/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md b/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md index 1ce3f81270f7..99e402daea38 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md +++ b/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.8 (Unreleased) +## 1.0.0-beta.1 (2023-08-09) + +- Azure Resource Manager Kusto client library for Java. This package contains Microsoft Azure SDK for Kusto Management SDK. The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. Package tag package-2023-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/kusto/azure-resourcemanager-kusto/README.md b/sdk/kusto/azure-resourcemanager-kusto/README.md index dbc0c0c4afa4..aa657388b273 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/README.md +++ b/sdk/kusto/azure-resourcemanager-kusto/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-kusto - 1.0.0-beta.7 + 1.0.0-beta.8 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.java index 568ce8830a44..6424d82e0f99 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.java @@ -263,7 +263,7 @@ public KustoManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.kusto") .append("/") - .append("1.0.0-beta.7"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AcceptedAudiencesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AcceptedAudiencesTests.java deleted file mode 100644 index 3b0d9ddaab40..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AcceptedAudiencesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.AcceptedAudiences; -import org.junit.jupiter.api.Assertions; - -public final class AcceptedAudiencesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AcceptedAudiences model = BinaryData.fromString("{\"value\":\"gvfcj\"}").toObject(AcceptedAudiences.class); - Assertions.assertEquals("gvfcj", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AcceptedAudiences model = new AcceptedAudiences().withValue("gvfcj"); - model = BinaryData.fromObject(model).toObject(AcceptedAudiences.class); - Assertions.assertEquals("gvfcj", model.value()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationInnerTests.java deleted file mode 100644 index 84d95ea9bab8..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationInnerTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationInner; -import com.azure.resourcemanager.kusto.models.DefaultPrincipalsModificationKind; -import com.azure.resourcemanager.kusto.models.TableLevelSharingProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AttachedDatabaseConfigurationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedDatabaseConfigurationInner model = - BinaryData - .fromString( - "{\"location\":\"tkzwpcnpwzc\",\"properties\":{\"provisioningState\":\"Canceled\",\"databaseName\":\"gvvs\",\"clusterResourceId\":\"cyajguqf\",\"attachedDatabaseNames\":[\"gzlvdnkfxu\"],\"defaultPrincipalsModificationKind\":\"Union\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"zrmuhapfcqdps\",\"xqv\"],\"tablesToExclude\":[\"uoymgccelvezry\"],\"externalTablesToInclude\":[\"mfe\",\"kerqwkyh\",\"ob\"],\"externalTablesToExclude\":[\"xedk\",\"wep\"],\"materializedViewsToInclude\":[\"cr\"],\"materializedViewsToExclude\":[\"wccsnjvcdwxlpqek\",\"tn\",\"htjsying\",\"fq\"],\"functionsToInclude\":[\"tdhtmdvyp\"],\"functionsToExclude\":[\"dgszywkbirryuzh\",\"hkjoqr\",\"qqaatjinrvgou\"]},\"databaseNameOverride\":\"fiibfggjioolvr\",\"databaseNamePrefix\":\"kvtkkg\"},\"id\":\"lqwjygvjayvblm\",\"name\":\"vkzuhbxvvyhgso\",\"type\":\"byrqufeg\"}") - .toObject(AttachedDatabaseConfigurationInner.class); - Assertions.assertEquals("tkzwpcnpwzc", model.location()); - Assertions.assertEquals("gvvs", model.databaseName()); - Assertions.assertEquals("cyajguqf", model.clusterResourceId()); - Assertions.assertEquals(DefaultPrincipalsModificationKind.UNION, model.defaultPrincipalsModificationKind()); - Assertions.assertEquals("zrmuhapfcqdps", model.tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions.assertEquals("uoymgccelvezry", model.tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions.assertEquals("mfe", model.tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions.assertEquals("xedk", model.tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions.assertEquals("cr", model.tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions - .assertEquals("wccsnjvcdwxlpqek", model.tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions.assertEquals("tdhtmdvyp", model.tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions.assertEquals("dgszywkbirryuzh", model.tableLevelSharingProperties().functionsToExclude().get(0)); - Assertions.assertEquals("fiibfggjioolvr", model.databaseNameOverride()); - Assertions.assertEquals("kvtkkg", model.databaseNamePrefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedDatabaseConfigurationInner model = - new AttachedDatabaseConfigurationInner() - .withLocation("tkzwpcnpwzc") - .withDatabaseName("gvvs") - .withClusterResourceId("cyajguqf") - .withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind.UNION) - .withTableLevelSharingProperties( - new TableLevelSharingProperties() - .withTablesToInclude(Arrays.asList("zrmuhapfcqdps", "xqv")) - .withTablesToExclude(Arrays.asList("uoymgccelvezry")) - .withExternalTablesToInclude(Arrays.asList("mfe", "kerqwkyh", "ob")) - .withExternalTablesToExclude(Arrays.asList("xedk", "wep")) - .withMaterializedViewsToInclude(Arrays.asList("cr")) - .withMaterializedViewsToExclude(Arrays.asList("wccsnjvcdwxlpqek", "tn", "htjsying", "fq")) - .withFunctionsToInclude(Arrays.asList("tdhtmdvyp")) - .withFunctionsToExclude(Arrays.asList("dgszywkbirryuzh", "hkjoqr", "qqaatjinrvgou"))) - .withDatabaseNameOverride("fiibfggjioolvr") - .withDatabaseNamePrefix("kvtkkg"); - model = BinaryData.fromObject(model).toObject(AttachedDatabaseConfigurationInner.class); - Assertions.assertEquals("tkzwpcnpwzc", model.location()); - Assertions.assertEquals("gvvs", model.databaseName()); - Assertions.assertEquals("cyajguqf", model.clusterResourceId()); - Assertions.assertEquals(DefaultPrincipalsModificationKind.UNION, model.defaultPrincipalsModificationKind()); - Assertions.assertEquals("zrmuhapfcqdps", model.tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions.assertEquals("uoymgccelvezry", model.tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions.assertEquals("mfe", model.tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions.assertEquals("xedk", model.tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions.assertEquals("cr", model.tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions - .assertEquals("wccsnjvcdwxlpqek", model.tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions.assertEquals("tdhtmdvyp", model.tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions.assertEquals("dgszywkbirryuzh", model.tableLevelSharingProperties().functionsToExclude().get(0)); - Assertions.assertEquals("fiibfggjioolvr", model.databaseNameOverride()); - Assertions.assertEquals("kvtkkg", model.databaseNamePrefix()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationListResultTests.java deleted file mode 100644 index 1981a5c16010..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationListResultTests.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationInner; -import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurationListResult; -import com.azure.resourcemanager.kusto.models.DefaultPrincipalsModificationKind; -import com.azure.resourcemanager.kusto.models.TableLevelSharingProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AttachedDatabaseConfigurationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedDatabaseConfigurationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"location\":\"uukzclewyhmlw\",\"properties\":{\"provisioningState\":\"Running\",\"databaseName\":\"zpof\",\"clusterResourceId\":\"cckwyfzqwhxxbu\",\"attachedDatabaseNames\":[\"xzfe\"],\"defaultPrincipalsModificationKind\":\"Replace\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"riolxorjalt\",\"lmncw\"],\"tablesToExclude\":[\"qwcsdbnwdcfhuc\",\"dpfuvg\",\"sbjjc\"],\"externalTablesToInclude\":[\"xbvtvudu\"],\"externalTablesToExclude\":[\"ormrlxqtvcofudfl\",\"kgjubgdknnqvsazn\"],\"materializedViewsToInclude\":[\"orudsgsa\"],\"materializedViewsToExclude\":[\"yc\",\"rauwjuetaebu\",\"u\"],\"functionsToInclude\":[\"ovsm\",\"l\",\"wabm\",\"oefki\"],\"functionsToExclude\":[\"tpuqujmq\",\"gkfbtndoaong\",\"jcntuj\"]},\"databaseNameOverride\":\"c\",\"databaseNamePrefix\":\"df\"},\"id\":\"wwa\",\"name\":\"zkoj\",\"type\":\"dcpzfoqo\"},{\"location\":\"cybxa\",\"properties\":{\"provisioningState\":\"Canceled\",\"databaseName\":\"zuf\",\"clusterResourceId\":\"x\",\"attachedDatabaseNames\":[\"opidoamciodh\"],\"defaultPrincipalsModificationKind\":\"Union\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"khnzbonlw\",\"toego\",\"dwbwhkszzcmrvexz\",\"vbtqgsfraoyzk\"],\"tablesToExclude\":[\"tlmngu\"],\"externalTablesToInclude\":[\"q\",\"ldsyuuximerqfob\"],\"externalTablesToExclude\":[\"nkbykutwpfhp\",\"gmhrskdsnfdsdoak\",\"tdlmkkzevd\",\"hewpusdsttwv\"],\"materializedViewsToInclude\":[\"bbejdcngqqm\",\"akufgmjz\",\"wr\"],\"materializedViewsToExclude\":[\"twaenuuzko\",\"bminrfdwoyuhhzi\",\"iefozbhdmsml\"],\"functionsToInclude\":[\"hoftr\",\"ae\",\"u\",\"ah\"],\"functionsToExclude\":[\"slfaoqzpiyyl\",\"alnswhccsphk\",\"ivwitqscywugg\",\"oluhczbwemh\"]},\"databaseNameOverride\":\"rsbrgzdwm\",\"databaseNamePrefix\":\"eypqwdxggicccn\"},\"id\":\"qhuexm\",\"name\":\"ttlstvlzywemhz\",\"type\":\"ncsdtclusiyp\"},{\"location\":\"fgytguslfeadcyg\",\"properties\":{\"provisioningState\":\"Succeeded\",\"databaseName\":\"hejhzisx\",\"clusterResourceId\":\"fpel\",\"attachedDatabaseNames\":[\"pv\"],\"defaultPrincipalsModificationKind\":\"Union\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"vu\",\"zraehtwd\",\"r\",\"tswiby\"],\"tablesToExclude\":[\"l\"],\"externalTablesToInclude\":[\"hfwpracstwit\",\"khevxccedc\",\"nmdyodnwzxl\",\"jc\"],\"externalTablesToExclude\":[\"ltiugcxnavv\"],\"materializedViewsToInclude\":[\"ibyqunyowxwlmdj\"],\"materializedViewsToExclude\":[\"fgbvfvpdbo\",\"acizsjqlhkrr\",\"bdeibqipqk\",\"hvxndzwmkrefajpj\"],\"functionsToInclude\":[\"kqnyh\",\"b\"],\"functionsToExclude\":[\"jivfxzsjabib\",\"ystawfsdjpvkvp\",\"jxbkzbzkdvn\",\"jabudurgkakmo\"]},\"databaseNameOverride\":\"hjjklff\",\"databaseNamePrefix\":\"ouw\"},\"id\":\"lgzrfzeeyeb\",\"name\":\"zi\",\"type\":\"ayuhqlbjbsy\"},{\"location\":\"qwrvtldgmfp\",\"properties\":{\"provisioningState\":\"Succeeded\",\"databaseName\":\"ipaslthaqfxssmwu\",\"clusterResourceId\":\"wbdsr\",\"attachedDatabaseNames\":[\"drhneuyow\",\"kdw\"],\"defaultPrincipalsModificationKind\":\"None\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"bi\"],\"tablesToExclude\":[\"pikpz\",\"mejzanlfzxia\",\"rmbzo\"],\"externalTablesToInclude\":[\"i\",\"rjqc\"],\"externalTablesToExclude\":[\"zpfrla\",\"szrnwo\"],\"materializedViewsToInclude\":[\"dfpwpjylwbtlhfls\",\"cdhszf\"],\"materializedViewsToExclude\":[\"bgofeljag\",\"qmqhldvriii\",\"jnalghf\",\"vtvsexsowueluq\"],\"functionsToInclude\":[\"hhxvrhmzkwpj\",\"wws\"],\"functionsToExclude\":[\"hftqsxhqxujxukn\",\"xdigrjg\",\"ufzdmsyq\",\"fi\"]},\"databaseNameOverride\":\"hbotzingamvppho\",\"databaseNamePrefix\":\"qzudphq\"},\"id\":\"mvdk\",\"name\":\"wynwcvtbvkayhm\",\"type\":\"nvyq\"}]}") - .toObject(AttachedDatabaseConfigurationListResult.class); - Assertions.assertEquals("uukzclewyhmlw", model.value().get(0).location()); - Assertions.assertEquals("zpof", model.value().get(0).databaseName()); - Assertions.assertEquals("cckwyfzqwhxxbu", model.value().get(0).clusterResourceId()); - Assertions - .assertEquals( - DefaultPrincipalsModificationKind.REPLACE, model.value().get(0).defaultPrincipalsModificationKind()); - Assertions - .assertEquals("riolxorjalt", model.value().get(0).tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions - .assertEquals( - "qwcsdbnwdcfhuc", model.value().get(0).tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions - .assertEquals( - "xbvtvudu", model.value().get(0).tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions - .assertEquals( - "ormrlxqtvcofudfl", - model.value().get(0).tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions - .assertEquals( - "orudsgsa", model.value().get(0).tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions - .assertEquals("yc", model.value().get(0).tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions.assertEquals("ovsm", model.value().get(0).tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions - .assertEquals("tpuqujmq", model.value().get(0).tableLevelSharingProperties().functionsToExclude().get(0)); - Assertions.assertEquals("c", model.value().get(0).databaseNameOverride()); - Assertions.assertEquals("df", model.value().get(0).databaseNamePrefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedDatabaseConfigurationListResult model = - new AttachedDatabaseConfigurationListResult() - .withValue( - Arrays - .asList( - new AttachedDatabaseConfigurationInner() - .withLocation("uukzclewyhmlw") - .withDatabaseName("zpof") - .withClusterResourceId("cckwyfzqwhxxbu") - .withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind.REPLACE) - .withTableLevelSharingProperties( - new TableLevelSharingProperties() - .withTablesToInclude(Arrays.asList("riolxorjalt", "lmncw")) - .withTablesToExclude(Arrays.asList("qwcsdbnwdcfhuc", "dpfuvg", "sbjjc")) - .withExternalTablesToInclude(Arrays.asList("xbvtvudu")) - .withExternalTablesToExclude( - Arrays.asList("ormrlxqtvcofudfl", "kgjubgdknnqvsazn")) - .withMaterializedViewsToInclude(Arrays.asList("orudsgsa")) - .withMaterializedViewsToExclude(Arrays.asList("yc", "rauwjuetaebu", "u")) - .withFunctionsToInclude(Arrays.asList("ovsm", "l", "wabm", "oefki")) - .withFunctionsToExclude(Arrays.asList("tpuqujmq", "gkfbtndoaong", "jcntuj"))) - .withDatabaseNameOverride("c") - .withDatabaseNamePrefix("df"), - new AttachedDatabaseConfigurationInner() - .withLocation("cybxa") - .withDatabaseName("zuf") - .withClusterResourceId("x") - .withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind.UNION) - .withTableLevelSharingProperties( - new TableLevelSharingProperties() - .withTablesToInclude( - Arrays.asList("khnzbonlw", "toego", "dwbwhkszzcmrvexz", "vbtqgsfraoyzk")) - .withTablesToExclude(Arrays.asList("tlmngu")) - .withExternalTablesToInclude(Arrays.asList("q", "ldsyuuximerqfob")) - .withExternalTablesToExclude( - Arrays - .asList( - "nkbykutwpfhp", "gmhrskdsnfdsdoak", "tdlmkkzevd", "hewpusdsttwv")) - .withMaterializedViewsToInclude(Arrays.asList("bbejdcngqqm", "akufgmjz", "wr")) - .withMaterializedViewsToExclude( - Arrays.asList("twaenuuzko", "bminrfdwoyuhhzi", "iefozbhdmsml")) - .withFunctionsToInclude(Arrays.asList("hoftr", "ae", "u", "ah")) - .withFunctionsToExclude( - Arrays - .asList( - "slfaoqzpiyyl", "alnswhccsphk", "ivwitqscywugg", "oluhczbwemh"))) - .withDatabaseNameOverride("rsbrgzdwm") - .withDatabaseNamePrefix("eypqwdxggicccn"), - new AttachedDatabaseConfigurationInner() - .withLocation("fgytguslfeadcyg") - .withDatabaseName("hejhzisx") - .withClusterResourceId("fpel") - .withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind.UNION) - .withTableLevelSharingProperties( - new TableLevelSharingProperties() - .withTablesToInclude(Arrays.asList("vu", "zraehtwd", "r", "tswiby")) - .withTablesToExclude(Arrays.asList("l")) - .withExternalTablesToInclude( - Arrays.asList("hfwpracstwit", "khevxccedc", "nmdyodnwzxl", "jc")) - .withExternalTablesToExclude(Arrays.asList("ltiugcxnavv")) - .withMaterializedViewsToInclude(Arrays.asList("ibyqunyowxwlmdj")) - .withMaterializedViewsToExclude( - Arrays - .asList("fgbvfvpdbo", "acizsjqlhkrr", "bdeibqipqk", "hvxndzwmkrefajpj")) - .withFunctionsToInclude(Arrays.asList("kqnyh", "b")) - .withFunctionsToExclude( - Arrays - .asList( - "jivfxzsjabib", "ystawfsdjpvkvp", "jxbkzbzkdvn", "jabudurgkakmo"))) - .withDatabaseNameOverride("hjjklff") - .withDatabaseNamePrefix("ouw"), - new AttachedDatabaseConfigurationInner() - .withLocation("qwrvtldgmfp") - .withDatabaseName("ipaslthaqfxssmwu") - .withClusterResourceId("wbdsr") - .withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind.NONE) - .withTableLevelSharingProperties( - new TableLevelSharingProperties() - .withTablesToInclude(Arrays.asList("bi")) - .withTablesToExclude(Arrays.asList("pikpz", "mejzanlfzxia", "rmbzo")) - .withExternalTablesToInclude(Arrays.asList("i", "rjqc")) - .withExternalTablesToExclude(Arrays.asList("zpfrla", "szrnwo")) - .withMaterializedViewsToInclude(Arrays.asList("dfpwpjylwbtlhfls", "cdhszf")) - .withMaterializedViewsToExclude( - Arrays.asList("bgofeljag", "qmqhldvriii", "jnalghf", "vtvsexsowueluq")) - .withFunctionsToInclude(Arrays.asList("hhxvrhmzkwpj", "wws")) - .withFunctionsToExclude( - Arrays.asList("hftqsxhqxujxukn", "xdigrjg", "ufzdmsyq", "fi"))) - .withDatabaseNameOverride("hbotzingamvppho") - .withDatabaseNamePrefix("qzudphq"))); - model = BinaryData.fromObject(model).toObject(AttachedDatabaseConfigurationListResult.class); - Assertions.assertEquals("uukzclewyhmlw", model.value().get(0).location()); - Assertions.assertEquals("zpof", model.value().get(0).databaseName()); - Assertions.assertEquals("cckwyfzqwhxxbu", model.value().get(0).clusterResourceId()); - Assertions - .assertEquals( - DefaultPrincipalsModificationKind.REPLACE, model.value().get(0).defaultPrincipalsModificationKind()); - Assertions - .assertEquals("riolxorjalt", model.value().get(0).tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions - .assertEquals( - "qwcsdbnwdcfhuc", model.value().get(0).tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions - .assertEquals( - "xbvtvudu", model.value().get(0).tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions - .assertEquals( - "ormrlxqtvcofudfl", - model.value().get(0).tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions - .assertEquals( - "orudsgsa", model.value().get(0).tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions - .assertEquals("yc", model.value().get(0).tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions.assertEquals("ovsm", model.value().get(0).tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions - .assertEquals("tpuqujmq", model.value().get(0).tableLevelSharingProperties().functionsToExclude().get(0)); - Assertions.assertEquals("c", model.value().get(0).databaseNameOverride()); - Assertions.assertEquals("df", model.value().get(0).databaseNamePrefix()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationPropertiesTests.java deleted file mode 100644 index 720570023cd1..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationPropertiesTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationProperties; -import com.azure.resourcemanager.kusto.models.DefaultPrincipalsModificationKind; -import com.azure.resourcemanager.kusto.models.TableLevelSharingProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AttachedDatabaseConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedDatabaseConfigurationProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Moving\",\"databaseName\":\"wz\",\"clusterResourceId\":\"bnhlmc\",\"attachedDatabaseNames\":[\"dn\"],\"defaultPrincipalsModificationKind\":\"Replace\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"bmhrixkwmyijejv\",\"grhbpn\",\"ixexcc\"],\"tablesToExclude\":[\"eaxhcexdrrvqahqk\",\"htpwij\",\"hyjsvfycx\"],\"externalTablesToInclude\":[\"voowvr\",\"mtg\"],\"externalTablesToExclude\":[\"pyostronzmyhgfi\",\"nsxkmcwaekrrjr\",\"afxtsgum\",\"jglikkxwslolb\"],\"materializedViewsToInclude\":[\"uzlm\",\"felfktg\"],\"materializedViewsToExclude\":[\"rpw\"],\"functionsToInclude\":[\"znoigbrn\",\"w\"],\"functionsToExclude\":[\"pn\"]},\"databaseNameOverride\":\"azej\",\"databaseNamePrefix\":\"qkagfhsxt\"}") - .toObject(AttachedDatabaseConfigurationProperties.class); - Assertions.assertEquals("wz", model.databaseName()); - Assertions.assertEquals("bnhlmc", model.clusterResourceId()); - Assertions.assertEquals(DefaultPrincipalsModificationKind.REPLACE, model.defaultPrincipalsModificationKind()); - Assertions.assertEquals("bmhrixkwmyijejv", model.tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions.assertEquals("eaxhcexdrrvqahqk", model.tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions.assertEquals("voowvr", model.tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions - .assertEquals("pyostronzmyhgfi", model.tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions.assertEquals("uzlm", model.tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions.assertEquals("rpw", model.tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions.assertEquals("znoigbrn", model.tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions.assertEquals("pn", model.tableLevelSharingProperties().functionsToExclude().get(0)); - Assertions.assertEquals("azej", model.databaseNameOverride()); - Assertions.assertEquals("qkagfhsxt", model.databaseNamePrefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedDatabaseConfigurationProperties model = - new AttachedDatabaseConfigurationProperties() - .withDatabaseName("wz") - .withClusterResourceId("bnhlmc") - .withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind.REPLACE) - .withTableLevelSharingProperties( - new TableLevelSharingProperties() - .withTablesToInclude(Arrays.asList("bmhrixkwmyijejv", "grhbpn", "ixexcc")) - .withTablesToExclude(Arrays.asList("eaxhcexdrrvqahqk", "htpwij", "hyjsvfycx")) - .withExternalTablesToInclude(Arrays.asList("voowvr", "mtg")) - .withExternalTablesToExclude( - Arrays.asList("pyostronzmyhgfi", "nsxkmcwaekrrjr", "afxtsgum", "jglikkxwslolb")) - .withMaterializedViewsToInclude(Arrays.asList("uzlm", "felfktg")) - .withMaterializedViewsToExclude(Arrays.asList("rpw")) - .withFunctionsToInclude(Arrays.asList("znoigbrn", "w")) - .withFunctionsToExclude(Arrays.asList("pn"))) - .withDatabaseNameOverride("azej") - .withDatabaseNamePrefix("qkagfhsxt"); - model = BinaryData.fromObject(model).toObject(AttachedDatabaseConfigurationProperties.class); - Assertions.assertEquals("wz", model.databaseName()); - Assertions.assertEquals("bnhlmc", model.clusterResourceId()); - Assertions.assertEquals(DefaultPrincipalsModificationKind.REPLACE, model.defaultPrincipalsModificationKind()); - Assertions.assertEquals("bmhrixkwmyijejv", model.tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions.assertEquals("eaxhcexdrrvqahqk", model.tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions.assertEquals("voowvr", model.tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions - .assertEquals("pyostronzmyhgfi", model.tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions.assertEquals("uzlm", model.tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions.assertEquals("rpw", model.tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions.assertEquals("znoigbrn", model.tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions.assertEquals("pn", model.tableLevelSharingProperties().functionsToExclude().get(0)); - Assertions.assertEquals("azej", model.databaseNameOverride()); - Assertions.assertEquals("qkagfhsxt", model.databaseNamePrefix()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsCheckNameAvailabilityWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index 491c491c436d..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurationsCheckNameRequest; -import com.azure.resourcemanager.kusto.models.CheckNameResult; -import com.azure.resourcemanager.kusto.models.Reason; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AttachedDatabaseConfigurationsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"nameAvailable\":false,\"name\":\"sxjwwixz\",\"message\":\"mwmxqhndvnoamld\",\"reason\":\"AlreadyExists\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameResult response = - manager - .attachedDatabaseConfigurations() - .checkNameAvailabilityWithResponse( - "ziqgfuh", - "kzruswh", - new AttachedDatabaseConfigurationsCheckNameRequest().withName("hczznvf"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("sxjwwixz", response.name()); - Assertions.assertEquals("mwmxqhndvnoamld", response.message()); - Assertions.assertEquals(Reason.ALREADY_EXISTS, response.reason()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsCheckNameRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsCheckNameRequestTests.java deleted file mode 100644 index 8519c12b31a5..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsCheckNameRequestTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurationsCheckNameRequest; -import org.junit.jupiter.api.Assertions; - -public final class AttachedDatabaseConfigurationsCheckNameRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedDatabaseConfigurationsCheckNameRequest model = - BinaryData - .fromString("{\"name\":\"liourqhak\"}") - .toObject(AttachedDatabaseConfigurationsCheckNameRequest.class); - Assertions.assertEquals("liourqhak", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedDatabaseConfigurationsCheckNameRequest model = - new AttachedDatabaseConfigurationsCheckNameRequest().withName("liourqhak"); - model = BinaryData.fromObject(model).toObject(AttachedDatabaseConfigurationsCheckNameRequest.class); - Assertions.assertEquals("liourqhak", model.name()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsCreateOrUpdateMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsCreateOrUpdateMockTests.java deleted file mode 100644 index 4710eb4be967..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfiguration; -import com.azure.resourcemanager.kusto.models.DefaultPrincipalsModificationKind; -import com.azure.resourcemanager.kusto.models.TableLevelSharingProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AttachedDatabaseConfigurationsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"lfbcgwgcl\",\"properties\":{\"provisioningState\":\"Succeeded\",\"databaseName\":\"bqinjipnwjfu\",\"clusterResourceId\":\"qlafcbahhpzpofoi\",\"attachedDatabaseNames\":[\"p\"],\"defaultPrincipalsModificationKind\":\"Union\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"kkholvdndvia\",\"ogphuartvtiu\"],\"tablesToExclude\":[\"fchnmnah\",\"nxhkxjqi\"],\"externalTablesToInclude\":[\"weooxffifhxwrs\",\"ewmozqvbu\",\"qmamhsycxhxzga\"],\"externalTablesToExclude\":[\"abo\",\"dvmfqhppub\",\"w\"],\"materializedViewsToInclude\":[\"dfgkmtdh\",\"rngbtcjuahokqtob\",\"auxofshfph\",\"pnulaiywzej\"],\"materializedViewsToExclude\":[\"slwkojpl\"],\"functionsToInclude\":[\"npdwr\",\"qafgfugsnnfhyet\",\"fypococtfjgti\"],\"functionsToExclude\":[\"vzuyturmlmu\",\"wolba\"]},\"databaseNameOverride\":\"ropions\",\"databaseNamePrefix\":\"nw\"},\"id\":\"ngajinnixjawrtmj\",\"name\":\"jmyccxlzhcoxov\",\"type\":\"ekhenl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AttachedDatabaseConfiguration response = - manager - .attachedDatabaseConfigurations() - .define("kqmhhaowjr") - .withExistingCluster("n", "hgovfgp") - .withRegion("vuporqzdfuydzv") - .withDatabaseName("cnqmxqpsw") - .withClusterResourceId("kmvkhl") - .withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind.NONE) - .withTableLevelSharingProperties( - new TableLevelSharingProperties() - .withTablesToInclude(Arrays.asList("mnzhrgmqg", "sxvpqcbfrmbodths")) - .withTablesToExclude(Arrays.asList("vriibakclacjfr", "xousxauzl", "vsg")) - .withExternalTablesToInclude(Arrays.asList("hqf", "izvu")) - .withExternalTablesToExclude(Arrays.asList("kjsvthnwpzteko")) - .withMaterializedViewsToInclude(Arrays.asList("ibiattg")) - .withMaterializedViewsToExclude(Arrays.asList("cfotangcfhnykzcu", "swvxwlmzqwmv", "xnjmxm")) - .withFunctionsToInclude(Arrays.asList("udtc", "clxyn", "dkvgfabuiyjibuzp")) - .withFunctionsToExclude(Arrays.asList("gneik", "pgoxgji"))) - .withDatabaseNameOverride("hibtozipqwjedmur") - .withDatabaseNamePrefix("x") - .create(); - - Assertions.assertEquals("lfbcgwgcl", response.location()); - Assertions.assertEquals("bqinjipnwjfu", response.databaseName()); - Assertions.assertEquals("qlafcbahhpzpofoi", response.clusterResourceId()); - Assertions.assertEquals(DefaultPrincipalsModificationKind.UNION, response.defaultPrincipalsModificationKind()); - Assertions.assertEquals("kkholvdndvia", response.tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions.assertEquals("fchnmnah", response.tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions - .assertEquals("weooxffifhxwrs", response.tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions.assertEquals("abo", response.tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions.assertEquals("dfgkmtdh", response.tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions.assertEquals("slwkojpl", response.tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions.assertEquals("npdwr", response.tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions.assertEquals("vzuyturmlmu", response.tableLevelSharingProperties().functionsToExclude().get(0)); - Assertions.assertEquals("ropions", response.databaseNameOverride()); - Assertions.assertEquals("nw", response.databaseNamePrefix()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsDeleteMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsDeleteMockTests.java deleted file mode 100644 index 4f590bc6a34c..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AttachedDatabaseConfigurationsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.attachedDatabaseConfigurations().delete("xtiv", "j", "nidibgqjxg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsGetWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index e363488ed419..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfiguration; -import com.azure.resourcemanager.kusto.models.DefaultPrincipalsModificationKind; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AttachedDatabaseConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"pqxpx\",\"properties\":{\"provisioningState\":\"Deleting\",\"databaseName\":\"ngjsaasi\",\"clusterResourceId\":\"xtmkzjvkviir\",\"attachedDatabaseNames\":[\"grwsdp\",\"ra\",\"zvzbglbyv\",\"ctctbrxkjz\"],\"defaultPrincipalsModificationKind\":\"Replace\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"fmsh\"],\"tablesToExclude\":[\"bkgozxwopdbydpi\",\"qaclnapxbiy\",\"nugj\",\"nfsm\"],\"externalTablesToInclude\":[\"tuxuuyilflq\",\"iquvrehm\",\"njhvsujztc\",\"ytqj\"],\"externalTablesToExclude\":[\"auunfprnjletlx\"],\"materializedViewsToInclude\":[\"pddouifamowaziyn\",\"nlqwzdvpiwhx\",\"szdtmaajquh\"],\"materializedViewsToExclude\":[\"lrjvmtyg\"],\"functionsToInclude\":[\"zyos\",\"spshckfkyjp\",\"sp\"],\"functionsToExclude\":[\"sdfppyogtie\",\"ujtv\"]},\"databaseNameOverride\":\"kcnyx\",\"databaseNamePrefix\":\"munjdxvglnkvx\"},\"id\":\"xpaglqivbgkc\",\"name\":\"khpzvuqdflv\",\"type\":\"niypfpubcpzg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AttachedDatabaseConfiguration response = - manager - .attachedDatabaseConfigurations() - .getWithResponse("rdhlis", "gwflq", "mpizru", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pqxpx", response.location()); - Assertions.assertEquals("ngjsaasi", response.databaseName()); - Assertions.assertEquals("xtmkzjvkviir", response.clusterResourceId()); - Assertions - .assertEquals(DefaultPrincipalsModificationKind.REPLACE, response.defaultPrincipalsModificationKind()); - Assertions.assertEquals("fmsh", response.tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions.assertEquals("bkgozxwopdbydpi", response.tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions.assertEquals("tuxuuyilflq", response.tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions - .assertEquals("auunfprnjletlx", response.tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions - .assertEquals( - "pddouifamowaziyn", response.tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions.assertEquals("lrjvmtyg", response.tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions.assertEquals("zyos", response.tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions.assertEquals("sdfppyogtie", response.tableLevelSharingProperties().functionsToExclude().get(0)); - Assertions.assertEquals("kcnyx", response.databaseNameOverride()); - Assertions.assertEquals("munjdxvglnkvx", response.databaseNamePrefix()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsListByClusterMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsListByClusterMockTests.java deleted file mode 100644 index c3a260151d59..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AttachedDatabaseConfigurationsListByClusterMockTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfiguration; -import com.azure.resourcemanager.kusto.models.DefaultPrincipalsModificationKind; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AttachedDatabaseConfigurationsListByClusterMockTests { - @Test - public void testListByCluster() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"e\",\"properties\":{\"provisioningState\":\"Running\",\"databaseName\":\"tag\",\"clusterResourceId\":\"tsxoatftgz\",\"attachedDatabaseNames\":[\"bs\",\"vefloccsrmozihmi\",\"g\",\"wtxxpkyjcx\"],\"defaultPrincipalsModificationKind\":\"Union\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"ytfmpc\",\"cil\",\"mcayk\"],\"tablesToExclude\":[\"oxuztrksx\",\"pndfcpfnznt\",\"jtwkjaos\"],\"externalTablesToInclude\":[\"zvoamktc\",\"iosmgbzahgxqdly\",\"tlt\",\"ap\"],\"externalTablesToExclude\":[\"zkatb\"],\"materializedViewsToInclude\":[\"znnbsoqeqalarvl\",\"gunbtgfebwlnbm\",\"yreeudz\",\"av\"],\"materializedViewsToExclude\":[\"qmjxlyyzglgouwtl\",\"jjyuojqtobax\"],\"functionsToInclude\":[\"ytunlbfjkwr\"],\"functionsToExclude\":[\"kqbh\",\"y\",\"qunjqh\"]},\"databaseNameOverride\":\"nxaulk\",\"databaseNamePrefix\":\"kdk\"},\"id\":\"fmjnnawtqa\",\"name\":\"pxuckpggq\",\"type\":\"wey\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .attachedDatabaseConfigurations() - .listByCluster("aohdjh", "flzokxco", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("e", response.iterator().next().location()); - Assertions.assertEquals("tag", response.iterator().next().databaseName()); - Assertions.assertEquals("tsxoatftgz", response.iterator().next().clusterResourceId()); - Assertions - .assertEquals( - DefaultPrincipalsModificationKind.UNION, - response.iterator().next().defaultPrincipalsModificationKind()); - Assertions - .assertEquals("ytfmpc", response.iterator().next().tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions - .assertEquals( - "oxuztrksx", response.iterator().next().tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions - .assertEquals( - "zvoamktc", response.iterator().next().tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions - .assertEquals( - "zkatb", response.iterator().next().tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions - .assertEquals( - "znnbsoqeqalarvl", - response.iterator().next().tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions - .assertEquals( - "qmjxlyyzglgouwtl", - response.iterator().next().tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions - .assertEquals( - "ytunlbfjkwr", response.iterator().next().tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions - .assertEquals("kqbh", response.iterator().next().tableLevelSharingProperties().functionsToExclude().get(0)); - Assertions.assertEquals("nxaulk", response.iterator().next().databaseNameOverride()); - Assertions.assertEquals("kdk", response.iterator().next().databaseNamePrefix()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AzureCapacityTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AzureCapacityTests.java deleted file mode 100644 index c9a1e450b1a4..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AzureCapacityTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.AzureCapacity; -import com.azure.resourcemanager.kusto.models.AzureScaleType; -import org.junit.jupiter.api.Assertions; - -public final class AzureCapacityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureCapacity model = - BinaryData - .fromString( - "{\"scaleType\":\"none\",\"minimum\":1561651714,\"maximum\":17080551,\"default\":663876246}") - .toObject(AzureCapacity.class); - Assertions.assertEquals(AzureScaleType.NONE, model.scaleType()); - Assertions.assertEquals(1561651714, model.minimum()); - Assertions.assertEquals(17080551, model.maximum()); - Assertions.assertEquals(663876246, model.defaultProperty()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureCapacity model = - new AzureCapacity() - .withScaleType(AzureScaleType.NONE) - .withMinimum(1561651714) - .withMaximum(17080551) - .withDefaultProperty(663876246); - model = BinaryData.fromObject(model).toObject(AzureCapacity.class); - Assertions.assertEquals(AzureScaleType.NONE, model.scaleType()); - Assertions.assertEquals(1561651714, model.minimum()); - Assertions.assertEquals(17080551, model.maximum()); - Assertions.assertEquals(663876246, model.defaultProperty()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AzureResourceSkuInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AzureResourceSkuInnerTests.java deleted file mode 100644 index f8134af96fc3..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AzureResourceSkuInnerTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.AzureResourceSkuInner; -import com.azure.resourcemanager.kusto.models.AzureCapacity; -import com.azure.resourcemanager.kusto.models.AzureScaleType; -import com.azure.resourcemanager.kusto.models.AzureSku; -import com.azure.resourcemanager.kusto.models.AzureSkuName; -import com.azure.resourcemanager.kusto.models.AzureSkuTier; -import org.junit.jupiter.api.Assertions; - -public final class AzureResourceSkuInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceSkuInner model = - BinaryData - .fromString( - "{\"resourceType\":\"zceuojgjrw\",\"sku\":{\"name\":\"Standard_EC16ads_v5\",\"capacity\":1907813820,\"tier\":\"Basic\"},\"capacity\":{\"scaleType\":\"manual\",\"minimum\":1753683852,\"maximum\":54920560,\"default\":1848522994}}") - .toObject(AzureResourceSkuInner.class); - Assertions.assertEquals("zceuojgjrw", model.resourceType()); - Assertions.assertEquals(AzureSkuName.STANDARD_EC16ADS_V5, model.sku().name()); - Assertions.assertEquals(1907813820, model.sku().capacity()); - Assertions.assertEquals(AzureSkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals(AzureScaleType.MANUAL, model.capacity().scaleType()); - Assertions.assertEquals(1753683852, model.capacity().minimum()); - Assertions.assertEquals(54920560, model.capacity().maximum()); - Assertions.assertEquals(1848522994, model.capacity().defaultProperty()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceSkuInner model = - new AzureResourceSkuInner() - .withResourceType("zceuojgjrw") - .withSku( - new AzureSku() - .withName(AzureSkuName.STANDARD_EC16ADS_V5) - .withCapacity(1907813820) - .withTier(AzureSkuTier.BASIC)) - .withCapacity( - new AzureCapacity() - .withScaleType(AzureScaleType.MANUAL) - .withMinimum(1753683852) - .withMaximum(54920560) - .withDefaultProperty(1848522994)); - model = BinaryData.fromObject(model).toObject(AzureResourceSkuInner.class); - Assertions.assertEquals("zceuojgjrw", model.resourceType()); - Assertions.assertEquals(AzureSkuName.STANDARD_EC16ADS_V5, model.sku().name()); - Assertions.assertEquals(1907813820, model.sku().capacity()); - Assertions.assertEquals(AzureSkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals(AzureScaleType.MANUAL, model.capacity().scaleType()); - Assertions.assertEquals(1753683852, model.capacity().minimum()); - Assertions.assertEquals(54920560, model.capacity().maximum()); - Assertions.assertEquals(1848522994, model.capacity().defaultProperty()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AzureSkuTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AzureSkuTests.java deleted file mode 100644 index 244174f92537..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/AzureSkuTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.AzureSku; -import com.azure.resourcemanager.kusto.models.AzureSkuName; -import com.azure.resourcemanager.kusto.models.AzureSkuTier; -import org.junit.jupiter.api.Assertions; - -public final class AzureSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureSku model = - BinaryData - .fromString("{\"name\":\"Standard_E4d_v5\",\"capacity\":743792160,\"tier\":\"Basic\"}") - .toObject(AzureSku.class); - Assertions.assertEquals(AzureSkuName.STANDARD_E4D_V5, model.name()); - Assertions.assertEquals(743792160, model.capacity()); - Assertions.assertEquals(AzureSkuTier.BASIC, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureSku model = - new AzureSku().withName(AzureSkuName.STANDARD_E4D_V5).withCapacity(743792160).withTier(AzureSkuTier.BASIC); - model = BinaryData.fromObject(model).toObject(AzureSku.class); - Assertions.assertEquals(AzureSkuName.STANDARD_E4D_V5, model.name()); - Assertions.assertEquals(743792160, model.capacity()); - Assertions.assertEquals(AzureSkuTier.BASIC, model.tier()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CheckNameRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CheckNameRequestTests.java deleted file mode 100644 index 8e106245e592..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CheckNameRequestTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.CheckNameRequest; -import com.azure.resourcemanager.kusto.models.Type; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameRequest model = - BinaryData - .fromString("{\"name\":\"wkz\",\"type\":\"Microsoft.Kusto/clusters/databases\"}") - .toObject(CheckNameRequest.class); - Assertions.assertEquals("wkz", model.name()); - Assertions.assertEquals(Type.MICROSOFT_KUSTO_CLUSTERS_DATABASES, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameRequest model = - new CheckNameRequest().withName("wkz").withType(Type.MICROSOFT_KUSTO_CLUSTERS_DATABASES); - model = BinaryData.fromObject(model).toObject(CheckNameRequest.class); - Assertions.assertEquals("wkz", model.name()); - Assertions.assertEquals(Type.MICROSOFT_KUSTO_CLUSTERS_DATABASES, model.type()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CheckNameResultInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CheckNameResultInnerTests.java deleted file mode 100644 index e90885344791..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CheckNameResultInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; -import com.azure.resourcemanager.kusto.models.Reason; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameResultInner model = - BinaryData - .fromString( - "{\"nameAvailable\":false,\"name\":\"rkujy\",\"message\":\"l\",\"reason\":\"AlreadyExists\"}") - .toObject(CheckNameResultInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals("rkujy", model.name()); - Assertions.assertEquals("l", model.message()); - Assertions.assertEquals(Reason.ALREADY_EXISTS, model.reason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameResultInner model = - new CheckNameResultInner() - .withNameAvailable(false) - .withName("rkujy") - .withMessage("l") - .withReason(Reason.ALREADY_EXISTS); - model = BinaryData.fromObject(model).toObject(CheckNameResultInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals("rkujy", model.name()); - Assertions.assertEquals("l", model.message()); - Assertions.assertEquals(Reason.ALREADY_EXISTS, model.reason()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterCheckNameRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterCheckNameRequestTests.java deleted file mode 100644 index c99f74cedb49..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterCheckNameRequestTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.ClusterCheckNameRequest; -import org.junit.jupiter.api.Assertions; - -public final class ClusterCheckNameRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterCheckNameRequest model = - BinaryData.fromString("{\"name\":\"zlfmisgwbnbbeld\"}").toObject(ClusterCheckNameRequest.class); - Assertions.assertEquals("zlfmisgwbnbbeld", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterCheckNameRequest model = new ClusterCheckNameRequest().withName("zlfmisgwbnbbeld"); - model = BinaryData.fromObject(model).toObject(ClusterCheckNameRequest.class); - Assertions.assertEquals("zlfmisgwbnbbeld", model.name()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterMigrateRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterMigrateRequestTests.java deleted file mode 100644 index dd0a85573d37..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterMigrateRequestTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.ClusterMigrateRequest; -import org.junit.jupiter.api.Assertions; - -public final class ClusterMigrateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterMigrateRequest model = - BinaryData.fromString("{\"clusterResourceId\":\"algbquxigjyjg\"}").toObject(ClusterMigrateRequest.class); - Assertions.assertEquals("algbquxigjyjg", model.clusterResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterMigrateRequest model = new ClusterMigrateRequest().withClusterResourceId("algbquxigjyjg"); - model = BinaryData.fromObject(model).toObject(ClusterMigrateRequest.class); - Assertions.assertEquals("algbquxigjyjg", model.clusterResourceId()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentCheckNameRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentCheckNameRequestTests.java deleted file mode 100644 index 8431c7b34357..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentCheckNameRequestTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignmentCheckNameRequest; -import org.junit.jupiter.api.Assertions; - -public final class ClusterPrincipalAssignmentCheckNameRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterPrincipalAssignmentCheckNameRequest model = - BinaryData - .fromString("{\"name\":\"jaoyfhrtx\"}") - .toObject(ClusterPrincipalAssignmentCheckNameRequest.class); - Assertions.assertEquals("jaoyfhrtx", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterPrincipalAssignmentCheckNameRequest model = - new ClusterPrincipalAssignmentCheckNameRequest().withName("jaoyfhrtx"); - model = BinaryData.fromObject(model).toObject(ClusterPrincipalAssignmentCheckNameRequest.class); - Assertions.assertEquals("jaoyfhrtx", model.name()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentInnerTests.java deleted file mode 100644 index 91c501c0aeba..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentInnerTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.ClusterPrincipalAssignmentInner; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class ClusterPrincipalAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterPrincipalAssignmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"principalId\":\"fqawrlyxw\",\"role\":\"AllDatabasesAdmin\",\"tenantId\":\"prbnwbxgjvtbv\",\"principalType\":\"App\",\"tenantName\":\"szdnr\",\"principalName\":\"qguhmuo\",\"provisioningState\":\"Canceled\",\"aadObjectId\":\"rwzwbng\"},\"id\":\"itnwuizgazxufi\",\"name\":\"uckyf\",\"type\":\"hr\"}") - .toObject(ClusterPrincipalAssignmentInner.class); - Assertions.assertEquals("fqawrlyxw", model.principalId()); - Assertions.assertEquals(ClusterPrincipalRole.ALL_DATABASES_ADMIN, model.role()); - Assertions.assertEquals("prbnwbxgjvtbv", model.tenantId()); - Assertions.assertEquals(PrincipalType.APP, model.principalType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterPrincipalAssignmentInner model = - new ClusterPrincipalAssignmentInner() - .withPrincipalId("fqawrlyxw") - .withRole(ClusterPrincipalRole.ALL_DATABASES_ADMIN) - .withTenantId("prbnwbxgjvtbv") - .withPrincipalType(PrincipalType.APP); - model = BinaryData.fromObject(model).toObject(ClusterPrincipalAssignmentInner.class); - Assertions.assertEquals("fqawrlyxw", model.principalId()); - Assertions.assertEquals(ClusterPrincipalRole.ALL_DATABASES_ADMIN, model.role()); - Assertions.assertEquals("prbnwbxgjvtbv", model.tenantId()); - Assertions.assertEquals(PrincipalType.APP, model.principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentListResultTests.java deleted file mode 100644 index 6554832fdd77..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentListResultTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.ClusterPrincipalAssignmentInner; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignmentListResult; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClusterPrincipalAssignmentListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterPrincipalAssignmentListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"principalId\":\"cs\",\"role\":\"AllDatabasesAdmin\",\"tenantId\":\"mdwzjeiachboo\",\"principalType\":\"User\",\"tenantName\":\"nrosfqpte\",\"principalName\":\"zzvypyqrimzinp\",\"provisioningState\":\"Running\",\"aadObjectId\":\"dkirsoodqxhcr\"},\"id\":\"nohjt\",\"name\":\"kwh\",\"type\":\"soifiyipjxsqw\"}]}") - .toObject(ClusterPrincipalAssignmentListResult.class); - Assertions.assertEquals("cs", model.value().get(0).principalId()); - Assertions.assertEquals(ClusterPrincipalRole.ALL_DATABASES_ADMIN, model.value().get(0).role()); - Assertions.assertEquals("mdwzjeiachboo", model.value().get(0).tenantId()); - Assertions.assertEquals(PrincipalType.USER, model.value().get(0).principalType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterPrincipalAssignmentListResult model = - new ClusterPrincipalAssignmentListResult() - .withValue( - Arrays - .asList( - new ClusterPrincipalAssignmentInner() - .withPrincipalId("cs") - .withRole(ClusterPrincipalRole.ALL_DATABASES_ADMIN) - .withTenantId("mdwzjeiachboo") - .withPrincipalType(PrincipalType.USER))); - model = BinaryData.fromObject(model).toObject(ClusterPrincipalAssignmentListResult.class); - Assertions.assertEquals("cs", model.value().get(0).principalId()); - Assertions.assertEquals(ClusterPrincipalRole.ALL_DATABASES_ADMIN, model.value().get(0).role()); - Assertions.assertEquals("mdwzjeiachboo", model.value().get(0).tenantId()); - Assertions.assertEquals(PrincipalType.USER, model.value().get(0).principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsCheckNameAvailabilityWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index b9af38881efe..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.CheckNameResult; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignmentCheckNameRequest; -import com.azure.resourcemanager.kusto.models.Reason; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClusterPrincipalAssignmentsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"nameAvailable\":true,\"name\":\"zmlovuanash\",\"message\":\"lpmjerb\",\"reason\":\"AlreadyExists\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameResult response = - manager - .clusterPrincipalAssignments() - .checkNameAvailabilityWithResponse( - "z", - "ofizehtdhgbj", - new ClusterPrincipalAssignmentCheckNameRequest().withName("vreljea"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("zmlovuanash", response.name()); - Assertions.assertEquals("lpmjerb", response.message()); - Assertions.assertEquals(Reason.ALREADY_EXISTS, response.reason()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsCreateOrUpdateMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsCreateOrUpdateMockTests.java deleted file mode 100644 index ff832d74ff39..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignment; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClusterPrincipalAssignmentsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principalId\":\"zojhpctfnmd\",\"role\":\"AllDatabasesAdmin\",\"tenantId\":\"ngfdgugeyzihgrky\",\"principalType\":\"Group\",\"tenantName\":\"absnmfpp\",\"principalName\":\"jee\",\"provisioningState\":\"Succeeded\",\"aadObjectId\":\"hsgz\"},\"id\":\"czbgomfgbeg\",\"name\":\"qgleohibetnluank\",\"type\":\"rfxeeebtij\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ClusterPrincipalAssignment response = - manager - .clusterPrincipalAssignments() - .define("qspkcdqzhlctd") - .withExistingCluster("ttexoqqpwcyyufmh", "uncuw") - .withPrincipalId("nqndyfpchrqbn") - .withRole(ClusterPrincipalRole.ALL_DATABASES_ADMIN) - .withTenantId("cgegydcwbo") - .withPrincipalType(PrincipalType.GROUP) - .create(); - - Assertions.assertEquals("zojhpctfnmd", response.principalId()); - Assertions.assertEquals(ClusterPrincipalRole.ALL_DATABASES_ADMIN, response.role()); - Assertions.assertEquals("ngfdgugeyzihgrky", response.tenantId()); - Assertions.assertEquals(PrincipalType.GROUP, response.principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsDeleteMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsDeleteMockTests.java deleted file mode 100644 index 58ac7f7767bf..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClusterPrincipalAssignmentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .clusterPrincipalAssignments() - .delete("zab", "elawumu", "slzkwrrwoycqu", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsGetWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsGetWithResponseMockTests.java deleted file mode 100644 index 808e2f5148fe..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignment; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClusterPrincipalAssignmentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principalId\":\"puuw\",\"role\":\"AllDatabasesAdmin\",\"tenantId\":\"v\",\"principalType\":\"App\",\"tenantName\":\"ctzenkeifzzhmkd\",\"principalName\":\"vflyhbxcu\",\"provisioningState\":\"Moving\",\"aadObjectId\":\"gsrboldforobw\"},\"id\":\"lvizb\",\"name\":\"hfovvacqpbtu\",\"type\":\"dxe\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ClusterPrincipalAssignment response = - manager - .clusterPrincipalAssignments() - .getWithResponse("lvidizozs", "bccxjmonfdgn", "n", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("puuw", response.principalId()); - Assertions.assertEquals(ClusterPrincipalRole.ALL_DATABASES_ADMIN, response.role()); - Assertions.assertEquals("v", response.tenantId()); - Assertions.assertEquals(PrincipalType.APP, response.principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsListMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsListMockTests.java deleted file mode 100644 index cc68ba08ada5..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalAssignmentsListMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignment; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClusterPrincipalAssignmentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principalId\":\"vfuuru\",\"role\":\"AllDatabasesAdmin\",\"tenantId\":\"exxwlalniexzsrz\",\"principalType\":\"Group\",\"tenantName\":\"pqtybb\",\"principalName\":\"pgdakchzyvli\",\"provisioningState\":\"Running\",\"aadObjectId\":\"kcxk\"},\"id\":\"ibn\",\"name\":\"mysu\",\"type\":\"swqrntvlwijp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.clusterPrincipalAssignments().list("wyh", "hnomdrkywuh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vfuuru", response.iterator().next().principalId()); - Assertions.assertEquals(ClusterPrincipalRole.ALL_DATABASES_ADMIN, response.iterator().next().role()); - Assertions.assertEquals("exxwlalniexzsrz", response.iterator().next().tenantId()); - Assertions.assertEquals(PrincipalType.GROUP, response.iterator().next().principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalPropertiesTests.java deleted file mode 100644 index 1e963daa0dfd..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClusterPrincipalPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.ClusterPrincipalProperties; -import com.azure.resourcemanager.kusto.models.ClusterPrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class ClusterPrincipalPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterPrincipalProperties model = - BinaryData - .fromString( - "{\"principalId\":\"idf\",\"role\":\"AllDatabasesAdmin\",\"tenantId\":\"dzuhtymwi\",\"principalType\":\"Group\",\"tenantName\":\"fthwxmnteiwa\",\"principalName\":\"vkmijcmmxdcuf\",\"provisioningState\":\"Canceled\",\"aadObjectId\":\"pymzidnsezcxtbzs\"}") - .toObject(ClusterPrincipalProperties.class); - Assertions.assertEquals("idf", model.principalId()); - Assertions.assertEquals(ClusterPrincipalRole.ALL_DATABASES_ADMIN, model.role()); - Assertions.assertEquals("dzuhtymwi", model.tenantId()); - Assertions.assertEquals(PrincipalType.GROUP, model.principalType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterPrincipalProperties model = - new ClusterPrincipalProperties() - .withPrincipalId("idf") - .withRole(ClusterPrincipalRole.ALL_DATABASES_ADMIN) - .withTenantId("dzuhtymwi") - .withPrincipalType(PrincipalType.GROUP); - model = BinaryData.fromObject(model).toObject(ClusterPrincipalProperties.class); - Assertions.assertEquals("idf", model.principalId()); - Assertions.assertEquals(ClusterPrincipalRole.ALL_DATABASES_ADMIN, model.role()); - Assertions.assertEquals("dzuhtymwi", model.tenantId()); - Assertions.assertEquals(PrincipalType.GROUP, model.principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersAddLanguageExtensionsMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersAddLanguageExtensionsMockTests.java deleted file mode 100644 index 79ae47df86f6..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersAddLanguageExtensionsMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; -import com.azure.resourcemanager.kusto.models.LanguageExtensionImageName; -import com.azure.resourcemanager.kusto.models.LanguageExtensionName; -import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersAddLanguageExtensionsMockTests { - @Test - public void testAddLanguageExtensions() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .clusters() - .addLanguageExtensions( - "p", - "n", - new LanguageExtensionsList() - .withValue( - Arrays - .asList( - new LanguageExtensionInner() - .withLanguageExtensionName(LanguageExtensionName.PYTHON) - .withLanguageExtensionImageName(LanguageExtensionImageName.R))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersCheckNameAvailabilityWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index d2da43f77aa2..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.CheckNameResult; -import com.azure.resourcemanager.kusto.models.ClusterCheckNameRequest; -import com.azure.resourcemanager.kusto.models.Reason; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"nameAvailable\":true,\"name\":\"ccknfnwmbtmvp\",\"message\":\"jdhttzaefedxi\",\"reason\":\"AlreadyExists\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameResult response = - manager - .clusters() - .checkNameAvailabilityWithResponse( - "sfjbjsvg", new ClusterCheckNameRequest().withName("rwhryvycytd"), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("ccknfnwmbtmvp", response.name()); - Assertions.assertEquals("jdhttzaefedxi", response.message()); - Assertions.assertEquals(Reason.ALREADY_EXISTS, response.reason()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersDeleteMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersDeleteMockTests.java deleted file mode 100644 index 5724dec76d76..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusters().delete("mlqtmldgxob", "irclnpk", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersDetachFollowerDatabasesMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersDetachFollowerDatabasesMockTests.java deleted file mode 100644 index aeaa60865fbb..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersDetachFollowerDatabasesMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersDetachFollowerDatabasesMockTests { - @Test - public void testDetachFollowerDatabases() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .clusters() - .detachFollowerDatabases( - "r", - "fukiscvwmzhw", - new FollowerDatabaseDefinitionInner() - .withClusterResourceId("lefaxvxilcbtgn") - .withAttachedDatabaseConfigurationName("nzeyqxtjj"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersDiagnoseVirtualNetworkMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersDiagnoseVirtualNetworkMockTests.java deleted file mode 100644 index e98338e4882f..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersDiagnoseVirtualNetworkMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.DiagnoseVirtualNetworkResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersDiagnoseVirtualNetworkMockTests { - @Test - public void testDiagnoseVirtualNetwork() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"findings\":[\"yklxubyjaffmmfbl\",\"qcuubgqibrta\"]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DiagnoseVirtualNetworkResult response = - manager.clusters().diagnoseVirtualNetwork("xcvhrfs", "huagrttikteusqc", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("yklxubyjaffmmfbl", response.findings().get(0)); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListFollowerDatabasesMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListFollowerDatabasesMockTests.java deleted file mode 100644 index e30a5621e149..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListFollowerDatabasesMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.FollowerDatabaseDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersListFollowerDatabasesMockTests { - @Test - public void testListFollowerDatabases() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"clusterResourceId\":\"wva\",\"attachedDatabaseConfigurationName\":\"qyuvvfonkp\",\"databaseName\":\"qyikvy\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"avluwmncs\",\"tijfybvp\",\"ekrsgs\"],\"tablesToExclude\":[\"huzqgn\",\"dgkynscliqhzvhxn\",\"omtkub\"],\"externalTablesToInclude\":[\"pnvdxz\",\"hihfrbbcevqagtlt\"],\"externalTablesToExclude\":[\"fkqojpy\",\"vgtrdcnifmzzs\"],\"materializedViewsToInclude\":[\"brn\"],\"materializedViewsToExclude\":[\"xmprafwg\"],\"functionsToInclude\":[\"ocxvdfffwafqr\",\"udaspavehh\",\"vkbunzozudh\",\"xg\"],\"functionsToExclude\":[\"yxcdyuibhmfdnbzy\",\"vfvfcj\",\"aeoisrvh\"]},\"databaseShareOrigin\":\"Direct\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.clusters().listFollowerDatabases("a", "ysdzhez", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wva", response.iterator().next().clusterResourceId()); - Assertions.assertEquals("qyuvvfonkp", response.iterator().next().attachedDatabaseConfigurationName()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListLanguageExtensionsMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListLanguageExtensionsMockTests.java deleted file mode 100644 index 33be7212b9dd..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListLanguageExtensionsMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.LanguageExtension; -import com.azure.resourcemanager.kusto.models.LanguageExtensionImageName; -import com.azure.resourcemanager.kusto.models.LanguageExtensionName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersListLanguageExtensionsMockTests { - @Test - public void testListLanguageExtensions() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"languageExtensionName\":\"R\",\"languageExtensionImageName\":\"Python3_6_5\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.clusters().listLanguageExtensions("qzmiza", "a", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(LanguageExtensionName.R, response.iterator().next().languageExtensionName()); - Assertions - .assertEquals( - LanguageExtensionImageName.PYTHON3_6_5, response.iterator().next().languageExtensionImageName()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListOutboundNetworkDependenciesEndpointsMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListOutboundNetworkDependenciesEndpointsMockTests.java deleted file mode 100644 index 9a1d472f3c89..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListOutboundNetworkDependenciesEndpointsMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.OutboundNetworkDependenciesEndpoint; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersListOutboundNetworkDependenciesEndpointsMockTests { - @Test - public void testListOutboundNetworkDependenciesEndpoints() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"category\":\"hpfeoajvgcxtxjc\",\"endpoints\":[{\"domainName\":\"fidltug\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"mks\",\"endpointDetails\":[{}]},{\"domainName\":\"iftxfkf\",\"endpointDetails\":[{}]},{\"domainName\":\"rhptilluc\",\"endpointDetails\":[{},{},{}]}],\"provisioningState\":\"Moving\"},\"etag\":\"q\",\"id\":\"hm\",\"name\":\"wsldrizetpwbr\",\"type\":\"lllibph\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .clusters() - .listOutboundNetworkDependenciesEndpoints("hokvbwnh", "tqlgehgppi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hpfeoajvgcxtxjc", response.iterator().next().category()); - Assertions.assertEquals("fidltug", response.iterator().next().endpoints().get(0).domainName()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListSkusByResourceMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListSkusByResourceMockTests.java deleted file mode 100644 index c3e9e651b355..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListSkusByResourceMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.AzureResourceSku; -import com.azure.resourcemanager.kusto.models.AzureScaleType; -import com.azure.resourcemanager.kusto.models.AzureSkuName; -import com.azure.resourcemanager.kusto.models.AzureSkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersListSkusByResourceMockTests { - @Test - public void testListSkusByResource() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"resourceType\":\"kylkdghrj\",\"sku\":{\"name\":\"Standard_EC16as_v5+3TB_PS\",\"capacity\":1782916526,\"tier\":\"Standard\"},\"capacity\":{\"scaleType\":\"manual\",\"minimum\":102339077,\"maximum\":234998658,\"default\":442898580}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.clusters().listSkusByResource("rphkmcrjdqnsdfz", "bg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kylkdghrj", response.iterator().next().resourceType()); - Assertions.assertEquals(AzureSkuName.STANDARD_EC16AS_V5_3TB_PS, response.iterator().next().sku().name()); - Assertions.assertEquals(1782916526, response.iterator().next().sku().capacity()); - Assertions.assertEquals(AzureSkuTier.STANDARD, response.iterator().next().sku().tier()); - Assertions.assertEquals(AzureScaleType.MANUAL, response.iterator().next().capacity().scaleType()); - Assertions.assertEquals(102339077, response.iterator().next().capacity().minimum()); - Assertions.assertEquals(234998658, response.iterator().next().capacity().maximum()); - Assertions.assertEquals(442898580, response.iterator().next().capacity().defaultProperty()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListSkusMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListSkusMockTests.java deleted file mode 100644 index f5fc3555fd77..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersListSkusMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.SkuDescription; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersListSkusMockTests { - @Test - public void testListSkus() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"resourceType\":\"gqdnfwqzd\",\"name\":\"tilaxh\",\"tier\":\"hqlyvijo\",\"locations\":[\"vk\"],\"locationInfo\":[{\"location\":\"zunbixx\",\"zones\":[\"kvcpwpgclr\",\"ivtsoxfrkenxpm\"],\"zoneDetails\":[{\"name\":[\"pmpdn\",\"qskaw\",\"oqvm\"],\"capabilities\":[{},{},{},{}]}]},{\"location\":\"pqfrtqlkz\",\"zones\":[\"nitgvkxlz\",\"qdrfegcealzxwhc\",\"nsymoyqhlwigd\"],\"zoneDetails\":[{\"name\":[\"xgomfajuwa\",\"qvdaeyyguxakjsq\"],\"capabilities\":[{},{},{},{}]},{\"name\":[\"zkgimsid\",\"asi\"],\"capabilities\":[{},{},{},{}]},{\"name\":[\"vjskgfmoc\",\"ah\",\"qgatjeaahhvjhhn\",\"kzyb\"],\"capabilities\":[{}]}]},{\"location\":\"idjks\",\"zones\":[\"yxvxevblbjed\",\"ljlageuaulxu\",\"smjbnkppxyn\",\"nlsvxeiz\"],\"zoneDetails\":[{\"name\":[\"nsrmffeycx\",\"ktp\"],\"capabilities\":[{},{},{},{}]},{\"name\":[\"teeammxqiekkkzd\",\"rtkgdojbmxvavref\"],\"capabilities\":[{},{},{}]},{\"name\":[\"ecuijpxtxs\",\"wprtu\"],\"capabilities\":[{},{},{},{}]}]},{\"location\":\"awddjibab\",\"zones\":[\"titvtzeexavox\",\"fglecdmdqbwp\",\"pqtgsfjac\",\"slhhxudbxv\"],\"zoneDetails\":[{\"name\":[\"sirudhzmmesckdlp\",\"gzrcxfailcfxwmdb\"],\"capabilities\":[{},{},{},{}]},{\"name\":[\"sftufqobrjlna\",\"gcckknhxkizvytn\",\"zvulj\",\"aaeranokqgukk\"],\"capabilities\":[{},{},{}]}]}],\"restrictions\":[\"dataroylaxxu\",\"datacdisd\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.clusters().listSkus(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersMigrateMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersMigrateMockTests.java deleted file mode 100644 index f73f318032d6..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersMigrateMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.ClusterMigrateRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersMigrateMockTests { - @Test - public void testMigrate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .clusters() - .migrate( - "xqvkjlmxhomdyn", - "dwdigumb", - new ClusterMigrateRequest().withClusterResourceId("raauzzpt"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersRemoveLanguageExtensionsMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersRemoveLanguageExtensionsMockTests.java deleted file mode 100644 index 9bcfaa26d660..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersRemoveLanguageExtensionsMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; -import com.azure.resourcemanager.kusto.models.LanguageExtensionImageName; -import com.azure.resourcemanager.kusto.models.LanguageExtensionName; -import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersRemoveLanguageExtensionsMockTests { - @Test - public void testRemoveLanguageExtensions() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .clusters() - .removeLanguageExtensions( - "lhjlmuoyxprimr", - "opteecj", - new LanguageExtensionsList() - .withValue( - Arrays - .asList( - new LanguageExtensionInner() - .withLanguageExtensionName(LanguageExtensionName.PYTHON) - .withLanguageExtensionImageName(LanguageExtensionImageName.R), - new LanguageExtensionInner() - .withLanguageExtensionName(LanguageExtensionName.PYTHON) - .withLanguageExtensionImageName(LanguageExtensionImageName.PYTHON3_6_5))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersStartMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersStartMockTests.java deleted file mode 100644 index 7afb2208741d..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersStartMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersStartMockTests { - @Test - public void testStart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusters().start("wf", "jlb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersStopMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersStopMockTests.java deleted file mode 100644 index 148f1f14f9ea..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ClustersStopMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ClustersStopMockTests { - @Test - public void testStop() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusters().stop("iayz", "iykhy", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CosmosDbDataConnectionPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CosmosDbDataConnectionPropertiesTests.java deleted file mode 100644 index 9d4393014817..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CosmosDbDataConnectionPropertiesTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.CosmosDbDataConnectionProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class CosmosDbDataConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CosmosDbDataConnectionProperties model = - BinaryData - .fromString( - "{\"tableName\":\"behwagohb\",\"mappingRuleName\":\"fkmr\",\"managedIdentityResourceId\":\"emvvhm\",\"managedIdentityObjectId\":\"drjf\",\"cosmosDbAccountResourceId\":\"tac\",\"cosmosDbDatabase\":\"ebjvewzcjzn\",\"cosmosDbContainer\":\"wcpmguaadraufac\",\"retrievalStartDate\":\"2021-12-01T13:50:18Z\",\"provisioningState\":\"Creating\"}") - .toObject(CosmosDbDataConnectionProperties.class); - Assertions.assertEquals("behwagohb", model.tableName()); - Assertions.assertEquals("fkmr", model.mappingRuleName()); - Assertions.assertEquals("emvvhm", model.managedIdentityResourceId()); - Assertions.assertEquals("tac", model.cosmosDbAccountResourceId()); - Assertions.assertEquals("ebjvewzcjzn", model.cosmosDbDatabase()); - Assertions.assertEquals("wcpmguaadraufac", model.cosmosDbContainer()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T13:50:18Z"), model.retrievalStartDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CosmosDbDataConnectionProperties model = - new CosmosDbDataConnectionProperties() - .withTableName("behwagohb") - .withMappingRuleName("fkmr") - .withManagedIdentityResourceId("emvvhm") - .withCosmosDbAccountResourceId("tac") - .withCosmosDbDatabase("ebjvewzcjzn") - .withCosmosDbContainer("wcpmguaadraufac") - .withRetrievalStartDate(OffsetDateTime.parse("2021-12-01T13:50:18Z")); - model = BinaryData.fromObject(model).toObject(CosmosDbDataConnectionProperties.class); - Assertions.assertEquals("behwagohb", model.tableName()); - Assertions.assertEquals("fkmr", model.mappingRuleName()); - Assertions.assertEquals("emvvhm", model.managedIdentityResourceId()); - Assertions.assertEquals("tac", model.cosmosDbAccountResourceId()); - Assertions.assertEquals("ebjvewzcjzn", model.cosmosDbDatabase()); - Assertions.assertEquals("wcpmguaadraufac", model.cosmosDbContainer()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T13:50:18Z"), model.retrievalStartDate()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CosmosDbDataConnectionTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CosmosDbDataConnectionTests.java deleted file mode 100644 index 2c0a858f4d15..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/CosmosDbDataConnectionTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.CosmosDbDataConnection; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class CosmosDbDataConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CosmosDbDataConnection model = - BinaryData - .fromString( - "{\"kind\":\"CosmosDb\",\"properties\":{\"tableName\":\"obaiyhddviaceg\",\"mappingRuleName\":\"m\",\"managedIdentityResourceId\":\"tfpmvmemfnczdw\",\"managedIdentityObjectId\":\"b\",\"cosmosDbAccountResourceId\":\"lxlllchpo\",\"cosmosDbDatabase\":\"bzevwrd\",\"cosmosDbContainer\":\"hfuk\",\"retrievalStartDate\":\"2021-04-26T19:15:59Z\",\"provisioningState\":\"Moving\"},\"location\":\"wsmystuluqypf\",\"id\":\"vlerchpqbmfpjba\",\"name\":\"widf\",\"type\":\"xsspuunnoxyhk\"}") - .toObject(CosmosDbDataConnection.class); - Assertions.assertEquals("wsmystuluqypf", model.location()); - Assertions.assertEquals("obaiyhddviaceg", model.tableName()); - Assertions.assertEquals("m", model.mappingRuleName()); - Assertions.assertEquals("tfpmvmemfnczdw", model.managedIdentityResourceId()); - Assertions.assertEquals("lxlllchpo", model.cosmosDbAccountResourceId()); - Assertions.assertEquals("bzevwrd", model.cosmosDbDatabase()); - Assertions.assertEquals("hfuk", model.cosmosDbContainer()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-26T19:15:59Z"), model.retrievalStartDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CosmosDbDataConnection model = - new CosmosDbDataConnection() - .withLocation("wsmystuluqypf") - .withTableName("obaiyhddviaceg") - .withMappingRuleName("m") - .withManagedIdentityResourceId("tfpmvmemfnczdw") - .withCosmosDbAccountResourceId("lxlllchpo") - .withCosmosDbDatabase("bzevwrd") - .withCosmosDbContainer("hfuk") - .withRetrievalStartDate(OffsetDateTime.parse("2021-04-26T19:15:59Z")); - model = BinaryData.fromObject(model).toObject(CosmosDbDataConnection.class); - Assertions.assertEquals("wsmystuluqypf", model.location()); - Assertions.assertEquals("obaiyhddviaceg", model.tableName()); - Assertions.assertEquals("m", model.mappingRuleName()); - Assertions.assertEquals("tfpmvmemfnczdw", model.managedIdentityResourceId()); - Assertions.assertEquals("lxlllchpo", model.cosmosDbAccountResourceId()); - Assertions.assertEquals("bzevwrd", model.cosmosDbDatabase()); - Assertions.assertEquals("hfuk", model.cosmosDbContainer()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-26T19:15:59Z"), model.retrievalStartDate()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionCheckNameRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionCheckNameRequestTests.java deleted file mode 100644 index bdcf8eb2c89d..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionCheckNameRequestTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.DataConnectionCheckNameRequest; -import org.junit.jupiter.api.Assertions; - -public final class DataConnectionCheckNameRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataConnectionCheckNameRequest model = - BinaryData.fromString("{\"name\":\"wjchrdg\"}").toObject(DataConnectionCheckNameRequest.class); - Assertions.assertEquals("wjchrdg", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataConnectionCheckNameRequest model = new DataConnectionCheckNameRequest().withName("wjchrdg"); - model = BinaryData.fromObject(model).toObject(DataConnectionCheckNameRequest.class); - Assertions.assertEquals("wjchrdg", model.name()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionInnerTests.java deleted file mode 100644 index 2fc0f483b30c..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; -import org.junit.jupiter.api.Assertions; - -public final class DataConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataConnectionInner model = - BinaryData - .fromString( - "{\"kind\":\"DataConnection\",\"location\":\"ncyg\",\"id\":\"p\",\"name\":\"vipmdscwxqupevzh\",\"type\":\"stotxh\"}") - .toObject(DataConnectionInner.class); - Assertions.assertEquals("ncyg", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataConnectionInner model = new DataConnectionInner().withLocation("ncyg"); - model = BinaryData.fromObject(model).toObject(DataConnectionInner.class); - Assertions.assertEquals("ncyg", model.location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionListResultTests.java deleted file mode 100644 index f5fea91db8a9..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionListResultTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; -import com.azure.resourcemanager.kusto.models.DataConnectionListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataConnectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"kind\":\"DataConnection\",\"location\":\"zxnfaaz\",\"id\":\"xdtnkdmkqjjlw\",\"name\":\"envrkpyouaibrebq\",\"type\":\"aysjkixqtnqttez\"},{\"kind\":\"DataConnection\",\"location\":\"fffiak\",\"id\":\"jpqqmted\",\"name\":\"tmmjihyeozph\",\"type\":\"wau\"}]}") - .toObject(DataConnectionListResult.class); - Assertions.assertEquals("zxnfaaz", model.value().get(0).location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataConnectionListResult model = - new DataConnectionListResult() - .withValue( - Arrays - .asList( - new DataConnectionInner().withLocation("zxnfaaz"), - new DataConnectionInner().withLocation("fffiak"))); - model = BinaryData.fromObject(model).toObject(DataConnectionListResult.class); - Assertions.assertEquals("zxnfaaz", model.value().get(0).location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionValidationInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionValidationInnerTests.java deleted file mode 100644 index 42afc0c10447..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionValidationInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; -import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationInner; -import org.junit.jupiter.api.Assertions; - -public final class DataConnectionValidationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataConnectionValidationInner model = - BinaryData - .fromString( - "{\"dataConnectionName\":\"ujbypelmcuvhixb\",\"properties\":{\"kind\":\"DataConnection\",\"location\":\"fw\",\"id\":\"yl\",\"name\":\"coolsttpkiwkkb\",\"type\":\"ujrywvtyl\"}}") - .toObject(DataConnectionValidationInner.class); - Assertions.assertEquals("ujbypelmcuvhixb", model.dataConnectionName()); - Assertions.assertEquals("fw", model.properties().location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataConnectionValidationInner model = - new DataConnectionValidationInner() - .withDataConnectionName("ujbypelmcuvhixb") - .withProperties(new DataConnectionInner().withLocation("fw")); - model = BinaryData.fromObject(model).toObject(DataConnectionValidationInner.class); - Assertions.assertEquals("ujbypelmcuvhixb", model.dataConnectionName()); - Assertions.assertEquals("fw", model.properties().location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionValidationListResultInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionValidationListResultInnerTests.java deleted file mode 100644 index 48cd8c7ad1c0..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionValidationListResultInnerTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationListResultInner; -import com.azure.resourcemanager.kusto.models.DataConnectionValidationResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataConnectionValidationListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataConnectionValidationListResultInner model = - BinaryData - .fromString("{\"value\":[{\"errorMessage\":\"curdoiwiitht\"},{\"errorMessage\":\"ubxcbihw\"}]}") - .toObject(DataConnectionValidationListResultInner.class); - Assertions.assertEquals("curdoiwiitht", model.value().get(0).errorMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataConnectionValidationListResultInner model = - new DataConnectionValidationListResultInner() - .withValue( - Arrays - .asList( - new DataConnectionValidationResult().withErrorMessage("curdoiwiitht"), - new DataConnectionValidationResult().withErrorMessage("ubxcbihw"))); - model = BinaryData.fromObject(model).toObject(DataConnectionValidationListResultInner.class); - Assertions.assertEquals("curdoiwiitht", model.value().get(0).errorMessage()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionValidationResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionValidationResultTests.java deleted file mode 100644 index 86a9469dd0d1..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionValidationResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.DataConnectionValidationResult; -import org.junit.jupiter.api.Assertions; - -public final class DataConnectionValidationResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataConnectionValidationResult model = - BinaryData.fromString("{\"errorMessage\":\"nfdn\"}").toObject(DataConnectionValidationResult.class); - Assertions.assertEquals("nfdn", model.errorMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataConnectionValidationResult model = new DataConnectionValidationResult().withErrorMessage("nfdn"); - model = BinaryData.fromObject(model).toObject(DataConnectionValidationResult.class); - Assertions.assertEquals("nfdn", model.errorMessage()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsCheckNameAvailabilityWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index 2d9040e5dd3a..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.CheckNameResult; -import com.azure.resourcemanager.kusto.models.DataConnectionCheckNameRequest; -import com.azure.resourcemanager.kusto.models.Reason; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataConnectionsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"nameAvailable\":true,\"name\":\"qyzqedikdfrdb\",\"message\":\"mrjgeihfqlggwfi\",\"reason\":\"AlreadyExists\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameResult response = - manager - .dataConnections() - .checkNameAvailabilityWithResponse( - "jpmcub", - "mifoxxkub", - "phavpmhbrb", - new DataConnectionCheckNameRequest().withName("gvgovpbbttefjo"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("qyzqedikdfrdb", response.name()); - Assertions.assertEquals("mrjgeihfqlggwfi", response.message()); - Assertions.assertEquals(Reason.ALREADY_EXISTS, response.reason()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsCreateOrUpdateMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsCreateOrUpdateMockTests.java deleted file mode 100644 index ad6dec680823..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; -import com.azure.resourcemanager.kusto.models.DataConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataConnectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"kind\":\"DataConnection\",\"location\":\"msplzgaufcshhvn\",\"id\":\"wgnxkympqanxrj\",\"name\":\"ixt\",\"type\":\"bta\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataConnection response = - manager - .dataConnections() - .createOrUpdate( - "rxwtoaukhfkvc", - "sizmoae", - "sx", - "wuived", - new DataConnectionInner().withLocation("gyeewxeiq"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("msplzgaufcshhvn", response.location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsDataConnectionValidationMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsDataConnectionValidationMockTests.java deleted file mode 100644 index 140a5e068276..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsDataConnectionValidationMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; -import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationInner; -import com.azure.resourcemanager.kusto.models.DataConnectionValidationListResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataConnectionsDataConnectionValidationMockTests { - @Test - public void testDataConnectionValidation() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"errorMessage\":\"qwahoi\"},{\"errorMessage\":\"wgniipr\"},{\"errorMessage\":\"vawuwzdufypivlsb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataConnectionValidationListResult response = - manager - .dataConnections() - .dataConnectionValidation( - "emmucfxh", - "kkflrmymyincqlhr", - "s", - new DataConnectionValidationInner() - .withDataConnectionName("lmiiiovg") - .withProperties(new DataConnectionInner().withLocation("xuugqkc")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qwahoi", response.value().get(0).errorMessage()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsDeleteMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsDeleteMockTests.java deleted file mode 100644 index 61c6cfd45111..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.dataConnections().delete("rkihcirld", "fx", "dcoxnbk", "ja", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsGetWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsGetWithResponseMockTests.java deleted file mode 100644 index ce4120ef7e33..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.DataConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"kind\":\"DataConnection\",\"location\":\"xhnpo\",\"id\":\"yqwcabvnuil\",\"name\":\"ey\",\"type\":\"swlpaugmrmfj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataConnection response = - manager - .dataConnections() - .getWithResponse("xmjpbyep", "mgtvlj", "rc", "yfqi", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xhnpo", response.location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsListByDatabaseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsListByDatabaseMockTests.java deleted file mode 100644 index cf2909451c2b..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsListByDatabaseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.DataConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataConnectionsListByDatabaseMockTests { - @Test - public void testListByDatabase() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"kind\":\"DataConnection\",\"location\":\"jdjltymkmvgui\",\"id\":\"ywart\",\"name\":\"pphkixkykxds\",\"type\":\"j\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .dataConnections() - .listByDatabase("piudeugfsxzecpa", "wkufykhvuhxepm", "utznabaobns", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jdjltymkmvgui", response.iterator().next().location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsUpdateMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsUpdateMockTests.java deleted file mode 100644 index 6b8677fec825..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DataConnectionsUpdateMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; -import com.azure.resourcemanager.kusto.models.DataConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataConnectionsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"kind\":\"DataConnection\",\"location\":\"p\",\"id\":\"bkdq\",\"name\":\"rdzsylollgtrczzy\",\"type\":\"mxzjijpvua\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataConnection response = - manager - .dataConnections() - .update( - "ypnyghshxc", - "lhkgmnsghp", - "ycphdrwjjkhvyo", - "ac", - new DataConnectionInner().withLocation("zvxnqmhrp"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("p", response.location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseInnerTests.java deleted file mode 100644 index 2743ae60fd53..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseInner model = - BinaryData - .fromString( - "{\"kind\":\"Database\",\"location\":\"iplrbpbewtghfgb\",\"id\":\"c\",\"name\":\"wxzvlvqhjkb\",\"type\":\"gibtnm\"}") - .toObject(DatabaseInner.class); - Assertions.assertEquals("iplrbpbewtghfgb", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseInner model = new DatabaseInner().withLocation("iplrbpbewtghfgb"); - model = BinaryData.fromObject(model).toObject(DatabaseInner.class); - Assertions.assertEquals("iplrbpbewtghfgb", model.location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseInviteFollowerRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseInviteFollowerRequestTests.java deleted file mode 100644 index cc2c71961849..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseInviteFollowerRequestTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.DatabaseInviteFollowerRequest; -import com.azure.resourcemanager.kusto.models.TableLevelSharingProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseInviteFollowerRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseInviteFollowerRequest model = - BinaryData - .fromString( - "{\"inviteeEmail\":\"iebwwaloayqcgwrt\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"gwyzm\"],\"tablesToExclude\":[\"ongmtsa\",\"jcbpwxqpsrknft\",\"uvriuhprwm\",\"yvxqtayriwwroy\"],\"externalTablesToInclude\":[\"xrmcqibycnojvk\",\"mefqsgzvahapjyzh\",\"vgqzcjrvxd\",\"zlmwlxkvugfhz\"],\"externalTablesToExclude\":[\"wjvzunluthnn\",\"rnxipei\",\"pjzu\",\"e\"],\"materializedViewsToInclude\":[\"ultskzbbtdz\",\"mv\"],\"materializedViewsToExclude\":[\"gpw\",\"zuhkfpbsjyof\"],\"functionsToInclude\":[\"uusdttouwa\"],\"functionsToExclude\":[\"kqvkelnsmvbxwyjs\",\"lh\"]}}") - .toObject(DatabaseInviteFollowerRequest.class); - Assertions.assertEquals("iebwwaloayqcgwrt", model.inviteeEmail()); - Assertions.assertEquals("gwyzm", model.tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions.assertEquals("ongmtsa", model.tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions.assertEquals("xrmcqibycnojvk", model.tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions.assertEquals("wjvzunluthnn", model.tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions.assertEquals("ultskzbbtdz", model.tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions.assertEquals("gpw", model.tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions.assertEquals("uusdttouwa", model.tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions.assertEquals("kqvkelnsmvbxwyjs", model.tableLevelSharingProperties().functionsToExclude().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseInviteFollowerRequest model = - new DatabaseInviteFollowerRequest() - .withInviteeEmail("iebwwaloayqcgwrt") - .withTableLevelSharingProperties( - new TableLevelSharingProperties() - .withTablesToInclude(Arrays.asList("gwyzm")) - .withTablesToExclude(Arrays.asList("ongmtsa", "jcbpwxqpsrknft", "uvriuhprwm", "yvxqtayriwwroy")) - .withExternalTablesToInclude( - Arrays.asList("xrmcqibycnojvk", "mefqsgzvahapjyzh", "vgqzcjrvxd", "zlmwlxkvugfhz")) - .withExternalTablesToExclude(Arrays.asList("wjvzunluthnn", "rnxipei", "pjzu", "e")) - .withMaterializedViewsToInclude(Arrays.asList("ultskzbbtdz", "mv")) - .withMaterializedViewsToExclude(Arrays.asList("gpw", "zuhkfpbsjyof")) - .withFunctionsToInclude(Arrays.asList("uusdttouwa")) - .withFunctionsToExclude(Arrays.asList("kqvkelnsmvbxwyjs", "lh"))); - model = BinaryData.fromObject(model).toObject(DatabaseInviteFollowerRequest.class); - Assertions.assertEquals("iebwwaloayqcgwrt", model.inviteeEmail()); - Assertions.assertEquals("gwyzm", model.tableLevelSharingProperties().tablesToInclude().get(0)); - Assertions.assertEquals("ongmtsa", model.tableLevelSharingProperties().tablesToExclude().get(0)); - Assertions.assertEquals("xrmcqibycnojvk", model.tableLevelSharingProperties().externalTablesToInclude().get(0)); - Assertions.assertEquals("wjvzunluthnn", model.tableLevelSharingProperties().externalTablesToExclude().get(0)); - Assertions.assertEquals("ultskzbbtdz", model.tableLevelSharingProperties().materializedViewsToInclude().get(0)); - Assertions.assertEquals("gpw", model.tableLevelSharingProperties().materializedViewsToExclude().get(0)); - Assertions.assertEquals("uusdttouwa", model.tableLevelSharingProperties().functionsToInclude().get(0)); - Assertions.assertEquals("kqvkelnsmvbxwyjs", model.tableLevelSharingProperties().functionsToExclude().get(0)); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseInviteFollowerResultInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseInviteFollowerResultInnerTests.java deleted file mode 100644 index 0eb3464e50dc..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseInviteFollowerResultInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DatabaseInviteFollowerResultInner; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseInviteFollowerResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseInviteFollowerResultInner model = - BinaryData - .fromString("{\"generatedInvitation\":\"aalnjixi\"}") - .toObject(DatabaseInviteFollowerResultInner.class); - Assertions.assertEquals("aalnjixi", model.generatedInvitation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseInviteFollowerResultInner model = - new DatabaseInviteFollowerResultInner().withGeneratedInvitation("aalnjixi"); - model = BinaryData.fromObject(model).toObject(DatabaseInviteFollowerResultInner.class); - Assertions.assertEquals("aalnjixi", model.generatedInvitation()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseListResultTests.java deleted file mode 100644 index 081f3eb4f67d..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseListResultTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; -import com.azure.resourcemanager.kusto.models.DatabaseListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseListResult model = - BinaryData - .fromString( - "{\"nextLink\":\"txnrjaw\",\"value\":[{\"kind\":\"Database\",\"location\":\"xhniskxfbkpycgk\",\"id\":\"wndnhj\",\"name\":\"auwhvylwzbtdhx\",\"type\":\"jznb\"},{\"kind\":\"Database\",\"location\":\"ow\",\"id\":\"wpr\",\"name\":\"qlveualupjmkh\",\"type\":\"xobbcswsrt\"}]}") - .toObject(DatabaseListResult.class); - Assertions.assertEquals("txnrjaw", model.nextLink()); - Assertions.assertEquals("xhniskxfbkpycgk", model.value().get(0).location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseListResult model = - new DatabaseListResult() - .withNextLink("txnrjaw") - .withValue( - Arrays - .asList( - new DatabaseInner().withLocation("xhniskxfbkpycgk"), - new DatabaseInner().withLocation("ow"))); - model = BinaryData.fromObject(model).toObject(DatabaseListResult.class); - Assertions.assertEquals("txnrjaw", model.nextLink()); - Assertions.assertEquals("xhniskxfbkpycgk", model.value().get(0).location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseOperationsInviteFollowerWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseOperationsInviteFollowerWithResponseMockTests.java deleted file mode 100644 index e5f2b4ee1252..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseOperationsInviteFollowerWithResponseMockTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.DatabaseInviteFollowerRequest; -import com.azure.resourcemanager.kusto.models.DatabaseInviteFollowerResult; -import com.azure.resourcemanager.kusto.models.TableLevelSharingProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabaseOperationsInviteFollowerWithResponseMockTests { - @Test - public void testInviteFollowerWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"generatedInvitation\":\"ntacn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DatabaseInviteFollowerResult response = - manager - .databaseOperations() - .inviteFollowerWithResponse( - "nlaxpunjqikcz", - "vitac", - "xmfcsserxhtv", - new DatabaseInviteFollowerRequest() - .withInviteeEmail("oxhlw") - .withTableLevelSharingProperties( - new TableLevelSharingProperties() - .withTablesToInclude(Arrays.asList("gqrsxypruuu")) - .withTablesToExclude(Arrays.asList("chrszi", "oyuelyetn", "nb")) - .withExternalTablesToInclude(Arrays.asList("ggagfln", "gm", "rwahzjmucftbyr")) - .withExternalTablesToExclude(Arrays.asList("ohkpigqfu", "u", "kzmkwklsnoxaxmqe")) - .withMaterializedViewsToInclude(Arrays.asList("h", "jnhgwydyyn")) - .withMaterializedViewsToExclude(Arrays.asList("khgb")) - .withFunctionsToInclude(Arrays.asList("anarfdlpukhpyrne")) - .withFunctionsToExclude(Arrays.asList("cpeogkhnmgbrou", "ddbhf", "pfpazjzoywjxhpdu"))), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ntacn", response.generatedInvitation()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentCheckNameRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentCheckNameRequestTests.java deleted file mode 100644 index 42ebc0718ec3..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentCheckNameRequestTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignmentCheckNameRequest; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePrincipalAssignmentCheckNameRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabasePrincipalAssignmentCheckNameRequest model = - BinaryData.fromString("{\"name\":\"xyawj\"}").toObject(DatabasePrincipalAssignmentCheckNameRequest.class); - Assertions.assertEquals("xyawj", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabasePrincipalAssignmentCheckNameRequest model = - new DatabasePrincipalAssignmentCheckNameRequest().withName("xyawj"); - model = BinaryData.fromObject(model).toObject(DatabasePrincipalAssignmentCheckNameRequest.class); - Assertions.assertEquals("xyawj", model.name()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentInnerTests.java deleted file mode 100644 index ecbe4be9fc18..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentInnerTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalAssignmentInner; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePrincipalAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabasePrincipalAssignmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"principalId\":\"aq\",\"role\":\"UnrestrictedViewer\",\"tenantId\":\"yjpkiidzyexz\",\"principalType\":\"App\",\"tenantName\":\"ixhnrztf\",\"principalName\":\"hb\",\"provisioningState\":\"Canceled\",\"aadObjectId\":\"alaulppggdtpnapn\"},\"id\":\"iropuhpigvpgylg\",\"name\":\"git\",\"type\":\"medjvcslynqwwncw\"}") - .toObject(DatabasePrincipalAssignmentInner.class); - Assertions.assertEquals("aq", model.principalId()); - Assertions.assertEquals(DatabasePrincipalRole.UNRESTRICTED_VIEWER, model.role()); - Assertions.assertEquals("yjpkiidzyexz", model.tenantId()); - Assertions.assertEquals(PrincipalType.APP, model.principalType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabasePrincipalAssignmentInner model = - new DatabasePrincipalAssignmentInner() - .withPrincipalId("aq") - .withRole(DatabasePrincipalRole.UNRESTRICTED_VIEWER) - .withTenantId("yjpkiidzyexz") - .withPrincipalType(PrincipalType.APP); - model = BinaryData.fromObject(model).toObject(DatabasePrincipalAssignmentInner.class); - Assertions.assertEquals("aq", model.principalId()); - Assertions.assertEquals(DatabasePrincipalRole.UNRESTRICTED_VIEWER, model.role()); - Assertions.assertEquals("yjpkiidzyexz", model.tenantId()); - Assertions.assertEquals(PrincipalType.APP, model.principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentListResultTests.java deleted file mode 100644 index dce07f703082..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentListResultTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalAssignmentInner; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignmentListResult; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePrincipalAssignmentListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabasePrincipalAssignmentListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"principalId\":\"dahzxctobg\",\"role\":\"Ingestor\",\"tenantId\":\"moizpos\",\"principalType\":\"Group\",\"tenantName\":\"rcfbunrm\",\"principalName\":\"jhhkxbp\",\"provisioningState\":\"Running\",\"aadObjectId\":\"jhxxjyn\"},\"id\":\"u\",\"name\":\"ivkrtsw\",\"type\":\"xqzvszjfa\"},{\"properties\":{\"principalId\":\"j\",\"role\":\"User\",\"tenantId\":\"xivetvt\",\"principalType\":\"User\",\"tenantName\":\"qtdo\",\"principalName\":\"cbxvwvxyslqbh\",\"provisioningState\":\"Succeeded\",\"aadObjectId\":\"blytk\"},\"id\":\"lmpewwwfbkr\",\"name\":\"rn\",\"type\":\"vshqjohxcr\"},{\"properties\":{\"principalId\":\"fovasr\",\"role\":\"Viewer\",\"tenantId\":\"wbhsqfsub\",\"principalType\":\"App\",\"tenantName\":\"birx\",\"principalName\":\"ybsrfbjfdtwss\",\"provisioningState\":\"Running\",\"aadObjectId\":\"pvjzbe\"},\"id\":\"ilzznfqqnvwp\",\"name\":\"qtaruoujmkcjhwq\",\"type\":\"tjrybnwjewgdr\"},{\"properties\":{\"principalId\":\"rvnaenqpeh\",\"role\":\"UnrestrictedViewer\",\"tenantId\":\"oygmift\",\"principalType\":\"Group\",\"tenantName\":\"d\",\"principalName\":\"sl\",\"provisioningState\":\"Canceled\",\"aadObjectId\":\"qig\"},\"id\":\"nduhavhqlkthum\",\"name\":\"qolbgyc\",\"type\":\"uie\"}]}") - .toObject(DatabasePrincipalAssignmentListResult.class); - Assertions.assertEquals("dahzxctobg", model.value().get(0).principalId()); - Assertions.assertEquals(DatabasePrincipalRole.INGESTOR, model.value().get(0).role()); - Assertions.assertEquals("moizpos", model.value().get(0).tenantId()); - Assertions.assertEquals(PrincipalType.GROUP, model.value().get(0).principalType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabasePrincipalAssignmentListResult model = - new DatabasePrincipalAssignmentListResult() - .withValue( - Arrays - .asList( - new DatabasePrincipalAssignmentInner() - .withPrincipalId("dahzxctobg") - .withRole(DatabasePrincipalRole.INGESTOR) - .withTenantId("moizpos") - .withPrincipalType(PrincipalType.GROUP), - new DatabasePrincipalAssignmentInner() - .withPrincipalId("j") - .withRole(DatabasePrincipalRole.USER) - .withTenantId("xivetvt") - .withPrincipalType(PrincipalType.USER), - new DatabasePrincipalAssignmentInner() - .withPrincipalId("fovasr") - .withRole(DatabasePrincipalRole.VIEWER) - .withTenantId("wbhsqfsub") - .withPrincipalType(PrincipalType.APP), - new DatabasePrincipalAssignmentInner() - .withPrincipalId("rvnaenqpeh") - .withRole(DatabasePrincipalRole.UNRESTRICTED_VIEWER) - .withTenantId("oygmift") - .withPrincipalType(PrincipalType.GROUP))); - model = BinaryData.fromObject(model).toObject(DatabasePrincipalAssignmentListResult.class); - Assertions.assertEquals("dahzxctobg", model.value().get(0).principalId()); - Assertions.assertEquals(DatabasePrincipalRole.INGESTOR, model.value().get(0).role()); - Assertions.assertEquals("moizpos", model.value().get(0).tenantId()); - Assertions.assertEquals(PrincipalType.GROUP, model.value().get(0).principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsCheckNameAvailabilityWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index d3fbe449d877..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.CheckNameResult; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignmentCheckNameRequest; -import com.azure.resourcemanager.kusto.models.Reason; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasePrincipalAssignmentsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"nameAvailable\":true,\"name\":\"lnvnafvvkyfedev\",\"message\":\"oslc\",\"reason\":\"Invalid\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameResult response = - manager - .databasePrincipalAssignments() - .checkNameAvailabilityWithResponse( - "qwtehtuevr", - "rljyoogwxhnsdu", - "gwbsreurf", - new DatabasePrincipalAssignmentCheckNameRequest().withName("kfuarenlv"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("lnvnafvvkyfedev", response.name()); - Assertions.assertEquals("oslc", response.message()); - Assertions.assertEquals(Reason.INVALID, response.reason()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsCreateOrUpdateMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsCreateOrUpdateMockTests.java deleted file mode 100644 index 41b038fd1578..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignment; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasePrincipalAssignmentsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principalId\":\"kcudfbsfarfsiowl\",\"role\":\"Monitor\",\"tenantId\":\"nqpvwgfstmhqykiz\",\"principalType\":\"Group\",\"tenantName\":\"saoafcluqvox\",\"principalName\":\"cjimryvwgcwwpbmz\",\"provisioningState\":\"Succeeded\",\"aadObjectId\":\"ydsx\"},\"id\":\"efoh\",\"name\":\"cbvopwndyqleallk\",\"type\":\"mtkhlowkxxpvbr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DatabasePrincipalAssignment response = - manager - .databasePrincipalAssignments() - .define("fdmmcpug") - .withExistingDatabase("yyrmfsvbp", "vbopfppdbwnu", "gahxkumasjcaa") - .withPrincipalId("hqepvufhbzehewh") - .withRole(DatabasePrincipalRole.ADMIN) - .withTenantId("nlbqnbldxeaclg") - .withPrincipalType(PrincipalType.USER) - .create(); - - Assertions.assertEquals("kcudfbsfarfsiowl", response.principalId()); - Assertions.assertEquals(DatabasePrincipalRole.MONITOR, response.role()); - Assertions.assertEquals("nqpvwgfstmhqykiz", response.tenantId()); - Assertions.assertEquals(PrincipalType.GROUP, response.principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsDeleteMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsDeleteMockTests.java deleted file mode 100644 index f3b8eadcfac2..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasePrincipalAssignmentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .databasePrincipalAssignments() - .delete("lobdxna", "pmkmlmvevfx", "op", "hbzxli", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsGetWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsGetWithResponseMockTests.java deleted file mode 100644 index 841367ea60a5..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignment; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasePrincipalAssignmentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principalId\":\"aqdtvqecrqctmxxd\",\"role\":\"Ingestor\",\"tenantId\":\"mflhuytxzvtznapx\",\"principalType\":\"App\",\"tenantName\":\"novv\",\"principalName\":\"czytprwn\",\"provisioningState\":\"Canceled\",\"aadObjectId\":\"ev\"},\"id\":\"tlyo\",\"name\":\"rrrouuxvnsa\",\"type\":\"bcrymodizrx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DatabasePrincipalAssignment response = - manager - .databasePrincipalAssignments() - .getWithResponse("p", "kkhminqcymczngn", "dxxewuninv", "db", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("aqdtvqecrqctmxxd", response.principalId()); - Assertions.assertEquals(DatabasePrincipalRole.INGESTOR, response.role()); - Assertions.assertEquals("mflhuytxzvtznapx", response.tenantId()); - Assertions.assertEquals(PrincipalType.APP, response.principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsListMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsListMockTests.java deleted file mode 100644 index 19fa89c176d4..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalAssignmentsListMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignment; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasePrincipalAssignmentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principalId\":\"apqofyuicdhz\",\"role\":\"Viewer\",\"tenantId\":\"bwwg\",\"principalType\":\"App\",\"tenantName\":\"ibidmhmwffp\",\"principalName\":\"muvapc\",\"provisioningState\":\"Deleting\",\"aadObjectId\":\"rv\"},\"id\":\"eyoxoyyukphai\",\"name\":\"moiroqb\",\"type\":\"shbraga\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .databasePrincipalAssignments() - .list("hrdd", "tfgxqbawpcb", "nzqcy", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("apqofyuicdhz", response.iterator().next().principalId()); - Assertions.assertEquals(DatabasePrincipalRole.VIEWER, response.iterator().next().role()); - Assertions.assertEquals("bwwg", response.iterator().next().tenantId()); - Assertions.assertEquals(PrincipalType.APP, response.iterator().next().principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalInnerTests.java deleted file mode 100644 index 12d1df5b2d29..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalInnerTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePrincipalInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabasePrincipalInner model = - BinaryData - .fromString( - "{\"role\":\"Viewer\",\"name\":\"kqze\",\"type\":\"Group\",\"fqn\":\"dltfz\",\"email\":\"hhvh\",\"appId\":\"r\",\"tenantName\":\"dkwobdagx\"}") - .toObject(DatabasePrincipalInner.class); - Assertions.assertEquals(DatabasePrincipalRole.VIEWER, model.role()); - Assertions.assertEquals("kqze", model.name()); - Assertions.assertEquals(DatabasePrincipalType.GROUP, model.type()); - Assertions.assertEquals("dltfz", model.fqn()); - Assertions.assertEquals("hhvh", model.email()); - Assertions.assertEquals("r", model.appId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabasePrincipalInner model = - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.VIEWER) - .withName("kqze") - .withType(DatabasePrincipalType.GROUP) - .withFqn("dltfz") - .withEmail("hhvh") - .withAppId("r"); - model = BinaryData.fromObject(model).toObject(DatabasePrincipalInner.class); - Assertions.assertEquals(DatabasePrincipalRole.VIEWER, model.role()); - Assertions.assertEquals("kqze", model.name()); - Assertions.assertEquals(DatabasePrincipalType.GROUP, model.type()); - Assertions.assertEquals("dltfz", model.fqn()); - Assertions.assertEquals("hhvh", model.email()); - Assertions.assertEquals("r", model.appId()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalListRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalListRequestTests.java deleted file mode 100644 index 4c41a51a9a71..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalListRequestTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalListRequest; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePrincipalListRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabasePrincipalListRequest model = - BinaryData - .fromString( - "{\"value\":[{\"role\":\"Viewer\",\"name\":\"dxbx\",\"type\":\"App\",\"fqn\":\"bogqxndlkzgxhu\",\"email\":\"plbpodxun\",\"appId\":\"ebxmubyynt\",\"tenantName\":\"rbqtkoie\"},{\"role\":\"User\",\"name\":\"eotg\",\"type\":\"User\",\"fqn\":\"ltmuwlauwzizx\",\"email\":\"pgcjefuzmuvp\",\"appId\":\"tdum\",\"tenantName\":\"p\"}]}") - .toObject(DatabasePrincipalListRequest.class); - Assertions.assertEquals(DatabasePrincipalRole.VIEWER, model.value().get(0).role()); - Assertions.assertEquals("dxbx", model.value().get(0).name()); - Assertions.assertEquals(DatabasePrincipalType.APP, model.value().get(0).type()); - Assertions.assertEquals("bogqxndlkzgxhu", model.value().get(0).fqn()); - Assertions.assertEquals("plbpodxun", model.value().get(0).email()); - Assertions.assertEquals("ebxmubyynt", model.value().get(0).appId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabasePrincipalListRequest model = - new DatabasePrincipalListRequest() - .withValue( - Arrays - .asList( - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.VIEWER) - .withName("dxbx") - .withType(DatabasePrincipalType.APP) - .withFqn("bogqxndlkzgxhu") - .withEmail("plbpodxun") - .withAppId("ebxmubyynt"), - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.USER) - .withName("eotg") - .withType(DatabasePrincipalType.USER) - .withFqn("ltmuwlauwzizx") - .withEmail("pgcjefuzmuvp") - .withAppId("tdum"))); - model = BinaryData.fromObject(model).toObject(DatabasePrincipalListRequest.class); - Assertions.assertEquals(DatabasePrincipalRole.VIEWER, model.value().get(0).role()); - Assertions.assertEquals("dxbx", model.value().get(0).name()); - Assertions.assertEquals(DatabasePrincipalType.APP, model.value().get(0).type()); - Assertions.assertEquals("bogqxndlkzgxhu", model.value().get(0).fqn()); - Assertions.assertEquals("plbpodxun", model.value().get(0).email()); - Assertions.assertEquals("ebxmubyynt", model.value().get(0).appId()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalListResultInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalListResultInnerTests.java deleted file mode 100644 index 0d38f0b781af..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalListResultInnerTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; -import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalListResultInner; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePrincipalListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabasePrincipalListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"role\":\"Admin\",\"name\":\"cym\",\"type\":\"Group\",\"fqn\":\"l\",\"email\":\"slqlfmmdn\",\"appId\":\"glzpswiydm\",\"tenantName\":\"yhz\"},{\"role\":\"Ingestor\",\"name\":\"ss\",\"type\":\"Group\",\"fqn\":\"zmnvdfznudaod\",\"email\":\"zbn\",\"appId\":\"lylpstdb\",\"tenantName\":\"xsrz\"},{\"role\":\"User\",\"name\":\"ucerscdntnevfi\",\"type\":\"Group\",\"fqn\":\"ygtdsslswt\",\"email\":\"eriofzpyqs\",\"appId\":\"wab\",\"tenantName\":\"tshhszhedp\"},{\"role\":\"Viewer\",\"name\":\"wiwubm\",\"type\":\"User\",\"fqn\":\"esl\",\"email\":\"k\",\"appId\":\"tppjflcx\",\"tenantName\":\"aokonzmnsik\"}]}") - .toObject(DatabasePrincipalListResultInner.class); - Assertions.assertEquals(DatabasePrincipalRole.ADMIN, model.value().get(0).role()); - Assertions.assertEquals("cym", model.value().get(0).name()); - Assertions.assertEquals(DatabasePrincipalType.GROUP, model.value().get(0).type()); - Assertions.assertEquals("l", model.value().get(0).fqn()); - Assertions.assertEquals("slqlfmmdn", model.value().get(0).email()); - Assertions.assertEquals("glzpswiydm", model.value().get(0).appId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabasePrincipalListResultInner model = - new DatabasePrincipalListResultInner() - .withValue( - Arrays - .asList( - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.ADMIN) - .withName("cym") - .withType(DatabasePrincipalType.GROUP) - .withFqn("l") - .withEmail("slqlfmmdn") - .withAppId("glzpswiydm"), - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.INGESTOR) - .withName("ss") - .withType(DatabasePrincipalType.GROUP) - .withFqn("zmnvdfznudaod") - .withEmail("zbn") - .withAppId("lylpstdb"), - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.USER) - .withName("ucerscdntnevfi") - .withType(DatabasePrincipalType.GROUP) - .withFqn("ygtdsslswt") - .withEmail("eriofzpyqs") - .withAppId("wab"), - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.VIEWER) - .withName("wiwubm") - .withType(DatabasePrincipalType.USER) - .withFqn("esl") - .withEmail("k") - .withAppId("tppjflcx"))); - model = BinaryData.fromObject(model).toObject(DatabasePrincipalListResultInner.class); - Assertions.assertEquals(DatabasePrincipalRole.ADMIN, model.value().get(0).role()); - Assertions.assertEquals("cym", model.value().get(0).name()); - Assertions.assertEquals(DatabasePrincipalType.GROUP, model.value().get(0).type()); - Assertions.assertEquals("l", model.value().get(0).fqn()); - Assertions.assertEquals("slqlfmmdn", model.value().get(0).email()); - Assertions.assertEquals("glzpswiydm", model.value().get(0).appId()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalPropertiesTests.java deleted file mode 100644 index e2fe1b9b9488..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasePrincipalPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalProperties; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePrincipalPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabasePrincipalProperties model = - BinaryData - .fromString( - "{\"principalId\":\"zhxgktrmgucn\",\"role\":\"UnrestrictedViewer\",\"tenantId\":\"t\",\"principalType\":\"App\",\"tenantName\":\"llwptfdy\",\"principalName\":\"fqbuaceopzf\",\"provisioningState\":\"Succeeded\",\"aadObjectId\":\"uaopppcqeq\"}") - .toObject(DatabasePrincipalProperties.class); - Assertions.assertEquals("zhxgktrmgucn", model.principalId()); - Assertions.assertEquals(DatabasePrincipalRole.UNRESTRICTED_VIEWER, model.role()); - Assertions.assertEquals("t", model.tenantId()); - Assertions.assertEquals(PrincipalType.APP, model.principalType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabasePrincipalProperties model = - new DatabasePrincipalProperties() - .withPrincipalId("zhxgktrmgucn") - .withRole(DatabasePrincipalRole.UNRESTRICTED_VIEWER) - .withTenantId("t") - .withPrincipalType(PrincipalType.APP); - model = BinaryData.fromObject(model).toObject(DatabasePrincipalProperties.class); - Assertions.assertEquals("zhxgktrmgucn", model.principalId()); - Assertions.assertEquals(DatabasePrincipalRole.UNRESTRICTED_VIEWER, model.role()); - Assertions.assertEquals("t", model.tenantId()); - Assertions.assertEquals(PrincipalType.APP, model.principalType()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseStatisticsTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseStatisticsTests.java deleted file mode 100644 index ee3b5bb7722a..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabaseStatisticsTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.DatabaseStatistics; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseStatisticsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseStatistics model = BinaryData.fromString("{\"size\":23.999287}").toObject(DatabaseStatistics.class); - Assertions.assertEquals(23.999287F, model.size()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseStatistics model = new DatabaseStatistics().withSize(23.999287F); - model = BinaryData.fromObject(model).toObject(DatabaseStatistics.class); - Assertions.assertEquals(23.999287F, model.size()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesAddPrincipalsWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesAddPrincipalsWithResponseMockTests.java deleted file mode 100644 index 14243a3efef3..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesAddPrincipalsWithResponseMockTests.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalListRequest; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalListResult; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesAddPrincipalsWithResponseMockTests { - @Test - public void testAddPrincipalsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"role\":\"UnrestrictedViewer\",\"name\":\"vwbcblembnkbwv\",\"type\":\"Group\",\"fqn\":\"kdi\",\"email\":\"ihebwtsw\",\"appId\":\"uwfmduragegizvc\",\"tenantName\":\"elisdjub\"},{\"role\":\"Admin\",\"name\":\"bqigkx\",\"type\":\"Group\",\"fqn\":\"azgakg\",\"email\":\"yrcmjdmspofap\",\"appId\":\"hryl\",\"tenantName\":\"ofrzgb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DatabasePrincipalListResult response = - manager - .databases() - .addPrincipalsWithResponse( - "zxrvxcus", - "sphaivmxyasflvg", - "gzwywak", - new DatabasePrincipalListRequest() - .withValue( - Arrays - .asList( - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.USER) - .withName("nsmjbl") - .withType(DatabasePrincipalType.GROUP) - .withFqn("hlnymzotq") - .withEmail("yuzcbmqqvxmvw") - .withAppId("tayx"), - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.MONITOR) - .withName("lzqnhcvs") - .withType(DatabasePrincipalType.USER) - .withFqn("nzoibgsxgnx") - .withEmail("qonmpqoxwdof") - .withAppId("xiqxeiiqbimh"))), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(DatabasePrincipalRole.UNRESTRICTED_VIEWER, response.value().get(0).role()); - Assertions.assertEquals("vwbcblembnkbwv", response.value().get(0).name()); - Assertions.assertEquals(DatabasePrincipalType.GROUP, response.value().get(0).type()); - Assertions.assertEquals("kdi", response.value().get(0).fqn()); - Assertions.assertEquals("ihebwtsw", response.value().get(0).email()); - Assertions.assertEquals("uwfmduragegizvc", response.value().get(0).appId()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesCheckNameAvailabilityWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index 4029c70b14a5..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.CheckNameRequest; -import com.azure.resourcemanager.kusto.models.CheckNameResult; -import com.azure.resourcemanager.kusto.models.Reason; -import com.azure.resourcemanager.kusto.models.Type; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"nameAvailable\":false,\"name\":\"kwv\",\"message\":\"nzvdfbzdixzmq\",\"reason\":\"AlreadyExists\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameResult response = - manager - .databases() - .checkNameAvailabilityWithResponse( - "vkzqk", - "jeokbzefezrxccz", - new CheckNameRequest() - .withName("rtle") - .withType(Type.MICROSOFT_KUSTO_CLUSTERS_ATTACHED_DATABASE_CONFIGURATIONS), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals("kwv", response.name()); - Assertions.assertEquals("nzvdfbzdixzmq", response.message()); - Assertions.assertEquals(Reason.ALREADY_EXISTS, response.reason()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesCreateOrUpdateMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesCreateOrUpdateMockTests.java deleted file mode 100644 index 91c681888f3e..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; -import com.azure.resourcemanager.kusto.models.CallerRole; -import com.azure.resourcemanager.kusto.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"kind\":\"Database\",\"location\":\"nm\",\"id\":\"jng\",\"name\":\"qdqx\",\"type\":\"bjwgnyfus\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .createOrUpdate( - "wexjkmfxapjwogq", - "nobpudcdabtqwpw", - "awbzasqb", - new DatabaseInner().withLocation("ljgkyex"), - CallerRole.ADMIN, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nm", response.location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesDeleteMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesDeleteMockTests.java deleted file mode 100644 index c967312b7c00..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.databases().delete("lxecwcrojphslh", "awjutifd", "fmvigorqjbttzh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesGetWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesGetWithResponseMockTests.java deleted file mode 100644 index 4d33938d54a1..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"kind\":\"Database\",\"location\":\"hzvechndbnwieho\",\"id\":\"ewjwiuubw\",\"name\":\"fqsfa\",\"type\":\"aqtferr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .getWithResponse("mo", "ayzejnhlbkpbz", "cpilj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("hzvechndbnwieho", response.location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesListByClusterMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesListByClusterMockTests.java deleted file mode 100644 index 5aaa7f660b1c..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesListByClusterMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesListByClusterMockTests { - @Test - public void testListByCluster() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"kind\":\"Database\",\"location\":\"lbiojlvfhrb\",\"id\":\"pn\",\"name\":\"qvcww\",\"type\":\"yurmochpprprs\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .databases() - .listByCluster("d", "wopqhewjptmcgs", 888576031, "stzelndlatut", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lbiojlvfhrb", response.iterator().next().location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesListPrincipalsMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesListPrincipalsMockTests.java deleted file mode 100644 index 1cb1a0cd5611..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesListPrincipalsMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.DatabasePrincipal; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesListPrincipalsMockTests { - @Test - public void testListPrincipals() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"role\":\"Viewer\",\"name\":\"p\",\"type\":\"User\",\"fqn\":\"xelnwc\",\"email\":\"yjede\",\"appId\":\"mlfmkqs\",\"tenantName\":\"zuawxtzxpuamwa\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.databases().listPrincipals("aglkafhon", "juj", "ickpz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(DatabasePrincipalRole.VIEWER, response.iterator().next().role()); - Assertions.assertEquals("p", response.iterator().next().name()); - Assertions.assertEquals(DatabasePrincipalType.USER, response.iterator().next().type()); - Assertions.assertEquals("xelnwc", response.iterator().next().fqn()); - Assertions.assertEquals("yjede", response.iterator().next().email()); - Assertions.assertEquals("mlfmkqs", response.iterator().next().appId()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesRemovePrincipalsWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesRemovePrincipalsWithResponseMockTests.java deleted file mode 100644 index 5002b961257c..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesRemovePrincipalsWithResponseMockTests.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalListRequest; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalListResult; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; -import com.azure.resourcemanager.kusto.models.DatabasePrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesRemovePrincipalsWithResponseMockTests { - @Test - public void testRemovePrincipalsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"role\":\"Viewer\",\"name\":\"aqutdewemxswvruu\",\"type\":\"App\",\"fqn\":\"jgehkf\",\"email\":\"m\",\"appId\":\"ixokffqyin\",\"tenantName\":\"qepqwhixmon\"},{\"role\":\"Admin\",\"name\":\"shiy\",\"type\":\"App\",\"fqn\":\"elfclducc\",\"email\":\"rds\",\"appId\":\"wcobie\",\"tenantName\":\"tmninw\"},{\"role\":\"Ingestor\",\"name\":\"zcilnghg\",\"type\":\"Group\",\"fqn\":\"jjtbxqmuluxlxqz\",\"email\":\"ers\",\"appId\":\"cucrwnamikze\",\"tenantName\":\"qbsms\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DatabasePrincipalListResult response = - manager - .databases() - .removePrincipalsWithResponse( - "jed", - "st", - "vnlvxbcuiiznktwf", - new DatabasePrincipalListRequest() - .withValue( - Arrays - .asList( - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.UNRESTRICTED_VIEWER) - .withName("v") - .withType(DatabasePrincipalType.USER) - .withFqn("bmikost") - .withEmail("bkiw") - .withAppId("qnyophzfyls"), - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.ADMIN) - .withName("zelfwyfwl") - .withType(DatabasePrincipalType.APP) - .withFqn("wetnpsihc") - .withEmail("fzvaylptr") - .withAppId("qwztcmwqkc"), - new DatabasePrincipalInner() - .withRole(DatabasePrincipalRole.ADMIN) - .withName("fdeqvhpsyl") - .withType(DatabasePrincipalType.GROUP) - .withFqn("hkbffmbm") - .withEmail("jrgywwpgjxsn") - .withAppId("fujg"))), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(DatabasePrincipalRole.VIEWER, response.value().get(0).role()); - Assertions.assertEquals("aqutdewemxswvruu", response.value().get(0).name()); - Assertions.assertEquals(DatabasePrincipalType.APP, response.value().get(0).type()); - Assertions.assertEquals("jgehkf", response.value().get(0).fqn()); - Assertions.assertEquals("m", response.value().get(0).email()); - Assertions.assertEquals("ixokffqyin", response.value().get(0).appId()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesUpdateMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesUpdateMockTests.java deleted file mode 100644 index f489210e83d9..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DatabasesUpdateMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; -import com.azure.resourcemanager.kusto.models.CallerRole; -import com.azure.resourcemanager.kusto.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesUpdateMockTests { - @Test - public void testUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"kind\":\"Database\",\"location\":\"zid\",\"id\":\"xwaabzmifrygznmm\",\"name\":\"xrizkzobgop\",\"type\":\"lhslnelxieixyn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .update( - "zsvtuikzhajqgl", - "fh", - "l", - new DatabaseInner().withLocation("ryxynqnzrd"), - CallerRole.ADMIN, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zid", response.location()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DiagnoseVirtualNetworkResultInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DiagnoseVirtualNetworkResultInnerTests.java deleted file mode 100644 index 732991ada6f3..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/DiagnoseVirtualNetworkResultInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.DiagnoseVirtualNetworkResultInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiagnoseVirtualNetworkResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnoseVirtualNetworkResultInner model = - BinaryData - .fromString("{\"findings\":[\"zj\",\"yggdtjixh\"]}") - .toObject(DiagnoseVirtualNetworkResultInner.class); - Assertions.assertEquals("zj", model.findings().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnoseVirtualNetworkResultInner model = - new DiagnoseVirtualNetworkResultInner().withFindings(Arrays.asList("zj", "yggdtjixh")); - model = BinaryData.fromObject(model).toObject(DiagnoseVirtualNetworkResultInner.class); - Assertions.assertEquals("zj", model.findings().get(0)); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EndpointDependencyTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EndpointDependencyTests.java deleted file mode 100644 index 7aa5627b1428..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EndpointDependencyTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.EndpointDependency; -import com.azure.resourcemanager.kusto.models.EndpointDetail; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EndpointDependencyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EndpointDependency model = - BinaryData - .fromString("{\"domainName\":\"kfzbeyvpnqicvi\",\"endpointDetails\":[{\"port\":273661642}]}") - .toObject(EndpointDependency.class); - Assertions.assertEquals("kfzbeyvpnqicvi", model.domainName()); - Assertions.assertEquals(273661642, model.endpointDetails().get(0).port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EndpointDependency model = - new EndpointDependency() - .withDomainName("kfzbeyvpnqicvi") - .withEndpointDetails(Arrays.asList(new EndpointDetail().withPort(273661642))); - model = BinaryData.fromObject(model).toObject(EndpointDependency.class); - Assertions.assertEquals("kfzbeyvpnqicvi", model.domainName()); - Assertions.assertEquals(273661642, model.endpointDetails().get(0).port()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EndpointDetailTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EndpointDetailTests.java deleted file mode 100644 index c5cf56e1fc41..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EndpointDetailTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.EndpointDetail; -import org.junit.jupiter.api.Assertions; - -public final class EndpointDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EndpointDetail model = BinaryData.fromString("{\"port\":611015935}").toObject(EndpointDetail.class); - Assertions.assertEquals(611015935, model.port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EndpointDetail model = new EndpointDetail().withPort(611015935); - model = BinaryData.fromObject(model).toObject(EndpointDetail.class); - Assertions.assertEquals(611015935, model.port()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventGridConnectionPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventGridConnectionPropertiesTests.java deleted file mode 100644 index e85bba33a155..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventGridConnectionPropertiesTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.EventGridConnectionProperties; -import com.azure.resourcemanager.kusto.models.BlobStorageEventType; -import com.azure.resourcemanager.kusto.models.DatabaseRouting; -import com.azure.resourcemanager.kusto.models.EventGridDataFormat; -import org.junit.jupiter.api.Assertions; - -public final class EventGridConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventGridConnectionProperties model = - BinaryData - .fromString( - "{\"storageAccountResourceId\":\"goo\",\"eventGridResourceId\":\"kqfqjbvl\",\"eventHubResourceId\":\"orfmluiqt\",\"consumerGroup\":\"zf\",\"tableName\":\"yvnqqybaryeuay\",\"mappingRuleName\":\"qabqgzslesjcb\",\"dataFormat\":\"AVRO\",\"ignoreFirstRecord\":false,\"blobStorageEventType\":\"Microsoft.Storage.BlobCreated\",\"managedIdentityResourceId\":\"w\",\"managedIdentityObjectId\":\"cv\",\"databaseRouting\":\"Multi\",\"provisioningState\":\"Succeeded\"}") - .toObject(EventGridConnectionProperties.class); - Assertions.assertEquals("goo", model.storageAccountResourceId()); - Assertions.assertEquals("kqfqjbvl", model.eventGridResourceId()); - Assertions.assertEquals("orfmluiqt", model.eventHubResourceId()); - Assertions.assertEquals("zf", model.consumerGroup()); - Assertions.assertEquals("yvnqqybaryeuay", model.tableName()); - Assertions.assertEquals("qabqgzslesjcb", model.mappingRuleName()); - Assertions.assertEquals(EventGridDataFormat.AVRO, model.dataFormat()); - Assertions.assertEquals(false, model.ignoreFirstRecord()); - Assertions.assertEquals(BlobStorageEventType.MICROSOFT_STORAGE_BLOB_CREATED, model.blobStorageEventType()); - Assertions.assertEquals("w", model.managedIdentityResourceId()); - Assertions.assertEquals(DatabaseRouting.MULTI, model.databaseRouting()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventGridConnectionProperties model = - new EventGridConnectionProperties() - .withStorageAccountResourceId("goo") - .withEventGridResourceId("kqfqjbvl") - .withEventHubResourceId("orfmluiqt") - .withConsumerGroup("zf") - .withTableName("yvnqqybaryeuay") - .withMappingRuleName("qabqgzslesjcb") - .withDataFormat(EventGridDataFormat.AVRO) - .withIgnoreFirstRecord(false) - .withBlobStorageEventType(BlobStorageEventType.MICROSOFT_STORAGE_BLOB_CREATED) - .withManagedIdentityResourceId("w") - .withDatabaseRouting(DatabaseRouting.MULTI); - model = BinaryData.fromObject(model).toObject(EventGridConnectionProperties.class); - Assertions.assertEquals("goo", model.storageAccountResourceId()); - Assertions.assertEquals("kqfqjbvl", model.eventGridResourceId()); - Assertions.assertEquals("orfmluiqt", model.eventHubResourceId()); - Assertions.assertEquals("zf", model.consumerGroup()); - Assertions.assertEquals("yvnqqybaryeuay", model.tableName()); - Assertions.assertEquals("qabqgzslesjcb", model.mappingRuleName()); - Assertions.assertEquals(EventGridDataFormat.AVRO, model.dataFormat()); - Assertions.assertEquals(false, model.ignoreFirstRecord()); - Assertions.assertEquals(BlobStorageEventType.MICROSOFT_STORAGE_BLOB_CREATED, model.blobStorageEventType()); - Assertions.assertEquals("w", model.managedIdentityResourceId()); - Assertions.assertEquals(DatabaseRouting.MULTI, model.databaseRouting()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventGridDataConnectionTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventGridDataConnectionTests.java deleted file mode 100644 index 12a8b4b9685d..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventGridDataConnectionTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.BlobStorageEventType; -import com.azure.resourcemanager.kusto.models.DatabaseRouting; -import com.azure.resourcemanager.kusto.models.EventGridDataConnection; -import com.azure.resourcemanager.kusto.models.EventGridDataFormat; -import org.junit.jupiter.api.Assertions; - -public final class EventGridDataConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventGridDataConnection model = - BinaryData - .fromString( - "{\"kind\":\"EventGrid\",\"properties\":{\"storageAccountResourceId\":\"fhjxakvvjgs\",\"eventGridResourceId\":\"r\",\"eventHubResourceId\":\"il\",\"consumerGroup\":\"yw\",\"tableName\":\"kgkxn\",\"mappingRuleName\":\"dabg\",\"dataFormat\":\"RAW\",\"ignoreFirstRecord\":true,\"blobStorageEventType\":\"Microsoft.Storage.BlobCreated\",\"managedIdentityResourceId\":\"wbcihxuuwh\",\"managedIdentityObjectId\":\"yxccyb\",\"databaseRouting\":\"Multi\",\"provisioningState\":\"Succeeded\"},\"location\":\"kudzpxgwj\",\"id\":\"lma\",\"name\":\"stcyohpfkyrkdbd\",\"type\":\"iogsjkmnwq\"}") - .toObject(EventGridDataConnection.class); - Assertions.assertEquals("kudzpxgwj", model.location()); - Assertions.assertEquals("fhjxakvvjgs", model.storageAccountResourceId()); - Assertions.assertEquals("r", model.eventGridResourceId()); - Assertions.assertEquals("il", model.eventHubResourceId()); - Assertions.assertEquals("yw", model.consumerGroup()); - Assertions.assertEquals("kgkxn", model.tableName()); - Assertions.assertEquals("dabg", model.mappingRuleName()); - Assertions.assertEquals(EventGridDataFormat.RAW, model.dataFormat()); - Assertions.assertEquals(true, model.ignoreFirstRecord()); - Assertions.assertEquals(BlobStorageEventType.MICROSOFT_STORAGE_BLOB_CREATED, model.blobStorageEventType()); - Assertions.assertEquals("wbcihxuuwh", model.managedIdentityResourceId()); - Assertions.assertEquals(DatabaseRouting.MULTI, model.databaseRouting()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventGridDataConnection model = - new EventGridDataConnection() - .withLocation("kudzpxgwj") - .withStorageAccountResourceId("fhjxakvvjgs") - .withEventGridResourceId("r") - .withEventHubResourceId("il") - .withConsumerGroup("yw") - .withTableName("kgkxn") - .withMappingRuleName("dabg") - .withDataFormat(EventGridDataFormat.RAW) - .withIgnoreFirstRecord(true) - .withBlobStorageEventType(BlobStorageEventType.MICROSOFT_STORAGE_BLOB_CREATED) - .withManagedIdentityResourceId("wbcihxuuwh") - .withDatabaseRouting(DatabaseRouting.MULTI); - model = BinaryData.fromObject(model).toObject(EventGridDataConnection.class); - Assertions.assertEquals("kudzpxgwj", model.location()); - Assertions.assertEquals("fhjxakvvjgs", model.storageAccountResourceId()); - Assertions.assertEquals("r", model.eventGridResourceId()); - Assertions.assertEquals("il", model.eventHubResourceId()); - Assertions.assertEquals("yw", model.consumerGroup()); - Assertions.assertEquals("kgkxn", model.tableName()); - Assertions.assertEquals("dabg", model.mappingRuleName()); - Assertions.assertEquals(EventGridDataFormat.RAW, model.dataFormat()); - Assertions.assertEquals(true, model.ignoreFirstRecord()); - Assertions.assertEquals(BlobStorageEventType.MICROSOFT_STORAGE_BLOB_CREATED, model.blobStorageEventType()); - Assertions.assertEquals("wbcihxuuwh", model.managedIdentityResourceId()); - Assertions.assertEquals(DatabaseRouting.MULTI, model.databaseRouting()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventHubConnectionPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventHubConnectionPropertiesTests.java deleted file mode 100644 index 343809d112e6..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventHubConnectionPropertiesTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.EventHubConnectionProperties; -import com.azure.resourcemanager.kusto.models.Compression; -import com.azure.resourcemanager.kusto.models.DatabaseRouting; -import com.azure.resourcemanager.kusto.models.EventHubDataFormat; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EventHubConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventHubConnectionProperties model = - BinaryData - .fromString( - "{\"eventHubResourceId\":\"prvkwcfzqljyxgtc\",\"consumerGroup\":\"heyd\",\"tableName\":\"dshmkxmaehvbbx\",\"mappingRuleName\":\"iplt\",\"dataFormat\":\"TSV\",\"eventSystemProperties\":[\"axkgx\"],\"compression\":\"None\",\"provisioningState\":\"Succeeded\",\"managedIdentityResourceId\":\"yklyhpluodpvruud\",\"managedIdentityObjectId\":\"zibt\",\"databaseRouting\":\"Single\",\"retrievalStartDate\":\"2021-02-15T06:11:31Z\"}") - .toObject(EventHubConnectionProperties.class); - Assertions.assertEquals("prvkwcfzqljyxgtc", model.eventHubResourceId()); - Assertions.assertEquals("heyd", model.consumerGroup()); - Assertions.assertEquals("dshmkxmaehvbbx", model.tableName()); - Assertions.assertEquals("iplt", model.mappingRuleName()); - Assertions.assertEquals(EventHubDataFormat.TSV, model.dataFormat()); - Assertions.assertEquals("axkgx", model.eventSystemProperties().get(0)); - Assertions.assertEquals(Compression.NONE, model.compression()); - Assertions.assertEquals("yklyhpluodpvruud", model.managedIdentityResourceId()); - Assertions.assertEquals(DatabaseRouting.SINGLE, model.databaseRouting()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T06:11:31Z"), model.retrievalStartDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventHubConnectionProperties model = - new EventHubConnectionProperties() - .withEventHubResourceId("prvkwcfzqljyxgtc") - .withConsumerGroup("heyd") - .withTableName("dshmkxmaehvbbx") - .withMappingRuleName("iplt") - .withDataFormat(EventHubDataFormat.TSV) - .withEventSystemProperties(Arrays.asList("axkgx")) - .withCompression(Compression.NONE) - .withManagedIdentityResourceId("yklyhpluodpvruud") - .withDatabaseRouting(DatabaseRouting.SINGLE) - .withRetrievalStartDate(OffsetDateTime.parse("2021-02-15T06:11:31Z")); - model = BinaryData.fromObject(model).toObject(EventHubConnectionProperties.class); - Assertions.assertEquals("prvkwcfzqljyxgtc", model.eventHubResourceId()); - Assertions.assertEquals("heyd", model.consumerGroup()); - Assertions.assertEquals("dshmkxmaehvbbx", model.tableName()); - Assertions.assertEquals("iplt", model.mappingRuleName()); - Assertions.assertEquals(EventHubDataFormat.TSV, model.dataFormat()); - Assertions.assertEquals("axkgx", model.eventSystemProperties().get(0)); - Assertions.assertEquals(Compression.NONE, model.compression()); - Assertions.assertEquals("yklyhpluodpvruud", model.managedIdentityResourceId()); - Assertions.assertEquals(DatabaseRouting.SINGLE, model.databaseRouting()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T06:11:31Z"), model.retrievalStartDate()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventHubDataConnectionTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventHubDataConnectionTests.java deleted file mode 100644 index c99bed6b092c..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/EventHubDataConnectionTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.Compression; -import com.azure.resourcemanager.kusto.models.DatabaseRouting; -import com.azure.resourcemanager.kusto.models.EventHubDataConnection; -import com.azure.resourcemanager.kusto.models.EventHubDataFormat; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EventHubDataConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventHubDataConnection model = - BinaryData - .fromString( - "{\"kind\":\"EventHub\",\"properties\":{\"eventHubResourceId\":\"ywdxsmic\",\"consumerGroup\":\"wrwfscjfnyns\",\"tableName\":\"ujiz\",\"mappingRuleName\":\"oqytibyowbblgy\",\"dataFormat\":\"CSV\",\"eventSystemProperties\":[\"thjoxoism\",\"ksbpimlqoljx\"],\"compression\":\"GZip\",\"provisioningState\":\"Running\",\"managedIdentityResourceId\":\"xsffgcviz\",\"managedIdentityObjectId\":\"dwl\",\"databaseRouting\":\"Multi\",\"retrievalStartDate\":\"2021-03-22T22:39:30Z\"},\"location\":\"pfgfbkjub\",\"id\":\"yhgk\",\"name\":\"minsgowzf\",\"type\":\"tsttktlahbq\"}") - .toObject(EventHubDataConnection.class); - Assertions.assertEquals("pfgfbkjub", model.location()); - Assertions.assertEquals("ywdxsmic", model.eventHubResourceId()); - Assertions.assertEquals("wrwfscjfnyns", model.consumerGroup()); - Assertions.assertEquals("ujiz", model.tableName()); - Assertions.assertEquals("oqytibyowbblgy", model.mappingRuleName()); - Assertions.assertEquals(EventHubDataFormat.CSV, model.dataFormat()); - Assertions.assertEquals("thjoxoism", model.eventSystemProperties().get(0)); - Assertions.assertEquals(Compression.GZIP, model.compression()); - Assertions.assertEquals("xsffgcviz", model.managedIdentityResourceId()); - Assertions.assertEquals(DatabaseRouting.MULTI, model.databaseRouting()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-22T22:39:30Z"), model.retrievalStartDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventHubDataConnection model = - new EventHubDataConnection() - .withLocation("pfgfbkjub") - .withEventHubResourceId("ywdxsmic") - .withConsumerGroup("wrwfscjfnyns") - .withTableName("ujiz") - .withMappingRuleName("oqytibyowbblgy") - .withDataFormat(EventHubDataFormat.CSV) - .withEventSystemProperties(Arrays.asList("thjoxoism", "ksbpimlqoljx")) - .withCompression(Compression.GZIP) - .withManagedIdentityResourceId("xsffgcviz") - .withDatabaseRouting(DatabaseRouting.MULTI) - .withRetrievalStartDate(OffsetDateTime.parse("2021-03-22T22:39:30Z")); - model = BinaryData.fromObject(model).toObject(EventHubDataConnection.class); - Assertions.assertEquals("pfgfbkjub", model.location()); - Assertions.assertEquals("ywdxsmic", model.eventHubResourceId()); - Assertions.assertEquals("wrwfscjfnyns", model.consumerGroup()); - Assertions.assertEquals("ujiz", model.tableName()); - Assertions.assertEquals("oqytibyowbblgy", model.mappingRuleName()); - Assertions.assertEquals(EventHubDataFormat.CSV, model.dataFormat()); - Assertions.assertEquals("thjoxoism", model.eventSystemProperties().get(0)); - Assertions.assertEquals(Compression.GZIP, model.compression()); - Assertions.assertEquals("xsffgcviz", model.managedIdentityResourceId()); - Assertions.assertEquals(DatabaseRouting.MULTI, model.databaseRouting()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-22T22:39:30Z"), model.retrievalStartDate()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/FollowerDatabaseDefinitionInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/FollowerDatabaseDefinitionInnerTests.java deleted file mode 100644 index 57ca33c43c82..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/FollowerDatabaseDefinitionInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; -import org.junit.jupiter.api.Assertions; - -public final class FollowerDatabaseDefinitionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FollowerDatabaseDefinitionInner model = - BinaryData - .fromString( - "{\"clusterResourceId\":\"mouexhdzx\",\"attachedDatabaseConfigurationName\":\"bqe\",\"databaseName\":\"nxqbzvddn\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"eic\",\"twnpzaoqvuhrhcf\",\"cyddglmjthjqk\"],\"tablesToExclude\":[\"eicxmqciwqvhkhi\",\"uigdtopbobjog\",\"m\",\"w\"],\"externalTablesToInclude\":[\"a\"],\"externalTablesToExclude\":[\"z\",\"yvvtpgvdfgio\"],\"materializedViewsToInclude\":[\"tutqxlngxlefgug\",\"xkrxdqmi\",\"tthzrvqd\",\"abhjybi\"],\"materializedViewsToExclude\":[\"oqfbowskanyk\"],\"functionsToInclude\":[\"cuiywgqyw\",\"ndrvynhzg\",\"phrcgyncoc\",\"ecfvmm\"],\"functionsToExclude\":[\"fsxlzevgbmqjqa\"]},\"databaseShareOrigin\":\"Direct\"}") - .toObject(FollowerDatabaseDefinitionInner.class); - Assertions.assertEquals("mouexhdzx", model.clusterResourceId()); - Assertions.assertEquals("bqe", model.attachedDatabaseConfigurationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FollowerDatabaseDefinitionInner model = - new FollowerDatabaseDefinitionInner() - .withClusterResourceId("mouexhdzx") - .withAttachedDatabaseConfigurationName("bqe"); - model = BinaryData.fromObject(model).toObject(FollowerDatabaseDefinitionInner.class); - Assertions.assertEquals("mouexhdzx", model.clusterResourceId()); - Assertions.assertEquals("bqe", model.attachedDatabaseConfigurationName()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/FollowerDatabaseListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/FollowerDatabaseListResultTests.java deleted file mode 100644 index ba44d37fd21e..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/FollowerDatabaseListResultTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; -import com.azure.resourcemanager.kusto.models.FollowerDatabaseListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FollowerDatabaseListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FollowerDatabaseListResult model = - BinaryData - .fromString( - "{\"value\":[{\"clusterResourceId\":\"jbznorc\",\"attachedDatabaseConfigurationName\":\"xv\",\"databaseName\":\"byxqabn\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"cyshurzafbljjgp\",\"toqcjmklja\"],\"tablesToExclude\":[\"idtqajzyu\",\"pku\",\"jkrlkhbzhfepg\"],\"externalTablesToInclude\":[\"e\"],\"externalTablesToExclude\":[\"ocxscpaierhhbcs\"],\"materializedViewsToInclude\":[\"mmajtjaodx\",\"bnbdxkqpxokajion\",\"imexgstxgcpodgma\"],\"materializedViewsToExclude\":[\"mvdjwzrlovmc\"],\"functionsToInclude\":[\"ijcoejctb\",\"aqsqsycbkbfk\"],\"functionsToExclude\":[\"dkexxppofm\",\"axcfjpgddtocjjx\"]},\"databaseShareOrigin\":\"DataShare\"}]}") - .toObject(FollowerDatabaseListResult.class); - Assertions.assertEquals("jbznorc", model.value().get(0).clusterResourceId()); - Assertions.assertEquals("xv", model.value().get(0).attachedDatabaseConfigurationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FollowerDatabaseListResult model = - new FollowerDatabaseListResult() - .withValue( - Arrays - .asList( - new FollowerDatabaseDefinitionInner() - .withClusterResourceId("jbznorc") - .withAttachedDatabaseConfigurationName("xv"))); - model = BinaryData.fromObject(model).toObject(FollowerDatabaseListResult.class); - Assertions.assertEquals("jbznorc", model.value().get(0).clusterResourceId()); - Assertions.assertEquals("xv", model.value().get(0).attachedDatabaseConfigurationName()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IdentityTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IdentityTests.java deleted file mode 100644 index c8a913a425a7..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IdentityTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.Identity; -import com.azure.resourcemanager.kusto.models.IdentityType; -import com.azure.resourcemanager.kusto.models.IdentityUserAssignedIdentities; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString( - "{\"principalId\":\"parcry\",\"tenantId\":\"nzwuxzd\",\"type\":\"None\",\"userAssignedIdentities\":{\"tijbpzvgnwzsymgl\":{\"principalId\":\"lhmwhfpmrqobm\",\"clientId\":\"kknryrtihf\"},\"s\":{\"principalId\":\"fcyzkohdbihanufh\",\"clientId\":\"bj\"},\"npqxuh\":{\"principalId\":\"ithxqhabifpi\",\"clientId\":\"wczbys\"},\"tfwvukxgaudc\":{\"principalId\":\"y\",\"clientId\":\"iwbybrkxvdumjg\"}}}") - .toObject(Identity.class); - Assertions.assertEquals(IdentityType.NONE, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = - new Identity() - .withType(IdentityType.NONE) - .withUserAssignedIdentities( - mapOf( - "tijbpzvgnwzsymgl", - new IdentityUserAssignedIdentities(), - "s", - new IdentityUserAssignedIdentities(), - "npqxuh", - new IdentityUserAssignedIdentities(), - "tfwvukxgaudc", - new IdentityUserAssignedIdentities())); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(IdentityType.NONE, model.type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IdentityUserAssignedIdentitiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IdentityUserAssignedIdentitiesTests.java deleted file mode 100644 index 51a94d3aeeed..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IdentityUserAssignedIdentitiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.IdentityUserAssignedIdentities; - -public final class IdentityUserAssignedIdentitiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdentityUserAssignedIdentities model = - BinaryData - .fromString("{\"principalId\":\"nhsjcnyej\",\"clientId\":\"ryhtnapczwlokjy\"}") - .toObject(IdentityUserAssignedIdentities.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdentityUserAssignedIdentities model = new IdentityUserAssignedIdentities(); - model = BinaryData.fromObject(model).toObject(IdentityUserAssignedIdentities.class); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IotHubConnectionPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IotHubConnectionPropertiesTests.java deleted file mode 100644 index 5efa9338306b..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IotHubConnectionPropertiesTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.IotHubConnectionProperties; -import com.azure.resourcemanager.kusto.models.DatabaseRouting; -import com.azure.resourcemanager.kusto.models.IotHubDataFormat; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IotHubConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IotHubConnectionProperties model = - BinaryData - .fromString( - "{\"iotHubResourceId\":\"ktst\",\"consumerGroup\":\"dxeclzedqbcvh\",\"tableName\":\"h\",\"mappingRuleName\":\"odqkdlwwqfb\",\"dataFormat\":\"TSV\",\"eventSystemProperties\":[\"trqjfsmlmbtx\",\"w\"],\"sharedAccessPolicyName\":\"fwsrtawcoezbrhu\",\"databaseRouting\":\"Single\",\"retrievalStartDate\":\"2021-02-17T00:43:35Z\",\"provisioningState\":\"Creating\"}") - .toObject(IotHubConnectionProperties.class); - Assertions.assertEquals("ktst", model.iotHubResourceId()); - Assertions.assertEquals("dxeclzedqbcvh", model.consumerGroup()); - Assertions.assertEquals("h", model.tableName()); - Assertions.assertEquals("odqkdlwwqfb", model.mappingRuleName()); - Assertions.assertEquals(IotHubDataFormat.TSV, model.dataFormat()); - Assertions.assertEquals("trqjfsmlmbtx", model.eventSystemProperties().get(0)); - Assertions.assertEquals("fwsrtawcoezbrhu", model.sharedAccessPolicyName()); - Assertions.assertEquals(DatabaseRouting.SINGLE, model.databaseRouting()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-17T00:43:35Z"), model.retrievalStartDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IotHubConnectionProperties model = - new IotHubConnectionProperties() - .withIotHubResourceId("ktst") - .withConsumerGroup("dxeclzedqbcvh") - .withTableName("h") - .withMappingRuleName("odqkdlwwqfb") - .withDataFormat(IotHubDataFormat.TSV) - .withEventSystemProperties(Arrays.asList("trqjfsmlmbtx", "w")) - .withSharedAccessPolicyName("fwsrtawcoezbrhu") - .withDatabaseRouting(DatabaseRouting.SINGLE) - .withRetrievalStartDate(OffsetDateTime.parse("2021-02-17T00:43:35Z")); - model = BinaryData.fromObject(model).toObject(IotHubConnectionProperties.class); - Assertions.assertEquals("ktst", model.iotHubResourceId()); - Assertions.assertEquals("dxeclzedqbcvh", model.consumerGroup()); - Assertions.assertEquals("h", model.tableName()); - Assertions.assertEquals("odqkdlwwqfb", model.mappingRuleName()); - Assertions.assertEquals(IotHubDataFormat.TSV, model.dataFormat()); - Assertions.assertEquals("trqjfsmlmbtx", model.eventSystemProperties().get(0)); - Assertions.assertEquals("fwsrtawcoezbrhu", model.sharedAccessPolicyName()); - Assertions.assertEquals(DatabaseRouting.SINGLE, model.databaseRouting()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-17T00:43:35Z"), model.retrievalStartDate()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IotHubDataConnectionTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IotHubDataConnectionTests.java deleted file mode 100644 index 90a24558d63c..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/IotHubDataConnectionTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.DatabaseRouting; -import com.azure.resourcemanager.kusto.models.IotHubDataConnection; -import com.azure.resourcemanager.kusto.models.IotHubDataFormat; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IotHubDataConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IotHubDataConnection model = - BinaryData - .fromString( - "{\"kind\":\"IotHub\",\"properties\":{\"iotHubResourceId\":\"tx\",\"consumerGroup\":\"gzukxitmm\",\"tableName\":\"gqqqxh\",\"mappingRuleName\":\"xrxc\",\"dataFormat\":\"TXT\",\"eventSystemProperties\":[\"av\",\"k\",\"dzf\"],\"sharedAccessPolicyName\":\"azivjlfrqttbajl\",\"databaseRouting\":\"Single\",\"retrievalStartDate\":\"2021-04-16T08:57:57Z\",\"provisioningState\":\"Succeeded\"},\"location\":\"opidkqqfkuv\",\"id\":\"cxkdmligovi\",\"name\":\"rxkpmloazuruoc\",\"type\":\"goorbteo\"}") - .toObject(IotHubDataConnection.class); - Assertions.assertEquals("opidkqqfkuv", model.location()); - Assertions.assertEquals("tx", model.iotHubResourceId()); - Assertions.assertEquals("gzukxitmm", model.consumerGroup()); - Assertions.assertEquals("gqqqxh", model.tableName()); - Assertions.assertEquals("xrxc", model.mappingRuleName()); - Assertions.assertEquals(IotHubDataFormat.TXT, model.dataFormat()); - Assertions.assertEquals("av", model.eventSystemProperties().get(0)); - Assertions.assertEquals("azivjlfrqttbajl", model.sharedAccessPolicyName()); - Assertions.assertEquals(DatabaseRouting.SINGLE, model.databaseRouting()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-16T08:57:57Z"), model.retrievalStartDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IotHubDataConnection model = - new IotHubDataConnection() - .withLocation("opidkqqfkuv") - .withIotHubResourceId("tx") - .withConsumerGroup("gzukxitmm") - .withTableName("gqqqxh") - .withMappingRuleName("xrxc") - .withDataFormat(IotHubDataFormat.TXT) - .withEventSystemProperties(Arrays.asList("av", "k", "dzf")) - .withSharedAccessPolicyName("azivjlfrqttbajl") - .withDatabaseRouting(DatabaseRouting.SINGLE) - .withRetrievalStartDate(OffsetDateTime.parse("2021-04-16T08:57:57Z")); - model = BinaryData.fromObject(model).toObject(IotHubDataConnection.class); - Assertions.assertEquals("opidkqqfkuv", model.location()); - Assertions.assertEquals("tx", model.iotHubResourceId()); - Assertions.assertEquals("gzukxitmm", model.consumerGroup()); - Assertions.assertEquals("gqqqxh", model.tableName()); - Assertions.assertEquals("xrxc", model.mappingRuleName()); - Assertions.assertEquals(IotHubDataFormat.TXT, model.dataFormat()); - Assertions.assertEquals("av", model.eventSystemProperties().get(0)); - Assertions.assertEquals("azivjlfrqttbajl", model.sharedAccessPolicyName()); - Assertions.assertEquals(DatabaseRouting.SINGLE, model.databaseRouting()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-16T08:57:57Z"), model.retrievalStartDate()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/LanguageExtensionInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/LanguageExtensionInnerTests.java deleted file mode 100644 index 3d2f3d2d0b74..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/LanguageExtensionInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; -import com.azure.resourcemanager.kusto.models.LanguageExtensionImageName; -import com.azure.resourcemanager.kusto.models.LanguageExtensionName; -import org.junit.jupiter.api.Assertions; - -public final class LanguageExtensionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LanguageExtensionInner model = - BinaryData - .fromString("{\"languageExtensionName\":\"PYTHON\",\"languageExtensionImageName\":\"Python3_6_5\"}") - .toObject(LanguageExtensionInner.class); - Assertions.assertEquals(LanguageExtensionName.PYTHON, model.languageExtensionName()); - Assertions.assertEquals(LanguageExtensionImageName.PYTHON3_6_5, model.languageExtensionImageName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LanguageExtensionInner model = - new LanguageExtensionInner() - .withLanguageExtensionName(LanguageExtensionName.PYTHON) - .withLanguageExtensionImageName(LanguageExtensionImageName.PYTHON3_6_5); - model = BinaryData.fromObject(model).toObject(LanguageExtensionInner.class); - Assertions.assertEquals(LanguageExtensionName.PYTHON, model.languageExtensionName()); - Assertions.assertEquals(LanguageExtensionImageName.PYTHON3_6_5, model.languageExtensionImageName()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/LanguageExtensionsListTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/LanguageExtensionsListTests.java deleted file mode 100644 index dd56e63c433a..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/LanguageExtensionsListTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; -import com.azure.resourcemanager.kusto.models.LanguageExtensionImageName; -import com.azure.resourcemanager.kusto.models.LanguageExtensionName; -import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LanguageExtensionsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LanguageExtensionsList model = - BinaryData - .fromString( - "{\"value\":[{\"languageExtensionName\":\"R\",\"languageExtensionImageName\":\"R\"},{\"languageExtensionName\":\"R\",\"languageExtensionImageName\":\"R\"},{\"languageExtensionName\":\"R\",\"languageExtensionImageName\":\"Python3_10_8\"}]}") - .toObject(LanguageExtensionsList.class); - Assertions.assertEquals(LanguageExtensionName.R, model.value().get(0).languageExtensionName()); - Assertions.assertEquals(LanguageExtensionImageName.R, model.value().get(0).languageExtensionImageName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LanguageExtensionsList model = - new LanguageExtensionsList() - .withValue( - Arrays - .asList( - new LanguageExtensionInner() - .withLanguageExtensionName(LanguageExtensionName.R) - .withLanguageExtensionImageName(LanguageExtensionImageName.R), - new LanguageExtensionInner() - .withLanguageExtensionName(LanguageExtensionName.R) - .withLanguageExtensionImageName(LanguageExtensionImageName.R), - new LanguageExtensionInner() - .withLanguageExtensionName(LanguageExtensionName.R) - .withLanguageExtensionImageName(LanguageExtensionImageName.PYTHON3_10_8))); - model = BinaryData.fromObject(model).toObject(LanguageExtensionsList.class); - Assertions.assertEquals(LanguageExtensionName.R, model.value().get(0).languageExtensionName()); - Assertions.assertEquals(LanguageExtensionImageName.R, model.value().get(0).languageExtensionImageName()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ListResourceSkusResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ListResourceSkusResultTests.java deleted file mode 100644 index 57ef705960a6..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ListResourceSkusResultTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.AzureResourceSkuInner; -import com.azure.resourcemanager.kusto.models.AzureCapacity; -import com.azure.resourcemanager.kusto.models.AzureScaleType; -import com.azure.resourcemanager.kusto.models.AzureSku; -import com.azure.resourcemanager.kusto.models.AzureSkuName; -import com.azure.resourcemanager.kusto.models.AzureSkuTier; -import com.azure.resourcemanager.kusto.models.ListResourceSkusResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ListResourceSkusResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListResourceSkusResult model = - BinaryData - .fromString( - "{\"value\":[{\"resourceType\":\"z\",\"sku\":{\"name\":\"Standard_E8s_v4+2TB_PS\",\"capacity\":11356345,\"tier\":\"Standard\"},\"capacity\":{\"scaleType\":\"manual\",\"minimum\":302712597,\"maximum\":830056892,\"default\":834529223}},{\"resourceType\":\"ebwpucwwfvo\",\"sku\":{\"name\":\"Standard_E2a_v4\",\"capacity\":1386132644,\"tier\":\"Basic\"},\"capacity\":{\"scaleType\":\"manual\",\"minimum\":1911093580,\"maximum\":1542315989,\"default\":783632971}}]}") - .toObject(ListResourceSkusResult.class); - Assertions.assertEquals("z", model.value().get(0).resourceType()); - Assertions.assertEquals(AzureSkuName.STANDARD_E8S_V4_2TB_PS, model.value().get(0).sku().name()); - Assertions.assertEquals(11356345, model.value().get(0).sku().capacity()); - Assertions.assertEquals(AzureSkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals(AzureScaleType.MANUAL, model.value().get(0).capacity().scaleType()); - Assertions.assertEquals(302712597, model.value().get(0).capacity().minimum()); - Assertions.assertEquals(830056892, model.value().get(0).capacity().maximum()); - Assertions.assertEquals(834529223, model.value().get(0).capacity().defaultProperty()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListResourceSkusResult model = - new ListResourceSkusResult() - .withValue( - Arrays - .asList( - new AzureResourceSkuInner() - .withResourceType("z") - .withSku( - new AzureSku() - .withName(AzureSkuName.STANDARD_E8S_V4_2TB_PS) - .withCapacity(11356345) - .withTier(AzureSkuTier.STANDARD)) - .withCapacity( - new AzureCapacity() - .withScaleType(AzureScaleType.MANUAL) - .withMinimum(302712597) - .withMaximum(830056892) - .withDefaultProperty(834529223)), - new AzureResourceSkuInner() - .withResourceType("ebwpucwwfvo") - .withSku( - new AzureSku() - .withName(AzureSkuName.STANDARD_E2A_V4) - .withCapacity(1386132644) - .withTier(AzureSkuTier.BASIC)) - .withCapacity( - new AzureCapacity() - .withScaleType(AzureScaleType.MANUAL) - .withMinimum(1911093580) - .withMaximum(1542315989) - .withDefaultProperty(783632971)))); - model = BinaryData.fromObject(model).toObject(ListResourceSkusResult.class); - Assertions.assertEquals("z", model.value().get(0).resourceType()); - Assertions.assertEquals(AzureSkuName.STANDARD_E8S_V4_2TB_PS, model.value().get(0).sku().name()); - Assertions.assertEquals(11356345, model.value().get(0).sku().capacity()); - Assertions.assertEquals(AzureSkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals(AzureScaleType.MANUAL, model.value().get(0).capacity().scaleType()); - Assertions.assertEquals(302712597, model.value().get(0).capacity().minimum()); - Assertions.assertEquals(830056892, model.value().get(0).capacity().maximum()); - Assertions.assertEquals(834529223, model.value().get(0).capacity().defaultProperty()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointInnerTests.java deleted file mode 100644 index 3b5c742aaaec..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.ManagedPrivateEndpointInner; -import org.junit.jupiter.api.Assertions; - -public final class ManagedPrivateEndpointInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedPrivateEndpointInner model = - BinaryData - .fromString( - "{\"properties\":{\"privateLinkResourceId\":\"sluicpdggkzz\",\"privateLinkResourceRegion\":\"mbmpaxmodfvuefy\",\"groupId\":\"sbpfvmwyhr\",\"requestMessage\":\"uyfta\",\"provisioningState\":\"Creating\"},\"id\":\"wiyzvqtmnubexkp\",\"name\":\"ksmond\",\"type\":\"mquxvypo\"}") - .toObject(ManagedPrivateEndpointInner.class); - Assertions.assertEquals("sluicpdggkzz", model.privateLinkResourceId()); - Assertions.assertEquals("mbmpaxmodfvuefy", model.privateLinkResourceRegion()); - Assertions.assertEquals("sbpfvmwyhr", model.groupId()); - Assertions.assertEquals("uyfta", model.requestMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedPrivateEndpointInner model = - new ManagedPrivateEndpointInner() - .withPrivateLinkResourceId("sluicpdggkzz") - .withPrivateLinkResourceRegion("mbmpaxmodfvuefy") - .withGroupId("sbpfvmwyhr") - .withRequestMessage("uyfta"); - model = BinaryData.fromObject(model).toObject(ManagedPrivateEndpointInner.class); - Assertions.assertEquals("sluicpdggkzz", model.privateLinkResourceId()); - Assertions.assertEquals("mbmpaxmodfvuefy", model.privateLinkResourceRegion()); - Assertions.assertEquals("sbpfvmwyhr", model.groupId()); - Assertions.assertEquals("uyfta", model.requestMessage()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointListResultTests.java deleted file mode 100644 index 0fb8dc8df886..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointListResultTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.ManagedPrivateEndpointInner; -import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpointListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ManagedPrivateEndpointListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedPrivateEndpointListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"privateLinkResourceId\":\"lvithhqzonosgg\",\"privateLinkResourceRegion\":\"c\",\"groupId\":\"hfwdsjnkaljutiis\",\"requestMessage\":\"cffgdkzzewk\",\"provisioningState\":\"Canceled\"},\"id\":\"crailvpn\",\"name\":\"pfuflrw\",\"type\":\"mh\"},{\"properties\":{\"privateLinkResourceId\":\"xyjrxsagafcnih\",\"privateLinkResourceRegion\":\"qapnedgfbcv\",\"groupId\":\"cvqvpkeqdcv\",\"requestMessage\":\"hvoodsotbobzd\",\"provisioningState\":\"Canceled\"},\"id\":\"wvnhdldwmgx\",\"name\":\"xrslpm\",\"type\":\"twuoegrpkhjwni\"}]}") - .toObject(ManagedPrivateEndpointListResult.class); - Assertions.assertEquals("lvithhqzonosgg", model.value().get(0).privateLinkResourceId()); - Assertions.assertEquals("c", model.value().get(0).privateLinkResourceRegion()); - Assertions.assertEquals("hfwdsjnkaljutiis", model.value().get(0).groupId()); - Assertions.assertEquals("cffgdkzzewk", model.value().get(0).requestMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedPrivateEndpointListResult model = - new ManagedPrivateEndpointListResult() - .withValue( - Arrays - .asList( - new ManagedPrivateEndpointInner() - .withPrivateLinkResourceId("lvithhqzonosgg") - .withPrivateLinkResourceRegion("c") - .withGroupId("hfwdsjnkaljutiis") - .withRequestMessage("cffgdkzzewk"), - new ManagedPrivateEndpointInner() - .withPrivateLinkResourceId("xyjrxsagafcnih") - .withPrivateLinkResourceRegion("qapnedgfbcv") - .withGroupId("cvqvpkeqdcv") - .withRequestMessage("hvoodsotbobzd"))); - model = BinaryData.fromObject(model).toObject(ManagedPrivateEndpointListResult.class); - Assertions.assertEquals("lvithhqzonosgg", model.value().get(0).privateLinkResourceId()); - Assertions.assertEquals("c", model.value().get(0).privateLinkResourceRegion()); - Assertions.assertEquals("hfwdsjnkaljutiis", model.value().get(0).groupId()); - Assertions.assertEquals("cffgdkzzewk", model.value().get(0).requestMessage()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointPropertiesTests.java deleted file mode 100644 index d1f7066c30cb..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.ManagedPrivateEndpointProperties; -import org.junit.jupiter.api.Assertions; - -public final class ManagedPrivateEndpointPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedPrivateEndpointProperties model = - BinaryData - .fromString( - "{\"privateLinkResourceId\":\"gkopkwhojvpajqgx\",\"privateLinkResourceRegion\":\"mocmbqfqvmk\",\"groupId\":\"xozap\",\"requestMessage\":\"elxprglyatddck\",\"provisioningState\":\"Succeeded\"}") - .toObject(ManagedPrivateEndpointProperties.class); - Assertions.assertEquals("gkopkwhojvpajqgx", model.privateLinkResourceId()); - Assertions.assertEquals("mocmbqfqvmk", model.privateLinkResourceRegion()); - Assertions.assertEquals("xozap", model.groupId()); - Assertions.assertEquals("elxprglyatddck", model.requestMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedPrivateEndpointProperties model = - new ManagedPrivateEndpointProperties() - .withPrivateLinkResourceId("gkopkwhojvpajqgx") - .withPrivateLinkResourceRegion("mocmbqfqvmk") - .withGroupId("xozap") - .withRequestMessage("elxprglyatddck"); - model = BinaryData.fromObject(model).toObject(ManagedPrivateEndpointProperties.class); - Assertions.assertEquals("gkopkwhojvpajqgx", model.privateLinkResourceId()); - Assertions.assertEquals("mocmbqfqvmk", model.privateLinkResourceRegion()); - Assertions.assertEquals("xozap", model.groupId()); - Assertions.assertEquals("elxprglyatddck", model.requestMessage()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsCheckNameAvailabilityWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index 879934c7c491..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.CheckNameResult; -import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpointsCheckNameRequest; -import com.azure.resourcemanager.kusto.models.Reason; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedPrivateEndpointsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"nameAvailable\":true,\"name\":\"dt\",\"message\":\"epu\",\"reason\":\"Invalid\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameResult response = - manager - .managedPrivateEndpoints() - .checkNameAvailabilityWithResponse( - "sfnrdtjxt", - "r", - new ManagedPrivateEndpointsCheckNameRequest().withName("cq"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("dt", response.name()); - Assertions.assertEquals("epu", response.message()); - Assertions.assertEquals(Reason.INVALID, response.reason()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsCheckNameRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsCheckNameRequestTests.java deleted file mode 100644 index f33a3bfec47b..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsCheckNameRequestTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpointsCheckNameRequest; -import org.junit.jupiter.api.Assertions; - -public final class ManagedPrivateEndpointsCheckNameRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedPrivateEndpointsCheckNameRequest model = - BinaryData.fromString("{\"name\":\"uhashsfwx\"}").toObject(ManagedPrivateEndpointsCheckNameRequest.class); - Assertions.assertEquals("uhashsfwx", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedPrivateEndpointsCheckNameRequest model = - new ManagedPrivateEndpointsCheckNameRequest().withName("uhashsfwx"); - model = BinaryData.fromObject(model).toObject(ManagedPrivateEndpointsCheckNameRequest.class); - Assertions.assertEquals("uhashsfwx", model.name()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsCreateOrUpdateMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsCreateOrUpdateMockTests.java deleted file mode 100644 index 794b58aca1d4..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpoint; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedPrivateEndpointsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateLinkResourceId\":\"fuijtkbus\",\"privateLinkResourceRegion\":\"gsfikayiansha\",\"groupId\":\"ujtjiqxfz\",\"requestMessage\":\"qttv\",\"provisioningState\":\"Succeeded\"},\"id\":\"hjpenuygbq\",\"name\":\"qqekewvnqvcdlgu\",\"type\":\"ucmfdj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ManagedPrivateEndpoint response = - manager - .managedPrivateEndpoints() - .define("oebn") - .withExistingCluster("kjbsah", "tdtpdelqacslmo") - .withPrivateLinkResourceId("o") - .withPrivateLinkResourceRegion("cjkgdirazftxej") - .withGroupId("ab") - .withRequestMessage("ujtmvcopexcmjurb") - .create(); - - Assertions.assertEquals("fuijtkbus", response.privateLinkResourceId()); - Assertions.assertEquals("gsfikayiansha", response.privateLinkResourceRegion()); - Assertions.assertEquals("ujtjiqxfz", response.groupId()); - Assertions.assertEquals("qttv", response.requestMessage()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsDeleteMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsDeleteMockTests.java deleted file mode 100644 index cb9dc068a994..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedPrivateEndpointsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .managedPrivateEndpoints() - .delete("amlbnseqacjjvpil", "uooqjagmdit", "ueio", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsGetWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsGetWithResponseMockTests.java deleted file mode 100644 index 7870c5e4c8ac..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpoint; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedPrivateEndpointsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateLinkResourceId\":\"gcgbjb\",\"privateLinkResourceRegion\":\"lfgtdysnaquflqbc\",\"groupId\":\"q\",\"requestMessage\":\"mzjr\",\"provisioningState\":\"Creating\"},\"id\":\"zeqyjleziun\",\"name\":\"xdfzantkw\",\"type\":\"eg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ManagedPrivateEndpoint response = - manager - .managedPrivateEndpoints() - .getWithResponse("jqatucoigebxn", "nwfepbnwg", "m", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gcgbjb", response.privateLinkResourceId()); - Assertions.assertEquals("lfgtdysnaquflqbc", response.privateLinkResourceRegion()); - Assertions.assertEquals("q", response.groupId()); - Assertions.assertEquals("mzjr", response.requestMessage()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsListMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsListMockTests.java deleted file mode 100644 index e5ae8b5876e5..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ManagedPrivateEndpointsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpoint; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedPrivateEndpointsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"privateLinkResourceId\":\"iesfuug\",\"privateLinkResourceRegion\":\"uqfecj\",\"groupId\":\"ey\",\"requestMessage\":\"uhxu\",\"provisioningState\":\"Deleting\"},\"id\":\"ewmrswnjlxu\",\"name\":\"rhwpus\",\"type\":\"jbaqehgpdoh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.managedPrivateEndpoints().list("yjtcvuwk", "s", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("iesfuug", response.iterator().next().privateLinkResourceId()); - Assertions.assertEquals("uqfecj", response.iterator().next().privateLinkResourceRegion()); - Assertions.assertEquals("ey", response.iterator().next().groupId()); - Assertions.assertEquals("uhxu", response.iterator().next().requestMessage()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/MigrationClusterPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/MigrationClusterPropertiesTests.java deleted file mode 100644 index 39cd6ffbef17..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/MigrationClusterPropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.MigrationClusterProperties; - -public final class MigrationClusterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrationClusterProperties model = - BinaryData - .fromString("{\"id\":\"xbnjbiksq\",\"uri\":\"lssai\",\"dataIngestionUri\":\"p\",\"role\":\"Source\"}") - .toObject(MigrationClusterProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrationClusterProperties model = new MigrationClusterProperties(); - model = BinaryData.fromObject(model).toObject(MigrationClusterProperties.class); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationDisplayTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationDisplayTests.java deleted file mode 100644 index 5cc1f3bf7f54..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationDisplayTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"ggufhyaomtb\",\"operation\":\"havgrvk\",\"resource\":\"ovjzhpjbibgjmfx\",\"description\":\"vfcluyovwxnbkfe\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("ggufhyaomtb", model.provider()); - Assertions.assertEquals("havgrvk", model.operation()); - Assertions.assertEquals("ovjzhpjbibgjmfx", model.resource()); - Assertions.assertEquals("vfcluyovwxnbkfe", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = - new OperationDisplay() - .withProvider("ggufhyaomtb") - .withOperation("havgrvk") - .withResource("ovjzhpjbibgjmfx") - .withDescription("vfcluyovwxnbkfe"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("ggufhyaomtb", model.provider()); - Assertions.assertEquals("havgrvk", model.operation()); - Assertions.assertEquals("ovjzhpjbibgjmfx", model.resource()); - Assertions.assertEquals("vfcluyovwxnbkfe", model.description()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationInnerTests.java deleted file mode 100644 index 995db6d1ec8d..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationInnerTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.OperationInner; -import com.azure.resourcemanager.kusto.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"dsofbshrns\",\"display\":{\"provider\":\"swdvzyybycnun\",\"operation\":\"srtkfa\",\"resource\":\"opqgikyzirtxdyux\",\"description\":\"jntpsewgioilqu\"},\"origin\":\"ydxtqm\",\"properties\":\"dataox\"}") - .toObject(OperationInner.class); - Assertions.assertEquals("dsofbshrns", model.name()); - Assertions.assertEquals("swdvzyybycnun", model.display().provider()); - Assertions.assertEquals("srtkfa", model.display().operation()); - Assertions.assertEquals("opqgikyzirtxdyux", model.display().resource()); - Assertions.assertEquals("jntpsewgioilqu", model.display().description()); - Assertions.assertEquals("ydxtqm", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = - new OperationInner() - .withName("dsofbshrns") - .withDisplay( - new OperationDisplay() - .withProvider("swdvzyybycnun") - .withOperation("srtkfa") - .withResource("opqgikyzirtxdyux") - .withDescription("jntpsewgioilqu")) - .withOrigin("ydxtqm") - .withProperties("dataox"); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("dsofbshrns", model.name()); - Assertions.assertEquals("swdvzyybycnun", model.display().provider()); - Assertions.assertEquals("srtkfa", model.display().operation()); - Assertions.assertEquals("opqgikyzirtxdyux", model.display().resource()); - Assertions.assertEquals("jntpsewgioilqu", model.display().description()); - Assertions.assertEquals("ydxtqm", model.origin()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationListResultTests.java deleted file mode 100644 index 4e36840f0f2e..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationListResultTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.OperationInner; -import com.azure.resourcemanager.kusto.models.OperationDisplay; -import com.azure.resourcemanager.kusto.models.OperationListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"fdlwg\",\"display\":{\"provider\":\"sb\",\"operation\":\"ovvtgseinqfiu\",\"resource\":\"qknp\",\"description\":\"gnepttwqmsni\"},\"origin\":\"cdm\",\"properties\":\"datar\"},{\"name\":\"lpijnkrxfrd\",\"display\":{\"provider\":\"ratiz\",\"operation\":\"onasxifto\",\"resource\":\"yzhftwesgogczh\",\"description\":\"nxkrlgnyhmossxkk\"},\"origin\":\"h\",\"properties\":\"datagh\"}],\"nextLink\":\"bdhqxvcxgf\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("fdlwg", model.value().get(0).name()); - Assertions.assertEquals("sb", model.value().get(0).display().provider()); - Assertions.assertEquals("ovvtgseinqfiu", model.value().get(0).display().operation()); - Assertions.assertEquals("qknp", model.value().get(0).display().resource()); - Assertions.assertEquals("gnepttwqmsni", model.value().get(0).display().description()); - Assertions.assertEquals("cdm", model.value().get(0).origin()); - Assertions.assertEquals("bdhqxvcxgf", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = - new OperationListResult() - .withValue( - Arrays - .asList( - new OperationInner() - .withName("fdlwg") - .withDisplay( - new OperationDisplay() - .withProvider("sb") - .withOperation("ovvtgseinqfiu") - .withResource("qknp") - .withDescription("gnepttwqmsni")) - .withOrigin("cdm") - .withProperties("datar"), - new OperationInner() - .withName("lpijnkrxfrd") - .withDisplay( - new OperationDisplay() - .withProvider("ratiz") - .withOperation("onasxifto") - .withResource("yzhftwesgogczh") - .withDescription("nxkrlgnyhmossxkk")) - .withOrigin("h") - .withProperties("datagh"))) - .withNextLink("bdhqxvcxgf"); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("fdlwg", model.value().get(0).name()); - Assertions.assertEquals("sb", model.value().get(0).display().provider()); - Assertions.assertEquals("ovvtgseinqfiu", model.value().get(0).display().operation()); - Assertions.assertEquals("qknp", model.value().get(0).display().resource()); - Assertions.assertEquals("gnepttwqmsni", model.value().get(0).display().description()); - Assertions.assertEquals("cdm", model.value().get(0).origin()); - Assertions.assertEquals("bdhqxvcxgf", model.nextLink()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationResultPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationResultPropertiesTests.java deleted file mode 100644 index 09098be24312..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationResultPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.OperationResultProperties; -import org.junit.jupiter.api.Assertions; - -public final class OperationResultPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationResultProperties model = - BinaryData - .fromString( - "{\"operationKind\":\"irctymoxoftpipiw\",\"provisioningState\":\"Canceled\",\"operationState\":\"hxacpqjlihhyu\"}") - .toObject(OperationResultProperties.class); - Assertions.assertEquals("irctymoxoftpipiw", model.operationKind()); - Assertions.assertEquals("hxacpqjlihhyu", model.operationState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResultProperties model = - new OperationResultProperties().withOperationKind("irctymoxoftpipiw").withOperationState("hxacpqjlihhyu"); - model = BinaryData.fromObject(model).toObject(OperationResultProperties.class); - Assertions.assertEquals("irctymoxoftpipiw", model.operationKind()); - Assertions.assertEquals("hxacpqjlihhyu", model.operationState()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationsListMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationsListMockTests.java deleted file mode 100644 index f26cab8bdaaf..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"rnnqb\",\"display\":{\"provider\":\"pizxqltgrdogyp\",\"operation\":\"x\",\"resource\":\"fihwu\",\"description\":\"ctafsrbxrblm\"},\"origin\":\"owxih\",\"properties\":\"datanxw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("rnnqb", response.iterator().next().name()); - Assertions.assertEquals("pizxqltgrdogyp", response.iterator().next().display().provider()); - Assertions.assertEquals("x", response.iterator().next().display().operation()); - Assertions.assertEquals("fihwu", response.iterator().next().display().resource()); - Assertions.assertEquals("ctafsrbxrblm", response.iterator().next().display().description()); - Assertions.assertEquals("owxih", response.iterator().next().origin()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationsResultsLocationsGetWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationsResultsLocationsGetWithResponseMockTests.java deleted file mode 100644 index 6f7df219e14d..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OperationsResultsLocationsGetWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsResultsLocationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .operationsResultsLocations() - .getWithResponse("hxiidlopedb", "dpyqyybxubmd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OptimizedAutoscaleTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OptimizedAutoscaleTests.java deleted file mode 100644 index 91d65edf67c5..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OptimizedAutoscaleTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.OptimizedAutoscale; -import org.junit.jupiter.api.Assertions; - -public final class OptimizedAutoscaleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OptimizedAutoscale model = - BinaryData - .fromString("{\"version\":246878783,\"isEnabled\":false,\"minimum\":1628568580,\"maximum\":88405242}") - .toObject(OptimizedAutoscale.class); - Assertions.assertEquals(246878783, model.version()); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1628568580, model.minimum()); - Assertions.assertEquals(88405242, model.maximum()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OptimizedAutoscale model = - new OptimizedAutoscale() - .withVersion(246878783) - .withIsEnabled(false) - .withMinimum(1628568580) - .withMaximum(88405242); - model = BinaryData.fromObject(model).toObject(OptimizedAutoscale.class); - Assertions.assertEquals(246878783, model.version()); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1628568580, model.minimum()); - Assertions.assertEquals(88405242, model.maximum()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OutboundNetworkDependenciesEndpointInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OutboundNetworkDependenciesEndpointInnerTests.java deleted file mode 100644 index 5cf9ea6901ec..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OutboundNetworkDependenciesEndpointInnerTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner; -import com.azure.resourcemanager.kusto.models.EndpointDependency; -import com.azure.resourcemanager.kusto.models.EndpointDetail; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OutboundNetworkDependenciesEndpointInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OutboundNetworkDependenciesEndpointInner model = - BinaryData - .fromString( - "{\"properties\":{\"category\":\"ewzsyyceuzsoib\",\"endpoints\":[{\"domainName\":\"frxtrthzvaytdwk\",\"endpointDetails\":[{\"port\":1729344688},{\"port\":965192802},{\"port\":1150856748},{\"port\":1389326915}]},{\"domainName\":\"iilivpdtiirqtd\",\"endpointDetails\":[{\"port\":1693357038},{\"port\":725255215},{\"port\":1201300359}]},{\"domainName\":\"squyfxrxxlep\",\"endpointDetails\":[{\"port\":699446772},{\"port\":767638110},{\"port\":576385447}]},{\"domainName\":\"wnwxuqlcvyd\",\"endpointDetails\":[{\"port\":1248229075},{\"port\":350928008},{\"port\":1607416981},{\"port\":1080524607}]}],\"provisioningState\":\"Deleting\"},\"etag\":\"dkooebwnu\",\"id\":\"hemms\",\"name\":\"vdkcrodtj\",\"type\":\"nfwjlfltkacjvefk\"}") - .toObject(OutboundNetworkDependenciesEndpointInner.class); - Assertions.assertEquals("ewzsyyceuzsoib", model.category()); - Assertions.assertEquals("frxtrthzvaytdwk", model.endpoints().get(0).domainName()); - Assertions.assertEquals(1729344688, model.endpoints().get(0).endpointDetails().get(0).port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OutboundNetworkDependenciesEndpointInner model = - new OutboundNetworkDependenciesEndpointInner() - .withCategory("ewzsyyceuzsoib") - .withEndpoints( - Arrays - .asList( - new EndpointDependency() - .withDomainName("frxtrthzvaytdwk") - .withEndpointDetails( - Arrays - .asList( - new EndpointDetail().withPort(1729344688), - new EndpointDetail().withPort(965192802), - new EndpointDetail().withPort(1150856748), - new EndpointDetail().withPort(1389326915))), - new EndpointDependency() - .withDomainName("iilivpdtiirqtd") - .withEndpointDetails( - Arrays - .asList( - new EndpointDetail().withPort(1693357038), - new EndpointDetail().withPort(725255215), - new EndpointDetail().withPort(1201300359))), - new EndpointDependency() - .withDomainName("squyfxrxxlep") - .withEndpointDetails( - Arrays - .asList( - new EndpointDetail().withPort(699446772), - new EndpointDetail().withPort(767638110), - new EndpointDetail().withPort(576385447))), - new EndpointDependency() - .withDomainName("wnwxuqlcvyd") - .withEndpointDetails( - Arrays - .asList( - new EndpointDetail().withPort(1248229075), - new EndpointDetail().withPort(350928008), - new EndpointDetail().withPort(1607416981), - new EndpointDetail().withPort(1080524607))))); - model = BinaryData.fromObject(model).toObject(OutboundNetworkDependenciesEndpointInner.class); - Assertions.assertEquals("ewzsyyceuzsoib", model.category()); - Assertions.assertEquals("frxtrthzvaytdwk", model.endpoints().get(0).domainName()); - Assertions.assertEquals(1729344688, model.endpoints().get(0).endpointDetails().get(0).port()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OutboundNetworkDependenciesEndpointListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OutboundNetworkDependenciesEndpointListResultTests.java deleted file mode 100644 index 19c957de2e72..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OutboundNetworkDependenciesEndpointListResultTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner; -import com.azure.resourcemanager.kusto.models.EndpointDependency; -import com.azure.resourcemanager.kusto.models.EndpointDetail; -import com.azure.resourcemanager.kusto.models.OutboundNetworkDependenciesEndpointListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OutboundNetworkDependenciesEndpointListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OutboundNetworkDependenciesEndpointListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"category\":\"duhpk\",\"endpoints\":[{\"domainName\":\"mareqnajxqugj\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"ubeddg\",\"endpointDetails\":[{}]}],\"provisioningState\":\"Creating\"},\"etag\":\"mzqa\",\"id\":\"krmnjijpxacqqud\",\"name\":\"nbyxbaaabjyv\",\"type\":\"yffimrzrtuzqogs\"}],\"nextLink\":\"nevfdnw\"}") - .toObject(OutboundNetworkDependenciesEndpointListResult.class); - Assertions.assertEquals("duhpk", model.value().get(0).category()); - Assertions.assertEquals("mareqnajxqugj", model.value().get(0).endpoints().get(0).domainName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OutboundNetworkDependenciesEndpointListResult model = - new OutboundNetworkDependenciesEndpointListResult() - .withValue( - Arrays - .asList( - new OutboundNetworkDependenciesEndpointInner() - .withCategory("duhpk") - .withEndpoints( - Arrays - .asList( - new EndpointDependency() - .withDomainName("mareqnajxqugj") - .withEndpointDetails( - Arrays - .asList( - new EndpointDetail(), - new EndpointDetail(), - new EndpointDetail())), - new EndpointDependency() - .withDomainName("ubeddg") - .withEndpointDetails(Arrays.asList(new EndpointDetail())))))); - model = BinaryData.fromObject(model).toObject(OutboundNetworkDependenciesEndpointListResult.class); - Assertions.assertEquals("duhpk", model.value().get(0).category()); - Assertions.assertEquals("mareqnajxqugj", model.value().get(0).endpoints().get(0).domainName()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OutboundNetworkDependenciesEndpointPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OutboundNetworkDependenciesEndpointPropertiesTests.java deleted file mode 100644 index f82c741c4d97..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/OutboundNetworkDependenciesEndpointPropertiesTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointProperties; -import com.azure.resourcemanager.kusto.models.EndpointDependency; -import com.azure.resourcemanager.kusto.models.EndpointDetail; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OutboundNetworkDependenciesEndpointPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OutboundNetworkDependenciesEndpointProperties model = - BinaryData - .fromString( - "{\"category\":\"foakgg\",\"endpoints\":[{\"domainName\":\"gaowpulpqblylsyx\",\"endpointDetails\":[{\"port\":1714916710},{\"port\":262817355},{\"port\":560645314},{\"port\":1868480291}]},{\"domainName\":\"gxsds\",\"endpointDetails\":[{\"port\":1182322128}]}],\"provisioningState\":\"Deleting\"}") - .toObject(OutboundNetworkDependenciesEndpointProperties.class); - Assertions.assertEquals("foakgg", model.category()); - Assertions.assertEquals("gaowpulpqblylsyx", model.endpoints().get(0).domainName()); - Assertions.assertEquals(1714916710, model.endpoints().get(0).endpointDetails().get(0).port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OutboundNetworkDependenciesEndpointProperties model = - new OutboundNetworkDependenciesEndpointProperties() - .withCategory("foakgg") - .withEndpoints( - Arrays - .asList( - new EndpointDependency() - .withDomainName("gaowpulpqblylsyx") - .withEndpointDetails( - Arrays - .asList( - new EndpointDetail().withPort(1714916710), - new EndpointDetail().withPort(262817355), - new EndpointDetail().withPort(560645314), - new EndpointDetail().withPort(1868480291))), - new EndpointDependency() - .withDomainName("gxsds") - .withEndpointDetails(Arrays.asList(new EndpointDetail().withPort(1182322128))))); - model = BinaryData.fromObject(model).toObject(OutboundNetworkDependenciesEndpointProperties.class); - Assertions.assertEquals("foakgg", model.category()); - Assertions.assertEquals("gaowpulpqblylsyx", model.endpoints().get(0).domainName()); - Assertions.assertEquals(1714916710, model.endpoints().get(0).endpointDetails().get(0).port()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 192312798935..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.kusto.models.PrivateLinkServiceConnectionStateProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"xxjtfe\"},\"privateLinkServiceConnectionState\":{\"status\":\"uwfzitonpe\",\"description\":\"pjkjlxofpdv\",\"actionsRequired\":\"fxxypininmayhuy\"},\"groupId\":\"kpode\",\"provisioningState\":\"oginuvamiheognar\"},\"id\":\"xth\",\"name\":\"o\",\"type\":\"usivye\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("uwfzitonpe", model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("pjkjlxofpdv", model.privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model = - new PrivateEndpointConnectionInner() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty() - .withStatus("uwfzitonpe") - .withDescription("pjkjlxofpdv")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("uwfzitonpe", model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("pjkjlxofpdv", model.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index 861615fc761c..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.kusto.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.kusto.models.PrivateLinkServiceConnectionStateProperty; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"xgc\"},\"privateLinkServiceConnectionState\":{\"status\":\"ibrhosxsdqr\",\"description\":\"o\",\"actionsRequired\":\"i\"},\"groupId\":\"rq\",\"provisioningState\":\"bahwfl\"},\"id\":\"zdtmhrkwofy\",\"name\":\"voqacpiexpbt\",\"type\":\"iwbwoenwashrtdtk\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"wbpokulpiujwaasi\"},\"privateLinkServiceConnectionState\":{\"status\":\"i\",\"description\":\"byuqerpqlp\",\"actionsRequired\":\"cciuqgbdbutau\"},\"groupId\":\"btkuwhh\",\"provisioningState\":\"ykojoxafnndlpic\"},\"id\":\"o\",\"name\":\"mkcdyhbpkkpwdre\",\"type\":\"novvqfovljxy\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"syrsndsytgadgvra\"},\"privateLinkServiceConnectionState\":{\"status\":\"en\",\"description\":\"nzar\",\"actionsRequired\":\"lquuijfqkacewii\"},\"groupId\":\"pubjibw\",\"provisioningState\":\"f\"},\"id\":\"hqkvpuvksgplsak\",\"name\":\"ynfs\",\"type\":\"n\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"uopxodlqiyntor\"},\"privateLinkServiceConnectionState\":{\"status\":\"hleosjsw\",\"description\":\"mslyzrpzbchckqqz\",\"actionsRequired\":\"ox\"},\"groupId\":\"suiizynkedyat\",\"provisioningState\":\"yhqmibzyhwi\"},\"id\":\"mypyynpcdpu\",\"name\":\"nzgmwznmabik\",\"type\":\"sorgj\"}]}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals("ibrhosxsdqr", model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("o", model.value().get(0).privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = - new PrivateEndpointConnectionListResult() - .withValue( - Arrays - .asList( - new PrivateEndpointConnectionInner() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty() - .withStatus("ibrhosxsdqr") - .withDescription("o")), - new PrivateEndpointConnectionInner() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty() - .withStatus("i") - .withDescription("byuqerpqlp")), - new PrivateEndpointConnectionInner() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty() - .withStatus("en") - .withDescription("nzar")), - new PrivateEndpointConnectionInner() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty() - .withStatus("hleosjsw") - .withDescription("mslyzrpzbchckqqz")))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals("ibrhosxsdqr", model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("o", model.value().get(0).privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 24a5f38e8d6b..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.kusto.models.PrivateLinkServiceConnectionStateProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = - BinaryData - .fromString( - "{\"privateEndpoint\":{\"id\":\"iqihn\"},\"privateLinkServiceConnectionState\":{\"status\":\"ngbwjz\",\"description\":\"fygxgispemvtzfk\",\"actionsRequired\":\"ubljofxqe\"},\"groupId\":\"jaeq\",\"provisioningState\":\"qjbasvms\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("ngbwjz", model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("fygxgispemvtzfk", model.privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model = - new PrivateEndpointConnectionProperties() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty() - .withStatus("ngbwjz") - .withDescription("fygxgispemvtzfk")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("ngbwjz", model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("fygxgispemvtzfk", model.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java deleted file mode 100644 index 279b4ddfb5cc..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.PrivateEndpointConnection; -import com.azure.resourcemanager.kusto.models.PrivateLinkServiceConnectionStateProperty; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"yslu\"},\"privateLinkServiceConnectionState\":{\"status\":\"pshhkvpedwqslsr\",\"description\":\"pq\",\"actionsRequired\":\"wskondcbrwimuvqe\"},\"groupId\":\"so\",\"provisioningState\":\"Succeeded\"},\"id\":\"qobbpihehcec\",\"name\":\"bmrqbrjbbmp\",\"type\":\"dlvykfrex\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .define("yulidwcwvm") - .withExistingCluster("qvlnnpxybafiqgea", "rbgjekglkl") - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty().withStatus("hj").withDescription("wgdnqzbr")) - .create(); - - Assertions.assertEquals("pshhkvpedwqslsr", response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("pq", response.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsDeleteMockTests.java deleted file mode 100644 index f130fd3984a5..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .privateEndpointConnections() - .delete("hvthlaiwdcxsm", "zzhz", "txetlgydl", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 826c3e9c0194..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.PrivateEndpointConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"nuchlgmltxdwhmo\"},\"privateLinkServiceConnectionState\":{\"status\":\"sgzv\",\"description\":\"snnjzfpafolpym\",\"actionsRequired\":\"mxq\"},\"groupId\":\"agpgdph\",\"provisioningState\":\"dulajvlejchcs\"},\"id\":\"zknmzlanrupd\",\"name\":\"vnphc\",\"type\":\"zqtpjhmq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .getWithResponse("rrkolawjmjs", "wro", "cdxfzzzwyjafitl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("sgzv", response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("snnjzfpafolpym", response.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsListMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsListMockTests.java deleted file mode 100644 index cb45a25043c0..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointConnectionsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.PrivateEndpointConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"f\"},\"privateLinkServiceConnectionState\":{\"status\":\"jmvl\",\"description\":\"z\",\"actionsRequired\":\"blkujrllfojuidjp\"},\"groupId\":\"yjucejikzoeo\",\"provisioningState\":\"tzejetjklnt\"},\"id\":\"yjuzkdb\",\"name\":\"zolxrzvhqjwtr\",\"type\":\"tgvgzp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateEndpointConnections().list("ztlvtmvagbwidqlv", "ukoveofi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jmvl", response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("z", response.iterator().next().privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointPropertyTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointPropertyTests.java deleted file mode 100644 index 42fb778475d8..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateEndpointPropertyTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.PrivateEndpointProperty; - -public final class PrivateEndpointPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointProperty model = - BinaryData.fromString("{\"id\":\"qulngsntnbybkzgc\"}").toObject(PrivateEndpointProperty.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointProperty model = new PrivateEndpointProperty(); - model = BinaryData.fromObject(model).toObject(PrivateEndpointProperty.class); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourceInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index 909f43c8649a..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceInner; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"groupId\":\"fnjhfjxwmszkkfo\",\"requiredMembers\":[\"yfkzik\",\"jawneaiv\",\"wczelpci\"],\"requiredZoneNames\":[\"sfeaenwabfat\",\"lddxbjhwua\",\"nozj\",\"sphyoulpjrvxa\"]},\"id\":\"rvimjwosytxitcsk\",\"name\":\"cktqumiekkezzi\",\"type\":\"hlyfjhdgqgg\"}") - .toObject(PrivateLinkResourceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model = new PrivateLinkResourceInner(); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourceListResultTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourceListResultTests.java deleted file mode 100644 index e13e0ff51e6a..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourceListResultTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.kusto.models.PrivateLinkResourceListResult; -import java.util.Arrays; - -public final class PrivateLinkResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"tlwwrlk\",\"requiredMembers\":[\"ncvokotllxdyhg\",\"y\"],\"requiredZoneNames\":[\"gjltdtbnnhado\",\"crkvcikhnv\",\"amqgxqquezikyw\",\"gxk\"]},\"id\":\"la\",\"name\":\"melwuipiccjz\",\"type\":\"z\"},{\"properties\":{\"groupId\":\"vvcnayr\",\"requiredMembers\":[\"nxxmueedndrdv\",\"tkwqqtchealm\",\"mtdaa\"],\"requiredZoneNames\":[\"v\",\"vgpiohgwxrt\"]},\"id\":\"dxepxgyq\",\"name\":\"gvr\",\"type\":\"mnpkukghimdblxg\"}]}") - .toObject(PrivateLinkResourceListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = - new PrivateLinkResourceListResult() - .withValue(Arrays.asList(new PrivateLinkResourceInner(), new PrivateLinkResourceInner())); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourcePropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index a0ddcd538e3b..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceProperties; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"dunyg\",\"requiredMembers\":[\"idb\",\"fatpxllrxcyjmoa\",\"su\",\"arm\"],\"requiredZoneNames\":[\"mjsjqb\",\"hhyxxrw\"]}") - .toObject(PrivateLinkResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties(); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourcesGetWithResponseMockTests.java deleted file mode 100644 index f4040b6f8486..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourcesGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.PrivateLinkResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"groupId\":\"hdroznnh\",\"requiredMembers\":[\"ktgj\",\"sggux\"],\"requiredZoneNames\":[\"lwywae\",\"czg\",\"bukklels\"]},\"id\":\"blycsxzujksr\",\"name\":\"smdesqplpvmjcd\",\"type\":\"ewbidyvteowxv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResource response = - manager - .privateLinkResources() - .getWithResponse("pqthehnmnaoya", "kcoeqswank", "t", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourcesListMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourcesListMockTests.java deleted file mode 100644 index ba57f293cf7f..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkResourcesListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.PrivateLinkResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"groupId\":\"svoujkxi\",\"requiredMembers\":[\"fhrkmdyom\",\"xfbvfb\",\"dy\"],\"requiredZoneNames\":[\"pwpgddei\",\"awzovgkk\",\"muikjcjcaztbws\",\"sqowxwc\"]},\"id\":\"likytwvczcswka\",\"name\":\"ve\",\"type\":\"yfdvlvhbwrnfxtgd\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateLinkResources().list("rseqwjksghudgz", "xog", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkServiceConnectionStatePropertyTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkServiceConnectionStatePropertyTests.java deleted file mode 100644 index 4e2e96903ce0..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/PrivateLinkServiceConnectionStatePropertyTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.PrivateLinkServiceConnectionStateProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStatePropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionStateProperty model = - BinaryData - .fromString("{\"status\":\"wclxxwrl\",\"description\":\"ouskcqvkocrc\",\"actionsRequired\":\"kwt\"}") - .toObject(PrivateLinkServiceConnectionStateProperty.class); - Assertions.assertEquals("wclxxwrl", model.status()); - Assertions.assertEquals("ouskcqvkocrc", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionStateProperty model = - new PrivateLinkServiceConnectionStateProperty().withStatus("wclxxwrl").withDescription("ouskcqvkocrc"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionStateProperty.class); - Assertions.assertEquals("wclxxwrl", model.status()); - Assertions.assertEquals("ouskcqvkocrc", model.description()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ReadOnlyFollowingDatabasePropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ReadOnlyFollowingDatabasePropertiesTests.java deleted file mode 100644 index f302f4ae0a22..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ReadOnlyFollowingDatabasePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.ReadOnlyFollowingDatabaseProperties; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ReadOnlyFollowingDatabasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReadOnlyFollowingDatabaseProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Failed\",\"softDeletePeriod\":\"PT16H20M50S\",\"hotCachePeriod\":\"PT105H24M9S\",\"statistics\":{\"size\":88.15698},\"leaderClusterResourceId\":\"utr\",\"attachedDatabaseConfigurationName\":\"upauut\",\"principalsModificationKind\":\"Replace\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"hej\"],\"tablesToExclude\":[\"zpnfqntcypsxj\"],\"externalTablesToInclude\":[\"imwkslircizj\",\"vydfceacvlhvygdy\",\"t\"],\"externalTablesToExclude\":[\"twnawjslbiwkojgc\",\"ztsfmznbaeqp\",\"chqnrnrpxehuwry\"],\"materializedViewsToInclude\":[\"aifmvikl\",\"ydv\"],\"materializedViewsToExclude\":[\"ejd\",\"nxcvds\",\"hnjivo\"],\"functionsToInclude\":[\"novqfzge\",\"jdftuljltd\",\"ceamtm\",\"zuo\"],\"functionsToExclude\":[\"wcw\"]},\"originalDatabaseName\":\"ioknssxmoj\",\"databaseShareOrigin\":\"Direct\",\"suspensionDetails\":{\"suspensionStartDate\":\"2021-02-27T14:03:02Z\"}}") - .toObject(ReadOnlyFollowingDatabaseProperties.class); - Assertions.assertEquals(Duration.parse("PT105H24M9S"), model.hotCachePeriod()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReadOnlyFollowingDatabaseProperties model = - new ReadOnlyFollowingDatabaseProperties().withHotCachePeriod(Duration.parse("PT105H24M9S")); - model = BinaryData.fromObject(model).toObject(ReadOnlyFollowingDatabaseProperties.class); - Assertions.assertEquals(Duration.parse("PT105H24M9S"), model.hotCachePeriod()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ReadOnlyFollowingDatabaseTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ReadOnlyFollowingDatabaseTests.java deleted file mode 100644 index 20ca415edcac..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ReadOnlyFollowingDatabaseTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.ReadOnlyFollowingDatabase; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ReadOnlyFollowingDatabaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReadOnlyFollowingDatabase model = - BinaryData - .fromString( - "{\"kind\":\"ReadOnlyFollowing\",\"properties\":{\"provisioningState\":\"Creating\",\"softDeletePeriod\":\"PT198H7M47S\",\"hotCachePeriod\":\"PT87H56M58S\",\"statistics\":{\"size\":60.990345},\"leaderClusterResourceId\":\"zpjuohminyfl\",\"attachedDatabaseConfigurationName\":\"rwm\",\"principalsModificationKind\":\"None\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"lvxwmyg\",\"xpgpq\"],\"tablesToExclude\":[\"sze\"],\"externalTablesToInclude\":[\"bjcrxgibbdaxco\"],\"externalTablesToExclude\":[\"zauorsuk\",\"kwbqplhlvnuu\",\"pzlrphw\",\"soldweyuqdunv\"],\"materializedViewsToInclude\":[\"rwrbi\",\"rk\",\"alywjhhgdn\"],\"materializedViewsToExclude\":[\"sivfomilo\"],\"functionsToInclude\":[\"dufiq\",\"dieuzaofj\"],\"functionsToExclude\":[\"cyyysfgdot\"]},\"originalDatabaseName\":\"biipuip\",\"databaseShareOrigin\":\"Other\",\"suspensionDetails\":{\"suspensionStartDate\":\"2021-04-29T06:53:37Z\"}},\"location\":\"cje\",\"id\":\"nizshqvcim\",\"name\":\"ev\",\"type\":\"gmblrri\"}") - .toObject(ReadOnlyFollowingDatabase.class); - Assertions.assertEquals("cje", model.location()); - Assertions.assertEquals(Duration.parse("PT87H56M58S"), model.hotCachePeriod()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReadOnlyFollowingDatabase model = - new ReadOnlyFollowingDatabase().withLocation("cje").withHotCachePeriod(Duration.parse("PT87H56M58S")); - model = BinaryData.fromObject(model).toObject(ReadOnlyFollowingDatabase.class); - Assertions.assertEquals("cje", model.location()); - Assertions.assertEquals(Duration.parse("PT87H56M58S"), model.hotCachePeriod()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ResourceSkuCapabilitiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ResourceSkuCapabilitiesTests.java deleted file mode 100644 index b776c8a61034..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ResourceSkuCapabilitiesTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.ResourceSkuCapabilities; - -public final class ResourceSkuCapabilitiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSkuCapabilities model = - BinaryData.fromString("{\"name\":\"r\",\"value\":\"xpvgo\"}").toObject(ResourceSkuCapabilities.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSkuCapabilities model = new ResourceSkuCapabilities(); - model = BinaryData.fromObject(model).toObject(ResourceSkuCapabilities.class); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ResourceSkuZoneDetailsTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ResourceSkuZoneDetailsTests.java deleted file mode 100644 index 7a64a8d02ac5..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ResourceSkuZoneDetailsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.ResourceSkuZoneDetails; - -public final class ResourceSkuZoneDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSkuZoneDetails model = - BinaryData - .fromString( - "{\"name\":[\"wbme\",\"hseyvju\"],\"capabilities\":[{\"name\":\"lhspkdee\",\"value\":\"ofmxagkvtmelmqkr\"},{\"name\":\"hvljuahaquh\",\"value\":\"hmdua\"},{\"name\":\"exq\",\"value\":\"fadmws\"}]}") - .toObject(ResourceSkuZoneDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSkuZoneDetails model = new ResourceSkuZoneDetails(); - model = BinaryData.fromObject(model).toObject(ResourceSkuZoneDetails.class); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ScriptCheckNameRequestTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ScriptCheckNameRequestTests.java deleted file mode 100644 index 1b457eb05f4d..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ScriptCheckNameRequestTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.ScriptCheckNameRequest; -import org.junit.jupiter.api.Assertions; - -public final class ScriptCheckNameRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptCheckNameRequest model = - BinaryData.fromString("{\"name\":\"ihxumwctondzj\"}").toObject(ScriptCheckNameRequest.class); - Assertions.assertEquals("ihxumwctondzj", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptCheckNameRequest model = new ScriptCheckNameRequest().withName("ihxumwctondzj"); - model = BinaryData.fromObject(model).toObject(ScriptCheckNameRequest.class); - Assertions.assertEquals("ihxumwctondzj", model.name()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ScriptsCheckNameAvailabilityWithResponseMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ScriptsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index c07b1e4efa30..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ScriptsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.CheckNameResult; -import com.azure.resourcemanager.kusto.models.Reason; -import com.azure.resourcemanager.kusto.models.ScriptCheckNameRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ScriptsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"nameAvailable\":true,\"name\":\"lbmoichd\",\"message\":\"nfpubntnbatz\",\"reason\":\"Invalid\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameResult response = - manager - .scripts() - .checkNameAvailabilityWithResponse( - "qotoihiqakydiwfb", - "kwpzdqtvh", - "spodaqax", - new ScriptCheckNameRequest().withName("ipietgbe"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("lbmoichd", response.name()); - Assertions.assertEquals("nfpubntnbatz", response.message()); - Assertions.assertEquals(Reason.INVALID, response.reason()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ScriptsDeleteMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ScriptsDeleteMockTests.java deleted file mode 100644 index a00b4cbd74cf..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/ScriptsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ScriptsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .scripts() - .delete("lhsrrry", "jylmbkzudnigr", "ihotjewlpxuzzjg", "refqy", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkuDescriptionInnerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkuDescriptionInnerTests.java deleted file mode 100644 index 1e98197459db..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkuDescriptionInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner; - -public final class SkuDescriptionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuDescriptionInner model = - BinaryData - .fromString( - "{\"resourceType\":\"aaxdbabphlwrq\",\"name\":\"ktsthsucocmny\",\"tier\":\"zt\",\"locations\":[\"wwrq\",\"uedck\"],\"locationInfo\":[{\"location\":\"biexzfeyu\",\"zones\":[\"ibx\",\"jwbhqwalmuz\",\"oxaepd\",\"zjancuxr\"],\"zoneDetails\":[{\"name\":[\"v\",\"bniwdj\",\"wz\",\"s\"],\"capabilities\":[{}]},{\"name\":[\"xytxhpzxbz\",\"fzab\"],\"capabilities\":[{}]},{\"name\":[\"xwtctyqiklbbovpl\"],\"capabilities\":[{},{}]}]},{\"location\":\"hvgyuguosvmk\",\"zones\":[\"xquk\"],\"zoneDetails\":[{\"name\":[\"mg\",\"xnkjzkdesl\",\"vlopwiyighx\"],\"capabilities\":[{},{}]},{\"name\":[\"baiuebbaumny\"],\"capabilities\":[{}]},{\"name\":[\"eojnabc\"],\"capabilities\":[{},{},{}]}]},{\"location\":\"mtxpsiebtfh\",\"zones\":[\"sapskr\"],\"zoneDetails\":[{\"name\":[\"jdhtldwkyzxu\",\"tkncwsc\"],\"capabilities\":[{},{},{},{}]},{\"name\":[\"otogtwrupqs\",\"vnm\",\"cykvceo\",\"eil\"],\"capabilities\":[{},{},{},{}]},{\"name\":[\"yfjfcnjbkcn\",\"dhbt\",\"kphywpnvjto\",\"nermcl\"],\"capabilities\":[{},{}]},{\"name\":[\"oxuscrpabgyepsbj\",\"azqugxywpmueefj\"],\"capabilities\":[{},{}]}]}],\"restrictions\":[\"dataq\",\"datajidsuyonobglaoc\",\"dataxtccmg\"]}") - .toObject(SkuDescriptionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuDescriptionInner model = new SkuDescriptionInner(); - model = BinaryData.fromObject(model).toObject(SkuDescriptionInner.class); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkuDescriptionListTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkuDescriptionListTests.java deleted file mode 100644 index a5b0a408abd4..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkuDescriptionListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.SkuDescriptionList; - -public final class SkuDescriptionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuDescriptionList model = - BinaryData - .fromString( - "{\"value\":[{\"resourceType\":\"dxwzywqsmbsurexi\",\"name\":\"ryocfsfksymdd\",\"tier\":\"tki\",\"locations\":[\"hqyudxorrqnbpoc\",\"vyifqrvkdvjsl\",\"rm\",\"vdfwatkpn\"],\"locationInfo\":[{\"location\":\"exxbczwtr\",\"zones\":[\"qzbqjvsov\",\"yokacspkw\"],\"zoneDetails\":[{},{},{},{}]},{\"location\":\"dobpxjmflbvvn\",\"zones\":[\"kcciwwzjuqkhr\",\"ajiwkuo\",\"oskg\"],\"zoneDetails\":[{}]},{\"location\":\"uuimjmvxieduug\",\"zones\":[\"jrrfbyaosve\"],\"zoneDetails\":[{},{},{}]}],\"restrictions\":[\"datapclhocohslk\"]},{\"resourceType\":\"leggzfbu\",\"name\":\"mvfaxkffeiith\",\"tier\":\"m\",\"locations\":[\"v\",\"hxmzsbbzoggig\"],\"locationInfo\":[{\"location\":\"burvjxxjnspy\",\"zones\":[\"koen\"],\"zoneDetails\":[{},{},{}]},{\"location\":\"knvudwtiukb\",\"zones\":[\"gkpocipazyxoe\",\"ukgjnpiucgygevq\",\"ntypmrbpizcdrqj\"],\"zoneDetails\":[{}]},{\"location\":\"ydnfyhxdeoejz\",\"zones\":[\"ifsjttgzfbishcb\"],\"zoneDetails\":[{},{},{},{}]},{\"location\":\"jdeyeamdpha\",\"zones\":[\"pbuxwgipwhon\",\"wkgshwa\",\"kix\",\"bin\"],\"zoneDetails\":[{}]}],\"restrictions\":[\"datatmryw\",\"datauzoqft\",\"datayqzrnkcqvyxlw\"]},{\"resourceType\":\"lsicohoqqnwv\",\"name\":\"yav\",\"tier\":\"heun\",\"locations\":[\"hgyxzkonoc\",\"koklya\",\"uconuqszfkbey\",\"ewrmjmwvvjektc\"],\"locationInfo\":[{\"location\":\"nhwlrsffrzpwvl\",\"zones\":[\"gbiqylihkaet\"],\"zoneDetails\":[{},{},{}]},{\"location\":\"vfcivfsnkymuc\",\"zones\":[\"jf\",\"ebrjcxe\",\"fuwutttxf\"],\"zoneDetails\":[{},{}]}],\"restrictions\":[\"datarp\"]},{\"resourceType\":\"epcyvahfnlj\",\"name\":\"qxj\",\"tier\":\"ujqgidok\",\"locations\":[\"jyoxgvclt\",\"gsncghkjeszz\",\"bijhtxfvgxbf\"],\"locationInfo\":[{\"location\":\"nehmpvecx\",\"zones\":[\"ebfqkkrbm\",\"ukgri\",\"flz\",\"fbxzpuzycisp\"],\"zoneDetails\":[{},{},{},{}]},{\"location\":\"ahmgkbrp\",\"zones\":[\"hibnuqqkpika\",\"rgvtqag\"],\"zoneDetails\":[{},{}]},{\"location\":\"ynhijggme\",\"zones\":[\"iarbutrcvpna\",\"zmhjrunmp\",\"ttdbhrbnl\"],\"zoneDetails\":[{}]}],\"restrictions\":[\"datayskpbhen\",\"datatkcxywnytnrsy\",\"datalqidyby\",\"dataczfc\"]}]}") - .toObject(SkuDescriptionList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuDescriptionList model = new SkuDescriptionList(); - model = BinaryData.fromObject(model).toObject(SkuDescriptionList.class); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkuLocationInfoItemTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkuLocationInfoItemTests.java deleted file mode 100644 index be5c74f6e45a..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkuLocationInfoItemTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.ResourceSkuZoneDetails; -import com.azure.resourcemanager.kusto.models.SkuLocationInfoItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SkuLocationInfoItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuLocationInfoItem model = - BinaryData - .fromString( - "{\"location\":\"udxytlmoyrx\",\"zones\":[\"u\",\"wpzntxhdzh\"],\"zoneDetails\":[{\"name\":[\"hckfrlhrx\"],\"capabilities\":[{\"name\":\"vpycanuzbp\",\"value\":\"afkuwb\"}]}]}") - .toObject(SkuLocationInfoItem.class); - Assertions.assertEquals("udxytlmoyrx", model.location()); - Assertions.assertEquals("u", model.zones().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuLocationInfoItem model = - new SkuLocationInfoItem() - .withLocation("udxytlmoyrx") - .withZones(Arrays.asList("u", "wpzntxhdzh")) - .withZoneDetails(Arrays.asList(new ResourceSkuZoneDetails())); - model = BinaryData.fromObject(model).toObject(SkuLocationInfoItem.class); - Assertions.assertEquals("udxytlmoyrx", model.location()); - Assertions.assertEquals("u", model.zones().get(0)); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkusListMockTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkusListMockTests.java deleted file mode 100644 index 1f518f85d096..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SkusListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.kusto.KustoManager; -import com.azure.resourcemanager.kusto.models.SkuDescription; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SkusListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"resourceType\":\"q\",\"name\":\"aj\",\"tier\":\"wxacevehj\",\"locations\":[\"xoafgaoqltfae\",\"linmfgv\"],\"locationInfo\":[{\"location\":\"pghriypoqeyhl\",\"zones\":[\"kprlpyznuc\",\"qdsmexiit\",\"fuxtyasiibmiybnn\"],\"zoneDetails\":[{\"name\":[\"ljhnmgixhcmav\"],\"capabilities\":[{},{}]},{\"name\":[\"dorhcgyyp\",\"otwypundmb\"],\"capabilities\":[{},{},{},{}]},{\"name\":[\"mjkavlgorbmft\",\"mdtzfjltfvnzc\",\"jtotpvopvpbd\",\"zq\"],\"capabilities\":[{}]},{\"name\":[\"edsvqwthmk\",\"ibcysihsgqc\",\"dhohsdtmcdzsuf\",\"ohdxbzlmcmu\"],\"capabilities\":[{}]}]}],\"restrictions\":[\"datadbevwqqxeysko\",\"dataqzinkfkbg\",\"dataz\",\"dataowxeqocljmy\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - KustoManager manager = - KustoManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.skus().list("acvbmqz", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SuspensionDetailsTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SuspensionDetailsTests.java deleted file mode 100644 index b5f76a5f8cf0..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/SuspensionDetailsTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.SuspensionDetails; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class SuspensionDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SuspensionDetails model = - BinaryData - .fromString("{\"suspensionStartDate\":\"2021-03-01T20:41:09Z\"}") - .toObject(SuspensionDetails.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-01T20:41:09Z"), model.suspensionStartDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SuspensionDetails model = - new SuspensionDetails().withSuspensionStartDate(OffsetDateTime.parse("2021-03-01T20:41:09Z")); - model = BinaryData.fromObject(model).toObject(SuspensionDetails.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-01T20:41:09Z"), model.suspensionStartDate()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/TableLevelSharingPropertiesTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/TableLevelSharingPropertiesTests.java deleted file mode 100644 index 850b60d7ec36..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/TableLevelSharingPropertiesTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.TableLevelSharingProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TableLevelSharingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TableLevelSharingProperties model = - BinaryData - .fromString( - "{\"tablesToInclude\":[\"ivkwlzuvccfwnfnb\",\"cfionl\",\"bxetqgtzxdpn\"],\"tablesToExclude\":[\"qwxrjfeallnw\"],\"externalTablesToInclude\":[\"isnjampmngnz\",\"c\"],\"externalTablesToExclude\":[\"wooc\",\"cbonqvpk\",\"lrxnjeaseiphe\"],\"materializedViewsToInclude\":[\"okeyyienj\",\"dlwtgrhpdj\"],\"materializedViewsToExclude\":[\"masxazjpqyegu\",\"lhbxxhejjzzvdud\",\"wdslfhotwmcy\"],\"functionsToInclude\":[\"lbjnpgacftadehx\",\"ltyfsop\",\"usue\",\"nzwdejba\"],\"functionsToExclude\":[\"xzdmohctb\",\"vudwx\",\"ndnvo\",\"gujjugwdkcglh\"]}") - .toObject(TableLevelSharingProperties.class); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.tablesToInclude().get(0)); - Assertions.assertEquals("qwxrjfeallnw", model.tablesToExclude().get(0)); - Assertions.assertEquals("isnjampmngnz", model.externalTablesToInclude().get(0)); - Assertions.assertEquals("wooc", model.externalTablesToExclude().get(0)); - Assertions.assertEquals("okeyyienj", model.materializedViewsToInclude().get(0)); - Assertions.assertEquals("masxazjpqyegu", model.materializedViewsToExclude().get(0)); - Assertions.assertEquals("lbjnpgacftadehx", model.functionsToInclude().get(0)); - Assertions.assertEquals("xzdmohctb", model.functionsToExclude().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TableLevelSharingProperties model = - new TableLevelSharingProperties() - .withTablesToInclude(Arrays.asList("ivkwlzuvccfwnfnb", "cfionl", "bxetqgtzxdpn")) - .withTablesToExclude(Arrays.asList("qwxrjfeallnw")) - .withExternalTablesToInclude(Arrays.asList("isnjampmngnz", "c")) - .withExternalTablesToExclude(Arrays.asList("wooc", "cbonqvpk", "lrxnjeaseiphe")) - .withMaterializedViewsToInclude(Arrays.asList("okeyyienj", "dlwtgrhpdj")) - .withMaterializedViewsToExclude(Arrays.asList("masxazjpqyegu", "lhbxxhejjzzvdud", "wdslfhotwmcy")) - .withFunctionsToInclude(Arrays.asList("lbjnpgacftadehx", "ltyfsop", "usue", "nzwdejba")) - .withFunctionsToExclude(Arrays.asList("xzdmohctb", "vudwx", "ndnvo", "gujjugwdkcglh")); - model = BinaryData.fromObject(model).toObject(TableLevelSharingProperties.class); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.tablesToInclude().get(0)); - Assertions.assertEquals("qwxrjfeallnw", model.tablesToExclude().get(0)); - Assertions.assertEquals("isnjampmngnz", model.externalTablesToInclude().get(0)); - Assertions.assertEquals("wooc", model.externalTablesToExclude().get(0)); - Assertions.assertEquals("okeyyienj", model.materializedViewsToInclude().get(0)); - Assertions.assertEquals("masxazjpqyegu", model.materializedViewsToExclude().get(0)); - Assertions.assertEquals("lbjnpgacftadehx", model.functionsToInclude().get(0)); - Assertions.assertEquals("xzdmohctb", model.functionsToExclude().get(0)); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/TrustedExternalTenantTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/TrustedExternalTenantTests.java deleted file mode 100644 index 4b4e3f9b9d3a..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/TrustedExternalTenantTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.TrustedExternalTenant; -import org.junit.jupiter.api.Assertions; - -public final class TrustedExternalTenantTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrustedExternalTenant model = - BinaryData.fromString("{\"value\":\"soacctazakl\"}").toObject(TrustedExternalTenant.class); - Assertions.assertEquals("soacctazakl", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrustedExternalTenant model = new TrustedExternalTenant().withValue("soacctazakl"); - model = BinaryData.fromObject(model).toObject(TrustedExternalTenant.class); - Assertions.assertEquals("soacctazakl", model.value()); - } -} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/VirtualNetworkConfigurationTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/VirtualNetworkConfigurationTests.java deleted file mode 100644 index 86189d08fff3..000000000000 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/generated/VirtualNetworkConfigurationTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kusto.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.kusto.models.VirtualNetworkConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class VirtualNetworkConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkConfiguration model = - BinaryData - .fromString( - "{\"subnetId\":\"cr\",\"enginePublicIpId\":\"ffdfdosygexpa\",\"dataManagementPublicIpId\":\"jakhmsbzjh\"}") - .toObject(VirtualNetworkConfiguration.class); - Assertions.assertEquals("cr", model.subnetId()); - Assertions.assertEquals("ffdfdosygexpa", model.enginePublicIpId()); - Assertions.assertEquals("jakhmsbzjh", model.dataManagementPublicIpId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkConfiguration model = - new VirtualNetworkConfiguration() - .withSubnetId("cr") - .withEnginePublicIpId("ffdfdosygexpa") - .withDataManagementPublicIpId("jakhmsbzjh"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkConfiguration.class); - Assertions.assertEquals("cr", model.subnetId()); - Assertions.assertEquals("ffdfdosygexpa", model.enginePublicIpId()); - Assertions.assertEquals("jakhmsbzjh", model.dataManagementPublicIpId()); - } -}