diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md index 6ff137549136..bbc0c0cfe157 100644 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.7 (Unreleased) +## 1.0.0-beta.1 (2023-08-01) + +- Azure Resource Manager MobileNetwork client library for Java. This package contains Microsoft Azure SDK for MobileNetwork Management SDK. The resources in this API specification will be used to manage attached data network resources in mobile network attached to a particular packet core instance. Package tag package-2023-06. 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/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md index 11f57ee57317..2f4bbc7e8161 100644 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-mobilenetwork - 1.0.0-beta.6 + 1.0.0-beta.7 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java index 564b485e346f..a921b590bd1f 100644 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java @@ -262,7 +262,7 @@ public MobileNetworkManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.mobilenetwork") .append("/") - .append("1.0.0-beta.6"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AmbrTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AmbrTests.java deleted file mode 100644 index 429ffd35bc08..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AmbrTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import org.junit.jupiter.api.Assertions; - -public final class AmbrTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Ambr model = BinaryData.fromString("{\"uplink\":\"fbn\",\"downlink\":\"lmctlpd\"}").toObject(Ambr.class); - Assertions.assertEquals("fbn", model.uplink()); - Assertions.assertEquals("lmctlpd", model.downlink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Ambr model = new Ambr().withUplink("fbn").withDownlink("lmctlpd"); - model = BinaryData.fromObject(model).toObject(Ambr.class); - Assertions.assertEquals("fbn", model.uplink()); - Assertions.assertEquals("lmctlpd", model.downlink()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AsyncOperationIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AsyncOperationIdTests.java deleted file mode 100644 index cfb9d479c749..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AsyncOperationIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.AsyncOperationId; -import org.junit.jupiter.api.Assertions; - -public final class AsyncOperationIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AsyncOperationId model = BinaryData.fromString("{\"id\":\"baumnyqupedeoj\"}").toObject(AsyncOperationId.class); - Assertions.assertEquals("baumnyqupedeoj", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AsyncOperationId model = new AsyncOperationId().withId("baumnyqupedeoj"); - model = BinaryData.fromObject(model).toObject(AsyncOperationId.class); - Assertions.assertEquals("baumnyqupedeoj", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AsyncOperationStatusInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AsyncOperationStatusInnerTests.java deleted file mode 100644 index 13534596de13..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AsyncOperationStatusInnerTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.AsyncOperationStatusInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class AsyncOperationStatusInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AsyncOperationStatusInner model = - BinaryData - .fromString( - "{\"id\":\"uaodsfcpk\",\"name\":\"odpuozmyzydag\",\"status\":\"uaxbezyiuokkt\",\"resourceId\":\"rdxwzywqsm\",\"startTime\":\"2021-02-03T23:59:34Z\",\"endTime\":\"2021-11-03T13:13:31Z\",\"percentComplete\":85.49606321618805,\"properties\":\"dataryocfsfksymdd\"}") - .toObject(AsyncOperationStatusInner.class); - Assertions.assertEquals("uaodsfcpk", model.id()); - Assertions.assertEquals("odpuozmyzydag", model.name()); - Assertions.assertEquals("uaxbezyiuokkt", model.status()); - Assertions.assertEquals("rdxwzywqsm", model.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-03T23:59:34Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T13:13:31Z"), model.endTime()); - Assertions.assertEquals(85.49606321618805D, model.percentComplete()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AsyncOperationStatusInner model = - new AsyncOperationStatusInner() - .withId("uaodsfcpk") - .withName("odpuozmyzydag") - .withStatus("uaxbezyiuokkt") - .withResourceId("rdxwzywqsm") - .withStartTime(OffsetDateTime.parse("2021-02-03T23:59:34Z")) - .withEndTime(OffsetDateTime.parse("2021-11-03T13:13:31Z")) - .withPercentComplete(85.49606321618805D) - .withProperties("dataryocfsfksymdd"); - model = BinaryData.fromObject(model).toObject(AsyncOperationStatusInner.class); - Assertions.assertEquals("uaodsfcpk", model.id()); - Assertions.assertEquals("odpuozmyzydag", model.name()); - Assertions.assertEquals("uaxbezyiuokkt", model.status()); - Assertions.assertEquals("rdxwzywqsm", model.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-03T23:59:34Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T13:13:31Z"), model.endTime()); - Assertions.assertEquals(85.49606321618805D, model.percentComplete()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkInnerTests.java deleted file mode 100644 index 7358447b841f..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkInnerTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.AttachedDataNetworkInner; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import com.azure.resourcemanager.mobilenetwork.models.NaptConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.NaptEnabled; -import com.azure.resourcemanager.mobilenetwork.models.PinholeTimeouts; -import com.azure.resourcemanager.mobilenetwork.models.PortRange; -import com.azure.resourcemanager.mobilenetwork.models.PortReuseHoldTimes; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AttachedDataNetworkInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedDataNetworkInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"userPlaneDataInterface\":{\"name\":\"quvgjxpybczme\",\"ipv4Address\":\"tzopbsphrupidgsy\",\"ipv4Subnet\":\"ejhphoyc\",\"ipv4Gateway\":\"xaobhdxbmtqioqjz\"},\"dnsAddresses\":[\"tbmufpo\",\"noi\"],\"naptConfiguration\":{\"enabled\":\"Disabled\",\"portRange\":{\"minPort\":167840319,\"maxPort\":201473614},\"portReuseHoldTime\":{\"tcp\":1372882397,\"udp\":1472149737},\"pinholeLimits\":231072361,\"pinholeTimeouts\":{\"tcp\":1450276464,\"udp\":1792128890,\"icmp\":1864680039}},\"userEquipmentAddressPoolPrefix\":[\"c\"],\"userEquipmentStaticAddressPoolPrefix\":[\"dznrbtcqq\",\"nq\",\"lhqgnufooojy\",\"ifsqesaagdfmg\"]},\"location\":\"lhjxr\",\"tags\":{\"uajpsquc\":\"wmrvktsizntocipa\"},\"id\":\"poyfdkfogkn\",\"name\":\"gjofjd\",\"type\":\"eqsrdeupewnwreit\"}") - .toObject(AttachedDataNetworkInner.class); - Assertions.assertEquals("lhjxr", model.location()); - Assertions.assertEquals("wmrvktsizntocipa", model.tags().get("uajpsquc")); - Assertions.assertEquals("quvgjxpybczme", model.userPlaneDataInterface().name()); - Assertions.assertEquals("tzopbsphrupidgsy", model.userPlaneDataInterface().ipv4Address()); - Assertions.assertEquals("ejhphoyc", model.userPlaneDataInterface().ipv4Subnet()); - Assertions.assertEquals("xaobhdxbmtqioqjz", model.userPlaneDataInterface().ipv4Gateway()); - Assertions.assertEquals("tbmufpo", model.dnsAddresses().get(0)); - Assertions.assertEquals(NaptEnabled.DISABLED, model.naptConfiguration().enabled()); - Assertions.assertEquals(167840319, model.naptConfiguration().portRange().minPort()); - Assertions.assertEquals(201473614, model.naptConfiguration().portRange().maxPort()); - Assertions.assertEquals(1372882397, model.naptConfiguration().portReuseHoldTime().tcp()); - Assertions.assertEquals(1472149737, model.naptConfiguration().portReuseHoldTime().udp()); - Assertions.assertEquals(231072361, model.naptConfiguration().pinholeLimits()); - Assertions.assertEquals(1450276464, model.naptConfiguration().pinholeTimeouts().tcp()); - Assertions.assertEquals(1792128890, model.naptConfiguration().pinholeTimeouts().udp()); - Assertions.assertEquals(1864680039, model.naptConfiguration().pinholeTimeouts().icmp()); - Assertions.assertEquals("c", model.userEquipmentAddressPoolPrefix().get(0)); - Assertions.assertEquals("dznrbtcqq", model.userEquipmentStaticAddressPoolPrefix().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedDataNetworkInner model = - new AttachedDataNetworkInner() - .withLocation("lhjxr") - .withTags(mapOf("uajpsquc", "wmrvktsizntocipa")) - .withUserPlaneDataInterface( - new InterfaceProperties() - .withName("quvgjxpybczme") - .withIpv4Address("tzopbsphrupidgsy") - .withIpv4Subnet("ejhphoyc") - .withIpv4Gateway("xaobhdxbmtqioqjz")) - .withDnsAddresses(Arrays.asList("tbmufpo", "noi")) - .withNaptConfiguration( - new NaptConfiguration() - .withEnabled(NaptEnabled.DISABLED) - .withPortRange(new PortRange().withMinPort(167840319).withMaxPort(201473614)) - .withPortReuseHoldTime(new PortReuseHoldTimes().withTcp(1372882397).withUdp(1472149737)) - .withPinholeLimits(231072361) - .withPinholeTimeouts( - new PinholeTimeouts().withTcp(1450276464).withUdp(1792128890).withIcmp(1864680039))) - .withUserEquipmentAddressPoolPrefix(Arrays.asList("c")) - .withUserEquipmentStaticAddressPoolPrefix( - Arrays.asList("dznrbtcqq", "nq", "lhqgnufooojy", "ifsqesaagdfmg")); - model = BinaryData.fromObject(model).toObject(AttachedDataNetworkInner.class); - Assertions.assertEquals("lhjxr", model.location()); - Assertions.assertEquals("wmrvktsizntocipa", model.tags().get("uajpsquc")); - Assertions.assertEquals("quvgjxpybczme", model.userPlaneDataInterface().name()); - Assertions.assertEquals("tzopbsphrupidgsy", model.userPlaneDataInterface().ipv4Address()); - Assertions.assertEquals("ejhphoyc", model.userPlaneDataInterface().ipv4Subnet()); - Assertions.assertEquals("xaobhdxbmtqioqjz", model.userPlaneDataInterface().ipv4Gateway()); - Assertions.assertEquals("tbmufpo", model.dnsAddresses().get(0)); - Assertions.assertEquals(NaptEnabled.DISABLED, model.naptConfiguration().enabled()); - Assertions.assertEquals(167840319, model.naptConfiguration().portRange().minPort()); - Assertions.assertEquals(201473614, model.naptConfiguration().portRange().maxPort()); - Assertions.assertEquals(1372882397, model.naptConfiguration().portReuseHoldTime().tcp()); - Assertions.assertEquals(1472149737, model.naptConfiguration().portReuseHoldTime().udp()); - Assertions.assertEquals(231072361, model.naptConfiguration().pinholeLimits()); - Assertions.assertEquals(1450276464, model.naptConfiguration().pinholeTimeouts().tcp()); - Assertions.assertEquals(1792128890, model.naptConfiguration().pinholeTimeouts().udp()); - Assertions.assertEquals(1864680039, model.naptConfiguration().pinholeTimeouts().icmp()); - Assertions.assertEquals("c", model.userEquipmentAddressPoolPrefix().get(0)); - Assertions.assertEquals("dznrbtcqq", model.userEquipmentStaticAddressPoolPrefix().get(0)); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkListResultTests.java deleted file mode 100644 index 77e0ce424f3a..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkListResultTests.java +++ /dev/null @@ -1,179 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.AttachedDataNetworkInner; -import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetworkListResult; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import com.azure.resourcemanager.mobilenetwork.models.NaptConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.NaptEnabled; -import com.azure.resourcemanager.mobilenetwork.models.PinholeTimeouts; -import com.azure.resourcemanager.mobilenetwork.models.PortRange; -import com.azure.resourcemanager.mobilenetwork.models.PortReuseHoldTimes; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AttachedDataNetworkListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedDataNetworkListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"userPlaneDataInterface\":{\"name\":\"t\",\"ipv4Address\":\"mdvpjhulsu\",\"ipv4Subnet\":\"mkjozkrwf\",\"ipv4Gateway\":\"iodjp\"},\"dnsAddresses\":[\"w\",\"jdpvwryo\"],\"naptConfiguration\":{\"enabled\":\"Enabled\",\"portRange\":{\"minPort\":2018987029,\"maxPort\":1285377118},\"portReuseHoldTime\":{\"tcp\":1137960460,\"udp\":124042122},\"pinholeLimits\":1063449943,\"pinholeTimeouts\":{\"tcp\":276706615,\"udp\":2140975130,\"icmp\":1060950423}},\"userEquipmentAddressPoolPrefix\":[\"dosyg\",\"xpaojakhmsbz\"],\"userEquipmentStaticAddressPoolPrefix\":[\"rzevdphlxaol\",\"hqtrgqjbpf\",\"fsinzgvfcjrwzoxx\"]},\"location\":\"felluwfzitonpe\",\"tags\":{\"ypininm\":\"jkjlxofpdvhpfx\",\"po\":\"yhuybbkpod\",\"ognarxzxtheotus\":\"ginuvamih\"},\"id\":\"vyevcciqi\",\"name\":\"nhungbw\",\"type\":\"zrnf\"},{\"properties\":{\"provisioningState\":\"Failed\",\"userPlaneDataInterface\":{\"name\":\"ispe\",\"ipv4Address\":\"tzfkufubl\",\"ipv4Subnet\":\"fxqeof\",\"ipv4Gateway\":\"e\"},\"dnsAddresses\":[\"hqjbasvmsmj\",\"ulngsntn\",\"ybkzgcwr\",\"clxxwrljdo\"],\"naptConfiguration\":{\"enabled\":\"Disabled\",\"portRange\":{\"minPort\":1132832602,\"maxPort\":422670277},\"portReuseHoldTime\":{\"tcp\":1066142513,\"udp\":747491790},\"pinholeLimits\":1343054120,\"pinholeTimeouts\":{\"tcp\":24386691,\"udp\":1728330738,\"icmp\":1272736991}},\"userEquipmentAddressPoolPrefix\":[\"sqrglssainq\",\"jwnzlljfmp\",\"eebvmgxsab\"],\"userEquipmentStaticAddressPoolPrefix\":[\"duuji\",\"c\",\"czdzev\",\"dhkrwpdappdsbdk\"]},\"location\":\"rwjfe\",\"tags\":{\"tmrldhugjzzdatq\":\"hutje\",\"gphuticndvka\":\"hocdgeab\",\"k\":\"zwyiftyhxhur\",\"kjfkg\":\"tyxolniwpwc\"},\"id\":\"awxklr\",\"name\":\"plwckbas\",\"type\":\"ypnddhsgcb\"},{\"properties\":{\"provisioningState\":\"Unknown\",\"userPlaneDataInterface\":{\"name\":\"ejk\",\"ipv4Address\":\"ynqgoulzndlikwyq\",\"ipv4Subnet\":\"fgibmadgakeq\",\"ipv4Gateway\":\"xybz\"},\"dnsAddresses\":[\"e\",\"qytbciq\",\"ouf\",\"mmnkzsmodmgl\"],\"naptConfiguration\":{\"enabled\":\"Enabled\",\"portRange\":{\"minPort\":1951665736,\"maxPort\":542784283},\"portReuseHoldTime\":{\"tcp\":1183608022,\"udp\":1581209984},\"pinholeLimits\":289494577,\"pinholeTimeouts\":{\"tcp\":1911925190,\"udp\":1035420183,\"icmp\":1593608704}},\"userEquipmentAddressPoolPrefix\":[\"rtumkdosvq\",\"hbmdgbbjfdd\"],\"userEquipmentStaticAddressPoolPrefix\":[\"mbe\",\"ppbhtqqrolfp\",\"psalgbqux\",\"gjyjgzjaoyfhrtxi\"]},\"location\":\"erkujys\",\"tags\":{\"awrlyx\":\"juvf\"},\"id\":\"jkcpr\",\"name\":\"nwbxgjvtbvpyssz\",\"type\":\"nruj\"}],\"nextLink\":\"uhmuouqfprwzwbn\"}") - .toObject(AttachedDataNetworkListResult.class); - Assertions.assertEquals("felluwfzitonpe", model.value().get(0).location()); - Assertions.assertEquals("jkjlxofpdvhpfx", model.value().get(0).tags().get("ypininm")); - Assertions.assertEquals("t", model.value().get(0).userPlaneDataInterface().name()); - Assertions.assertEquals("mdvpjhulsu", model.value().get(0).userPlaneDataInterface().ipv4Address()); - Assertions.assertEquals("mkjozkrwf", model.value().get(0).userPlaneDataInterface().ipv4Subnet()); - Assertions.assertEquals("iodjp", model.value().get(0).userPlaneDataInterface().ipv4Gateway()); - Assertions.assertEquals("w", model.value().get(0).dnsAddresses().get(0)); - Assertions.assertEquals(NaptEnabled.ENABLED, model.value().get(0).naptConfiguration().enabled()); - Assertions.assertEquals(2018987029, model.value().get(0).naptConfiguration().portRange().minPort()); - Assertions.assertEquals(1285377118, model.value().get(0).naptConfiguration().portRange().maxPort()); - Assertions.assertEquals(1137960460, model.value().get(0).naptConfiguration().portReuseHoldTime().tcp()); - Assertions.assertEquals(124042122, model.value().get(0).naptConfiguration().portReuseHoldTime().udp()); - Assertions.assertEquals(1063449943, model.value().get(0).naptConfiguration().pinholeLimits()); - Assertions.assertEquals(276706615, model.value().get(0).naptConfiguration().pinholeTimeouts().tcp()); - Assertions.assertEquals(2140975130, model.value().get(0).naptConfiguration().pinholeTimeouts().udp()); - Assertions.assertEquals(1060950423, model.value().get(0).naptConfiguration().pinholeTimeouts().icmp()); - Assertions.assertEquals("dosyg", model.value().get(0).userEquipmentAddressPoolPrefix().get(0)); - Assertions.assertEquals("rzevdphlxaol", model.value().get(0).userEquipmentStaticAddressPoolPrefix().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedDataNetworkListResult model = - new AttachedDataNetworkListResult() - .withValue( - Arrays - .asList( - new AttachedDataNetworkInner() - .withLocation("felluwfzitonpe") - .withTags( - mapOf( - "ypininm", - "jkjlxofpdvhpfx", - "po", - "yhuybbkpod", - "ognarxzxtheotus", - "ginuvamih")) - .withUserPlaneDataInterface( - new InterfaceProperties() - .withName("t") - .withIpv4Address("mdvpjhulsu") - .withIpv4Subnet("mkjozkrwf") - .withIpv4Gateway("iodjp")) - .withDnsAddresses(Arrays.asList("w", "jdpvwryo")) - .withNaptConfiguration( - new NaptConfiguration() - .withEnabled(NaptEnabled.ENABLED) - .withPortRange(new PortRange().withMinPort(2018987029).withMaxPort(1285377118)) - .withPortReuseHoldTime( - new PortReuseHoldTimes().withTcp(1137960460).withUdp(124042122)) - .withPinholeLimits(1063449943) - .withPinholeTimeouts( - new PinholeTimeouts() - .withTcp(276706615) - .withUdp(2140975130) - .withIcmp(1060950423))) - .withUserEquipmentAddressPoolPrefix(Arrays.asList("dosyg", "xpaojakhmsbz")) - .withUserEquipmentStaticAddressPoolPrefix( - Arrays.asList("rzevdphlxaol", "hqtrgqjbpf", "fsinzgvfcjrwzoxx")), - new AttachedDataNetworkInner() - .withLocation("rwjfe") - .withTags( - mapOf( - "tmrldhugjzzdatq", - "hutje", - "gphuticndvka", - "hocdgeab", - "k", - "zwyiftyhxhur", - "kjfkg", - "tyxolniwpwc")) - .withUserPlaneDataInterface( - new InterfaceProperties() - .withName("ispe") - .withIpv4Address("tzfkufubl") - .withIpv4Subnet("fxqeof") - .withIpv4Gateway("e")) - .withDnsAddresses(Arrays.asList("hqjbasvmsmj", "ulngsntn", "ybkzgcwr", "clxxwrljdo")) - .withNaptConfiguration( - new NaptConfiguration() - .withEnabled(NaptEnabled.DISABLED) - .withPortRange(new PortRange().withMinPort(1132832602).withMaxPort(422670277)) - .withPortReuseHoldTime( - new PortReuseHoldTimes().withTcp(1066142513).withUdp(747491790)) - .withPinholeLimits(1343054120) - .withPinholeTimeouts( - new PinholeTimeouts() - .withTcp(24386691) - .withUdp(1728330738) - .withIcmp(1272736991))) - .withUserEquipmentAddressPoolPrefix( - Arrays.asList("sqrglssainq", "jwnzlljfmp", "eebvmgxsab")) - .withUserEquipmentStaticAddressPoolPrefix( - Arrays.asList("duuji", "c", "czdzev", "dhkrwpdappdsbdk")), - new AttachedDataNetworkInner() - .withLocation("erkujys") - .withTags(mapOf("awrlyx", "juvf")) - .withUserPlaneDataInterface( - new InterfaceProperties() - .withName("ejk") - .withIpv4Address("ynqgoulzndlikwyq") - .withIpv4Subnet("fgibmadgakeq") - .withIpv4Gateway("xybz")) - .withDnsAddresses(Arrays.asList("e", "qytbciq", "ouf", "mmnkzsmodmgl")) - .withNaptConfiguration( - new NaptConfiguration() - .withEnabled(NaptEnabled.ENABLED) - .withPortRange(new PortRange().withMinPort(1951665736).withMaxPort(542784283)) - .withPortReuseHoldTime( - new PortReuseHoldTimes().withTcp(1183608022).withUdp(1581209984)) - .withPinholeLimits(289494577) - .withPinholeTimeouts( - new PinholeTimeouts() - .withTcp(1911925190) - .withUdp(1035420183) - .withIcmp(1593608704))) - .withUserEquipmentAddressPoolPrefix(Arrays.asList("rtumkdosvq", "hbmdgbbjfdd")) - .withUserEquipmentStaticAddressPoolPrefix( - Arrays.asList("mbe", "ppbhtqqrolfp", "psalgbqux", "gjyjgzjaoyfhrtxi")))); - model = BinaryData.fromObject(model).toObject(AttachedDataNetworkListResult.class); - Assertions.assertEquals("felluwfzitonpe", model.value().get(0).location()); - Assertions.assertEquals("jkjlxofpdvhpfx", model.value().get(0).tags().get("ypininm")); - Assertions.assertEquals("t", model.value().get(0).userPlaneDataInterface().name()); - Assertions.assertEquals("mdvpjhulsu", model.value().get(0).userPlaneDataInterface().ipv4Address()); - Assertions.assertEquals("mkjozkrwf", model.value().get(0).userPlaneDataInterface().ipv4Subnet()); - Assertions.assertEquals("iodjp", model.value().get(0).userPlaneDataInterface().ipv4Gateway()); - Assertions.assertEquals("w", model.value().get(0).dnsAddresses().get(0)); - Assertions.assertEquals(NaptEnabled.ENABLED, model.value().get(0).naptConfiguration().enabled()); - Assertions.assertEquals(2018987029, model.value().get(0).naptConfiguration().portRange().minPort()); - Assertions.assertEquals(1285377118, model.value().get(0).naptConfiguration().portRange().maxPort()); - Assertions.assertEquals(1137960460, model.value().get(0).naptConfiguration().portReuseHoldTime().tcp()); - Assertions.assertEquals(124042122, model.value().get(0).naptConfiguration().portReuseHoldTime().udp()); - Assertions.assertEquals(1063449943, model.value().get(0).naptConfiguration().pinholeLimits()); - Assertions.assertEquals(276706615, model.value().get(0).naptConfiguration().pinholeTimeouts().tcp()); - Assertions.assertEquals(2140975130, model.value().get(0).naptConfiguration().pinholeTimeouts().udp()); - Assertions.assertEquals(1060950423, model.value().get(0).naptConfiguration().pinholeTimeouts().icmp()); - Assertions.assertEquals("dosyg", model.value().get(0).userEquipmentAddressPoolPrefix().get(0)); - Assertions.assertEquals("rzevdphlxaol", model.value().get(0).userEquipmentStaticAddressPoolPrefix().get(0)); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkPropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkPropertiesFormatTests.java deleted file mode 100644 index bf30aa1aa6ee..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkPropertiesFormatTests.java +++ /dev/null @@ -1,83 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.AttachedDataNetworkPropertiesFormat; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import com.azure.resourcemanager.mobilenetwork.models.NaptConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.NaptEnabled; -import com.azure.resourcemanager.mobilenetwork.models.PinholeTimeouts; -import com.azure.resourcemanager.mobilenetwork.models.PortRange; -import com.azure.resourcemanager.mobilenetwork.models.PortReuseHoldTimes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AttachedDataNetworkPropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedDataNetworkPropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Failed\",\"userPlaneDataInterface\":{\"name\":\"lusarh\",\"ipv4Address\":\"fcqhsmyurkd\",\"ipv4Subnet\":\"lx\",\"ipv4Gateway\":\"kuksjtxukcdm\"},\"dnsAddresses\":[\"rcryuanzwuxzdxta\",\"rlhm\",\"hfpmrqobmtukknr\",\"rtihfxtijbpz\"],\"naptConfiguration\":{\"enabled\":\"Disabled\",\"portRange\":{\"minPort\":477742160,\"maxPort\":1531004720},\"portReuseHoldTime\":{\"tcp\":271043498,\"udp\":1526885086},\"pinholeLimits\":504117688,\"pinholeTimeouts\":{\"tcp\":1760407196,\"udp\":1757371466,\"icmp\":1730607260}},\"userEquipmentAddressPoolPrefix\":[\"ufhfcbjysa\",\"ithxqhabifpi\"],\"userEquipmentStaticAddressPoolPrefix\":[\"czbysc\",\"pqxu\"]}") - .toObject(AttachedDataNetworkPropertiesFormat.class); - Assertions.assertEquals("lusarh", model.userPlaneDataInterface().name()); - Assertions.assertEquals("fcqhsmyurkd", model.userPlaneDataInterface().ipv4Address()); - Assertions.assertEquals("lx", model.userPlaneDataInterface().ipv4Subnet()); - Assertions.assertEquals("kuksjtxukcdm", model.userPlaneDataInterface().ipv4Gateway()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.dnsAddresses().get(0)); - Assertions.assertEquals(NaptEnabled.DISABLED, model.naptConfiguration().enabled()); - Assertions.assertEquals(477742160, model.naptConfiguration().portRange().minPort()); - Assertions.assertEquals(1531004720, model.naptConfiguration().portRange().maxPort()); - Assertions.assertEquals(271043498, model.naptConfiguration().portReuseHoldTime().tcp()); - Assertions.assertEquals(1526885086, model.naptConfiguration().portReuseHoldTime().udp()); - Assertions.assertEquals(504117688, model.naptConfiguration().pinholeLimits()); - Assertions.assertEquals(1760407196, model.naptConfiguration().pinholeTimeouts().tcp()); - Assertions.assertEquals(1757371466, model.naptConfiguration().pinholeTimeouts().udp()); - Assertions.assertEquals(1730607260, model.naptConfiguration().pinholeTimeouts().icmp()); - Assertions.assertEquals("ufhfcbjysa", model.userEquipmentAddressPoolPrefix().get(0)); - Assertions.assertEquals("czbysc", model.userEquipmentStaticAddressPoolPrefix().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedDataNetworkPropertiesFormat model = - new AttachedDataNetworkPropertiesFormat() - .withUserPlaneDataInterface( - new InterfaceProperties() - .withName("lusarh") - .withIpv4Address("fcqhsmyurkd") - .withIpv4Subnet("lx") - .withIpv4Gateway("kuksjtxukcdm")) - .withDnsAddresses(Arrays.asList("rcryuanzwuxzdxta", "rlhm", "hfpmrqobmtukknr", "rtihfxtijbpz")) - .withNaptConfiguration( - new NaptConfiguration() - .withEnabled(NaptEnabled.DISABLED) - .withPortRange(new PortRange().withMinPort(477742160).withMaxPort(1531004720)) - .withPortReuseHoldTime(new PortReuseHoldTimes().withTcp(271043498).withUdp(1526885086)) - .withPinholeLimits(504117688) - .withPinholeTimeouts( - new PinholeTimeouts().withTcp(1760407196).withUdp(1757371466).withIcmp(1730607260))) - .withUserEquipmentAddressPoolPrefix(Arrays.asList("ufhfcbjysa", "ithxqhabifpi")) - .withUserEquipmentStaticAddressPoolPrefix(Arrays.asList("czbysc", "pqxu")); - model = BinaryData.fromObject(model).toObject(AttachedDataNetworkPropertiesFormat.class); - Assertions.assertEquals("lusarh", model.userPlaneDataInterface().name()); - Assertions.assertEquals("fcqhsmyurkd", model.userPlaneDataInterface().ipv4Address()); - Assertions.assertEquals("lx", model.userPlaneDataInterface().ipv4Subnet()); - Assertions.assertEquals("kuksjtxukcdm", model.userPlaneDataInterface().ipv4Gateway()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.dnsAddresses().get(0)); - Assertions.assertEquals(NaptEnabled.DISABLED, model.naptConfiguration().enabled()); - Assertions.assertEquals(477742160, model.naptConfiguration().portRange().minPort()); - Assertions.assertEquals(1531004720, model.naptConfiguration().portRange().maxPort()); - Assertions.assertEquals(271043498, model.naptConfiguration().portReuseHoldTime().tcp()); - Assertions.assertEquals(1526885086, model.naptConfiguration().portReuseHoldTime().udp()); - Assertions.assertEquals(504117688, model.naptConfiguration().pinholeLimits()); - Assertions.assertEquals(1760407196, model.naptConfiguration().pinholeTimeouts().tcp()); - Assertions.assertEquals(1757371466, model.naptConfiguration().pinholeTimeouts().udp()); - Assertions.assertEquals(1730607260, model.naptConfiguration().pinholeTimeouts().icmp()); - Assertions.assertEquals("ufhfcbjysa", model.userEquipmentAddressPoolPrefix().get(0)); - Assertions.assertEquals("czbysc", model.userEquipmentStaticAddressPoolPrefix().get(0)); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkResourceIdTests.java deleted file mode 100644 index f029898bfb20..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworkResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetworkResourceId; -import org.junit.jupiter.api.Assertions; - -public final class AttachedDataNetworkResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedDataNetworkResourceId model = - BinaryData.fromString("{\"id\":\"imwkslircizj\"}").toObject(AttachedDataNetworkResourceId.class); - Assertions.assertEquals("imwkslircizj", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedDataNetworkResourceId model = new AttachedDataNetworkResourceId().withId("imwkslircizj"); - model = BinaryData.fromObject(model).toObject(AttachedDataNetworkResourceId.class); - Assertions.assertEquals("imwkslircizj", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksCreateOrUpdateMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksCreateOrUpdateMockTests.java deleted file mode 100644 index 6fea448dff27..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksCreateOrUpdateMockTests.java +++ /dev/null @@ -1,128 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetwork; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import com.azure.resourcemanager.mobilenetwork.models.NaptConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.NaptEnabled; -import com.azure.resourcemanager.mobilenetwork.models.PinholeTimeouts; -import com.azure.resourcemanager.mobilenetwork.models.PortRange; -import com.azure.resourcemanager.mobilenetwork.models.PortReuseHoldTimes; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -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 AttachedDataNetworksCreateOrUpdateMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"userPlaneDataInterface\":{\"name\":\"ywakoihk\",\"ipv4Address\":\"mjblmljhlny\",\"ipv4Subnet\":\"otqyry\",\"ipv4Gateway\":\"cbm\"},\"dnsAddresses\":[\"vxmvw\"],\"naptConfiguration\":{\"enabled\":\"Disabled\",\"portRange\":{\"minPort\":414360047,\"maxPort\":1016884622},\"portReuseHoldTime\":{\"tcp\":98251742,\"udp\":1744580177},\"pinholeLimits\":593939862,\"pinholeTimeouts\":{\"tcp\":559578866,\"udp\":1503247909,\"icmp\":489682268}},\"userEquipmentAddressPoolPrefix\":[\"nzoibgsxgnx\",\"yqo\",\"mpqoxw\",\"o\"],\"userEquipmentStaticAddressPoolPrefix\":[\"xiqxeiiqbimh\",\"mwwinhehfqpofv\",\"bcblemb\",\"kbwvqvxkdiv\"]},\"location\":\"heb\",\"tags\":{\"izvcjfe\":\"wbzuwfmdurage\",\"ggbqi\":\"isdju\",\"m\":\"kxkbsazgakgacyr\",\"pv\":\"dmspof\"},\"id\":\"hryl\",\"name\":\"iofrzgbzjedmstk\",\"type\":\"nlvxbcuii\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AttachedDataNetwork response = - manager - .attachedDataNetworks() - .define("zsvtuikzhajqgl") - .withRegion("glka") - .withExistingPacketCoreDataPlane("jng", "qdqx", "bjwgnyfus") - .withUserPlaneDataInterface( - new InterfaceProperties() - .withName("l") - .withIpv4Address("ryxynqnzrd") - .withIpv4Subnet("ovw") - .withIpv4Gateway("nptgoeiybba")) - .withDnsAddresses(Arrays.asList("fhvfsl", "vntjlrigjk")) - .withTags(mapOf("juj", "n", "cpopmxel", "ickpz", "xm", "wcltyjede", "kqscazuawxtzx", "f")) - .withNaptConfiguration( - new NaptConfiguration() - .withEnabled(NaptEnabled.ENABLED) - .withPortRange(new PortRange().withMinPort(1610623953).withMaxPort(714440003)) - .withPortReuseHoldTime(new PortReuseHoldTimes().withTcp(2075190734).withUdp(1304895406)) - .withPinholeLimits(2100581785) - .withPinholeTimeouts( - new PinholeTimeouts().withTcp(664139919).withUdp(300950097).withIcmp(969722323))) - .withUserEquipmentAddressPoolPrefix( - Arrays.asList("nmmaxrizkzob", "opxlhslnelxieixy", "llxecwc", "ojphslhc")) - .withUserEquipmentStaticAddressPoolPrefix(Arrays.asList("u", "i", "dwfmvigorqjb", "tzh")) - .create(); - - Assertions.assertEquals("heb", response.location()); - Assertions.assertEquals("wbzuwfmdurage", response.tags().get("izvcjfe")); - Assertions.assertEquals("ywakoihk", response.userPlaneDataInterface().name()); - Assertions.assertEquals("mjblmljhlny", response.userPlaneDataInterface().ipv4Address()); - Assertions.assertEquals("otqyry", response.userPlaneDataInterface().ipv4Subnet()); - Assertions.assertEquals("cbm", response.userPlaneDataInterface().ipv4Gateway()); - Assertions.assertEquals("vxmvw", response.dnsAddresses().get(0)); - Assertions.assertEquals(NaptEnabled.DISABLED, response.naptConfiguration().enabled()); - Assertions.assertEquals(414360047, response.naptConfiguration().portRange().minPort()); - Assertions.assertEquals(1016884622, response.naptConfiguration().portRange().maxPort()); - Assertions.assertEquals(98251742, response.naptConfiguration().portReuseHoldTime().tcp()); - Assertions.assertEquals(1744580177, response.naptConfiguration().portReuseHoldTime().udp()); - Assertions.assertEquals(593939862, response.naptConfiguration().pinholeLimits()); - Assertions.assertEquals(559578866, response.naptConfiguration().pinholeTimeouts().tcp()); - Assertions.assertEquals(1503247909, response.naptConfiguration().pinholeTimeouts().udp()); - Assertions.assertEquals(489682268, response.naptConfiguration().pinholeTimeouts().icmp()); - Assertions.assertEquals("nzoibgsxgnx", response.userEquipmentAddressPoolPrefix().get(0)); - Assertions.assertEquals("xiqxeiiqbimh", response.userEquipmentStaticAddressPoolPrefix().get(0)); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksDeleteMockTests.java deleted file mode 100644 index 1982c740a9dd..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 AttachedDataNetworksDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .attachedDataNetworks() - .delete("yhsgz", "czbgomfgbeg", "qgleohibetnluank", "rfxeeebtij", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksGetWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksGetWithResponseMockTests.java deleted file mode 100644 index fc69b6d8129e..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksGetWithResponseMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetwork; -import com.azure.resourcemanager.mobilenetwork.models.NaptEnabled; -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 AttachedDataNetworksGetWithResponseMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"userPlaneDataInterface\":{\"name\":\"lt\",\"ipv4Address\":\"eyl\",\"ipv4Subnet\":\"mfgvxirpghriypo\",\"ipv4Gateway\":\"yhlqhykprlpyznu\"},\"dnsAddresses\":[\"qdsmexiit\"],\"naptConfiguration\":{\"enabled\":\"Disabled\",\"portRange\":{\"minPort\":1550177536,\"maxPort\":1265824648},\"portReuseHoldTime\":{\"tcp\":1535598222,\"udp\":2086565224},\"pinholeLimits\":1192000578,\"pinholeTimeouts\":{\"tcp\":1246730356,\"udp\":1143037859,\"icmp\":1300683178}},\"userEquipmentAddressPoolPrefix\":[\"nmgixh\",\"mavmq\",\"oudorhcgyyp\"],\"userEquipmentStaticAddressPoolPrefix\":[\"wy\",\"undmbx\",\"ugcmjkavlgorb\"]},\"location\":\"tp\",\"tags\":{\"p\":\"zfjltfvnzcyjto\",\"bdb\":\"opv\"},\"id\":\"qgqqihedsvqwthmk\",\"name\":\"ibcysihsgqc\",\"type\":\"dhohsdtmcdzsuf\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AttachedDataNetwork response = - manager - .attachedDataNetworks() - .getWithResponse("acvbmqz", "qqxlajr", "wxacevehj", "uyxoaf", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("tp", response.location()); - Assertions.assertEquals("zfjltfvnzcyjto", response.tags().get("p")); - Assertions.assertEquals("lt", response.userPlaneDataInterface().name()); - Assertions.assertEquals("eyl", response.userPlaneDataInterface().ipv4Address()); - Assertions.assertEquals("mfgvxirpghriypo", response.userPlaneDataInterface().ipv4Subnet()); - Assertions.assertEquals("yhlqhykprlpyznu", response.userPlaneDataInterface().ipv4Gateway()); - Assertions.assertEquals("qdsmexiit", response.dnsAddresses().get(0)); - Assertions.assertEquals(NaptEnabled.DISABLED, response.naptConfiguration().enabled()); - Assertions.assertEquals(1550177536, response.naptConfiguration().portRange().minPort()); - Assertions.assertEquals(1265824648, response.naptConfiguration().portRange().maxPort()); - Assertions.assertEquals(1535598222, response.naptConfiguration().portReuseHoldTime().tcp()); - Assertions.assertEquals(2086565224, response.naptConfiguration().portReuseHoldTime().udp()); - Assertions.assertEquals(1192000578, response.naptConfiguration().pinholeLimits()); - Assertions.assertEquals(1246730356, response.naptConfiguration().pinholeTimeouts().tcp()); - Assertions.assertEquals(1143037859, response.naptConfiguration().pinholeTimeouts().udp()); - Assertions.assertEquals(1300683178, response.naptConfiguration().pinholeTimeouts().icmp()); - Assertions.assertEquals("nmgixh", response.userEquipmentAddressPoolPrefix().get(0)); - Assertions.assertEquals("wy", response.userEquipmentStaticAddressPoolPrefix().get(0)); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksListByPacketCoreDataPlaneMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksListByPacketCoreDataPlaneMockTests.java deleted file mode 100644 index a3da3e0719ff..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksListByPacketCoreDataPlaneMockTests.java +++ /dev/null @@ -1,89 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetwork; -import com.azure.resourcemanager.mobilenetwork.models.NaptEnabled; -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 AttachedDataNetworksListByPacketCoreDataPlaneMockTests { - @Test - public void testListByPacketCoreDataPlane() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"userPlaneDataInterface\":{\"name\":\"clj\",\"ipv4Address\":\"gvkzqkjjeokbze\",\"ipv4Subnet\":\"zrxcczurt\",\"ipv4Gateway\":\"ipqxbkwvzgnzv\"},\"dnsAddresses\":[\"bzdixzmq\",\"noda\",\"opqhewjptmc\",\"sbostzel\"],\"naptConfiguration\":{\"enabled\":\"Disabled\",\"portRange\":{\"minPort\":492133944,\"maxPort\":1611840724},\"portReuseHoldTime\":{\"tcp\":204672914,\"udp\":1115327100},\"pinholeLimits\":1010329526,\"pinholeTimeouts\":{\"tcp\":1281899778,\"udp\":1426924958,\"icmp\":1171808306}},\"userEquipmentAddressPoolPrefix\":[\"vcwwyyurmochppr\",\"rsnm\"],\"userEquipmentStaticAddressPoolPrefix\":[\"yzejnhlbk\",\"bzpcpiljhahzvec\",\"ndbnwieh\",\"lewjwiuubwef\"]},\"location\":\"fapaqtfer\",\"tags\":{\"kmfx\":\"ex\",\"pud\":\"pjwogqqno\",\"yawbzasqbu\":\"dabtqwp\",\"oguyaip\":\"ljgkyex\"},\"id\":\"dsdaultxijjumf\",\"name\":\"waz\",\"type\":\"nqnm\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .attachedDataNetworks() - .listByPacketCoreDataPlane( - "ohdxbzlmcmu", "pcvhdbevwqqxeys", "onqzinkfkbgbzbow", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fapaqtfer", response.iterator().next().location()); - Assertions.assertEquals("ex", response.iterator().next().tags().get("kmfx")); - Assertions.assertEquals("clj", response.iterator().next().userPlaneDataInterface().name()); - Assertions.assertEquals("gvkzqkjjeokbze", response.iterator().next().userPlaneDataInterface().ipv4Address()); - Assertions.assertEquals("zrxcczurt", response.iterator().next().userPlaneDataInterface().ipv4Subnet()); - Assertions.assertEquals("ipqxbkwvzgnzv", response.iterator().next().userPlaneDataInterface().ipv4Gateway()); - Assertions.assertEquals("bzdixzmq", response.iterator().next().dnsAddresses().get(0)); - Assertions.assertEquals(NaptEnabled.DISABLED, response.iterator().next().naptConfiguration().enabled()); - Assertions.assertEquals(492133944, response.iterator().next().naptConfiguration().portRange().minPort()); - Assertions.assertEquals(1611840724, response.iterator().next().naptConfiguration().portRange().maxPort()); - Assertions.assertEquals(204672914, response.iterator().next().naptConfiguration().portReuseHoldTime().tcp()); - Assertions.assertEquals(1115327100, response.iterator().next().naptConfiguration().portReuseHoldTime().udp()); - Assertions.assertEquals(1010329526, response.iterator().next().naptConfiguration().pinholeLimits()); - Assertions.assertEquals(1281899778, response.iterator().next().naptConfiguration().pinholeTimeouts().tcp()); - Assertions.assertEquals(1426924958, response.iterator().next().naptConfiguration().pinholeTimeouts().udp()); - Assertions.assertEquals(1171808306, response.iterator().next().naptConfiguration().pinholeTimeouts().icmp()); - Assertions.assertEquals("vcwwyyurmochppr", response.iterator().next().userEquipmentAddressPoolPrefix().get(0)); - Assertions.assertEquals("yzejnhlbk", response.iterator().next().userEquipmentStaticAddressPoolPrefix().get(0)); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AzureStackEdgeDeviceResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AzureStackEdgeDeviceResourceIdTests.java deleted file mode 100644 index a56945e3644f..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AzureStackEdgeDeviceResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackEdgeDeviceResourceId; -import org.junit.jupiter.api.Assertions; - -public final class AzureStackEdgeDeviceResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureStackEdgeDeviceResourceId model = - BinaryData.fromString("{\"id\":\"vnm\"}").toObject(AzureStackEdgeDeviceResourceId.class); - Assertions.assertEquals("vnm", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureStackEdgeDeviceResourceId model = new AzureStackEdgeDeviceResourceId().withId("vnm"); - model = BinaryData.fromObject(model).toObject(AzureStackEdgeDeviceResourceId.class); - Assertions.assertEquals("vnm", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AzureStackHciClusterResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AzureStackHciClusterResourceIdTests.java deleted file mode 100644 index 3a10a1747ffd..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/AzureStackHciClusterResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackHciClusterResourceId; -import org.junit.jupiter.api.Assertions; - -public final class AzureStackHciClusterResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureStackHciClusterResourceId model = - BinaryData.fromString("{\"id\":\"cykvceo\"}").toObject(AzureStackHciClusterResourceId.class); - Assertions.assertEquals("cykvceo", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureStackHciClusterResourceId model = new AzureStackHciClusterResourceId().withId("cykvceo"); - model = BinaryData.fromObject(model).toObject(AzureStackHciClusterResourceId.class); - Assertions.assertEquals("cykvceo", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/CertificateProvisioningTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/CertificateProvisioningTests.java deleted file mode 100644 index bb4c840c839d..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/CertificateProvisioningTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.CertificateProvisioning; - -public final class CertificateProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CertificateProvisioning model = - BinaryData - .fromString("{\"state\":\"Failed\",\"reason\":\"rpabg\"}") - .toObject(CertificateProvisioning.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CertificateProvisioning model = new CertificateProvisioning(); - model = BinaryData.fromObject(model).toObject(CertificateProvisioning.class); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ConnectedClusterResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ConnectedClusterResourceIdTests.java deleted file mode 100644 index 8699aaa15929..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ConnectedClusterResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.ConnectedClusterResourceId; -import org.junit.jupiter.api.Assertions; - -public final class ConnectedClusterResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectedClusterResourceId model = - BinaryData.fromString("{\"id\":\"eil\"}").toObject(ConnectedClusterResourceId.class); - Assertions.assertEquals("eil", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedClusterResourceId model = new ConnectedClusterResourceId().withId("eil"); - model = BinaryData.fromObject(model).toObject(ConnectedClusterResourceId.class); - Assertions.assertEquals("eil", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/CustomLocationResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/CustomLocationResourceIdTests.java deleted file mode 100644 index b33097815201..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/CustomLocationResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; -import org.junit.jupiter.api.Assertions; - -public final class CustomLocationResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomLocationResourceId model = - BinaryData.fromString("{\"id\":\"vnotyfjfcnj\"}").toObject(CustomLocationResourceId.class); - Assertions.assertEquals("vnotyfjfcnj", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomLocationResourceId model = new CustomLocationResourceId().withId("vnotyfjfcnj"); - model = BinaryData.fromObject(model).toObject(CustomLocationResourceId.class); - Assertions.assertEquals("vnotyfjfcnj", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkConfigurationTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkConfigurationTests.java deleted file mode 100644 index fb572421141f..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkConfigurationTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkResourceId; -import com.azure.resourcemanager.mobilenetwork.models.PduSessionType; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.ServiceResourceId; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataNetworkConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataNetworkConfiguration model = - BinaryData - .fromString( - "{\"dataNetwork\":{\"id\":\"hihihlhzdsqtzbsr\"},\"sessionAmbr\":{\"uplink\":\"nowc\",\"downlink\":\"hfgmvecactxm\"},\"5qi\":2043767833,\"allocationAndRetentionPriorityLevel\":966273213,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"defaultSessionType\":\"IPv6\",\"additionalAllowedSessionTypes\":[\"IPv6\",\"IPv4\"],\"allowedServices\":[{\"id\":\"vgqouwifzmpj\"},{\"id\":\"yivqikfxcvhrfsp\"}],\"maximumNumberOfBufferedPackets\":754601836}") - .toObject(DataNetworkConfiguration.class); - Assertions.assertEquals("hihihlhzdsqtzbsr", model.dataNetwork().id()); - Assertions.assertEquals("nowc", model.sessionAmbr().uplink()); - Assertions.assertEquals("hfgmvecactxm", model.sessionAmbr().downlink()); - Assertions.assertEquals(2043767833, model.fiveQi()); - Assertions.assertEquals(966273213, model.allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.MAY_PREEMPT, model.preemptionCapability()); - Assertions.assertEquals(PreemptionVulnerability.PREEMPTABLE, model.preemptionVulnerability()); - Assertions.assertEquals(PduSessionType.IPV6, model.defaultSessionType()); - Assertions.assertEquals(PduSessionType.IPV6, model.additionalAllowedSessionTypes().get(0)); - Assertions.assertEquals("vgqouwifzmpj", model.allowedServices().get(0).id()); - Assertions.assertEquals(754601836, model.maximumNumberOfBufferedPackets()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataNetworkConfiguration model = - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("hihihlhzdsqtzbsr")) - .withSessionAmbr(new Ambr().withUplink("nowc").withDownlink("hfgmvecactxm")) - .withFiveQi(2043767833) - .withAllocationAndRetentionPriorityLevel(966273213) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV6) - .withAdditionalAllowedSessionTypes(Arrays.asList(PduSessionType.IPV6, PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("vgqouwifzmpj"), - new ServiceResourceId().withId("yivqikfxcvhrfsp"))) - .withMaximumNumberOfBufferedPackets(754601836); - model = BinaryData.fromObject(model).toObject(DataNetworkConfiguration.class); - Assertions.assertEquals("hihihlhzdsqtzbsr", model.dataNetwork().id()); - Assertions.assertEquals("nowc", model.sessionAmbr().uplink()); - Assertions.assertEquals("hfgmvecactxm", model.sessionAmbr().downlink()); - Assertions.assertEquals(2043767833, model.fiveQi()); - Assertions.assertEquals(966273213, model.allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.MAY_PREEMPT, model.preemptionCapability()); - Assertions.assertEquals(PreemptionVulnerability.PREEMPTABLE, model.preemptionVulnerability()); - Assertions.assertEquals(PduSessionType.IPV6, model.defaultSessionType()); - Assertions.assertEquals(PduSessionType.IPV6, model.additionalAllowedSessionTypes().get(0)); - Assertions.assertEquals("vgqouwifzmpj", model.allowedServices().get(0).id()); - Assertions.assertEquals(754601836, model.maximumNumberOfBufferedPackets()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkInnerTests.java deleted file mode 100644 index 93f43d34e5d8..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkInnerTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataNetworkInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataNetworkInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"description\":\"wu\"},\"location\":\"gazxuf\",\"tags\":{\"fidfvzw\":\"ckyfih\",\"nteiwaopv\":\"zuhtymwisdkfthwx\"},\"id\":\"mijcmmxdcufufs\",\"name\":\"pymzidnsezcxtbzs\",\"type\":\"fycc\"}") - .toObject(DataNetworkInner.class); - Assertions.assertEquals("gazxuf", model.location()); - Assertions.assertEquals("ckyfih", model.tags().get("fidfvzw")); - Assertions.assertEquals("wu", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataNetworkInner model = - new DataNetworkInner() - .withLocation("gazxuf") - .withTags(mapOf("fidfvzw", "ckyfih", "nteiwaopv", "zuhtymwisdkfthwx")) - .withDescription("wu"); - model = BinaryData.fromObject(model).toObject(DataNetworkInner.class); - Assertions.assertEquals("gazxuf", model.location()); - Assertions.assertEquals("ckyfih", model.tags().get("fidfvzw")); - Assertions.assertEquals("wu", model.description()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkListResultTests.java deleted file mode 100644 index 4cb0c0313b36..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkListResultTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkInner; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataNetworkListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataNetworkListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"description\":\"fqpte\"},\"location\":\"zzvypyqrimzinp\",\"tags\":{\"crmnohjtckwhds\":\"jdkirsoodqx\"},\"id\":\"ifiyipjxsqwpgrj\",\"name\":\"znorcj\",\"type\":\"vsnb\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"description\":\"nmoc\"},\"location\":\"ysh\",\"tags\":{\"javbqidtqajz\":\"afbljjgpbtoqcjmk\"},\"id\":\"ulpkudjkrl\",\"name\":\"hbzhfepg\",\"type\":\"gqexzlocxs\"}],\"nextLink\":\"aierhhb\"}") - .toObject(DataNetworkListResult.class); - Assertions.assertEquals("zzvypyqrimzinp", model.value().get(0).location()); - Assertions.assertEquals("jdkirsoodqx", model.value().get(0).tags().get("crmnohjtckwhds")); - Assertions.assertEquals("fqpte", model.value().get(0).description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataNetworkListResult model = - new DataNetworkListResult() - .withValue( - Arrays - .asList( - new DataNetworkInner() - .withLocation("zzvypyqrimzinp") - .withTags(mapOf("crmnohjtckwhds", "jdkirsoodqx")) - .withDescription("fqpte"), - new DataNetworkInner() - .withLocation("ysh") - .withTags(mapOf("javbqidtqajz", "afbljjgpbtoqcjmk")) - .withDescription("nmoc"))); - model = BinaryData.fromObject(model).toObject(DataNetworkListResult.class); - Assertions.assertEquals("zzvypyqrimzinp", model.value().get(0).location()); - Assertions.assertEquals("jdkirsoodqx", model.value().get(0).tags().get("crmnohjtckwhds")); - Assertions.assertEquals("fqpte", model.value().get(0).description()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkPropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkPropertiesFormatTests.java deleted file mode 100644 index 339b8caea99b..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkPropertiesFormatTests.java +++ /dev/null @@ -1,27 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkPropertiesFormat; -import org.junit.jupiter.api.Assertions; - -public final class DataNetworkPropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataNetworkPropertiesFormat model = - BinaryData - .fromString("{\"provisioningState\":\"Failed\",\"description\":\"mdwzjeiachboo\"}") - .toObject(DataNetworkPropertiesFormat.class); - Assertions.assertEquals("mdwzjeiachboo", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataNetworkPropertiesFormat model = new DataNetworkPropertiesFormat().withDescription("mdwzjeiachboo"); - model = BinaryData.fromObject(model).toObject(DataNetworkPropertiesFormat.class); - Assertions.assertEquals("mdwzjeiachboo", model.description()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkResourceIdTests.java deleted file mode 100644 index ca73ad749d26..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworkResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkResourceId; -import org.junit.jupiter.api.Assertions; - -public final class DataNetworkResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataNetworkResourceId model = - BinaryData.fromString("{\"id\":\"yqdhcuplcplcw\"}").toObject(DataNetworkResourceId.class); - Assertions.assertEquals("yqdhcuplcplcw", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataNetworkResourceId model = new DataNetworkResourceId().withId("yqdhcuplcplcw"); - model = BinaryData.fromObject(model).toObject(DataNetworkResourceId.class); - Assertions.assertEquals("yqdhcuplcplcw", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksCreateOrUpdateMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksCreateOrUpdateMockTests.java deleted file mode 100644 index 71b50f7181ba..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksCreateOrUpdateMockTests.java +++ /dev/null @@ -1,91 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.DataNetwork; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -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 DataNetworksCreateOrUpdateMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"description\":\"nthjtwkjaosrxuzv\"},\"location\":\"mktcqiosmgbza\",\"tags\":{\"laprlt\":\"qdlyrtl\",\"nnbsoqeqa\":\"katbhjm\",\"febwlnbmhyreeudz\":\"arvlagunbt\",\"pdqmjxlyyzglgouw\":\"av\"},\"id\":\"lmjjyuo\",\"name\":\"qtobaxkjeyt\",\"type\":\"nlb\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataNetwork response = - manager - .dataNetworks() - .define("ycjsx") - .withRegion("mwmxqhndvnoamld") - .withExistingMobileNetwork("kzruswh", "hczznvf") - .withTags( - mapOf( - "flzokxco", "aohdjh", "tsxoatftgz", "pelnjetag", "vefloccsrmozihmi", "npbs", "wtxxpkyjcx", "g")) - .withDescription("z") - .create(); - - Assertions.assertEquals("mktcqiosmgbza", response.location()); - Assertions.assertEquals("qdlyrtl", response.tags().get("laprlt")); - Assertions.assertEquals("nthjtwkjaosrxuzv", response.description()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksDeleteMockTests.java deleted file mode 100644 index af207a2fb7c1..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 DataNetworksDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .dataNetworks() - .delete("nktwfansnvpdibmi", "ostbzbkiwb", "qnyophzfyls", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksGetWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksGetWithResponseMockTests.java deleted file mode 100644 index c8c20d49e274..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksGetWithResponseMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.DataNetwork; -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 DataNetworksGetWithResponseMockTests { - @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\":{\"provisioningState\":\"Failed\",\"description\":\"lafzvaylptr\"},\"location\":\"qwztcmwqkc\",\"tags\":{\"xfdeqvhpsyl\":\"waxfewzjkj\",\"bffmbmxz\":\"ksh\",\"jx\":\"rgywwp\"},\"id\":\"nptfujgi\",\"name\":\"gaao\",\"type\":\"pttaqutd\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataNetwork response = - manager - .dataNetworks() - .getWithResponse("crpfbcunez", "cez", "lfwyfwlwxjwetn", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qwztcmwqkc", response.location()); - Assertions.assertEquals("waxfewzjkj", response.tags().get("xfdeqvhpsyl")); - Assertions.assertEquals("lafzvaylptr", response.description()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksListByMobileNetworkMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksListByMobileNetworkMockTests.java deleted file mode 100644 index 8265fce106b3..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksListByMobileNetworkMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.DataNetwork; -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 DataNetworksListByMobileNetworkMockTests { - @Test - public void testListByMobileNetwork() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"description\":\"jqepqwhi\"},\"location\":\"onsts\",\"tags\":{\"vuwcobiegstmnin\":\"xgvelfclduccbird\",\"ejjtbxqmul\":\"jizcilnghgs\",\"rsbycucrwn\":\"xlxqzvn\"},\"id\":\"mikzeb\",\"name\":\"qbsms\",\"type\":\"ziqgfuh\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .dataNetworks() - .listByMobileNetwork("wemxswvruunzz", "gehkfkimrtixokff", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("onsts", response.iterator().next().location()); - Assertions.assertEquals("xgvelfclduccbird", response.iterator().next().tags().get("vuwcobiegstmnin")); - Assertions.assertEquals("jqepqwhi", response.iterator().next().description()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackageInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackageInnerTests.java deleted file mode 100644 index 3d96ff0923f1..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackageInnerTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.DiagnosticsPackageInner; - -public final class DiagnosticsPackageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticsPackageInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\",\"status\":\"Collected\",\"reason\":\"majtjaod\"},\"id\":\"bnbdxkqpxokajion\",\"name\":\"imexgstxgcpodgma\",\"type\":\"jrmvdjwzrlo\"}") - .toObject(DiagnosticsPackageInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsPackageInner model = new DiagnosticsPackageInner(); - model = BinaryData.fromObject(model).toObject(DiagnosticsPackageInner.class); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackageListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackageListResultTests.java deleted file mode 100644 index 3d9a33a817c9..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackageListResultTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.DiagnosticsPackageInner; -import com.azure.resourcemanager.mobilenetwork.models.DiagnosticsPackageListResult; -import java.util.Arrays; - -public final class DiagnosticsPackageListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticsPackageListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"status\":\"NotStarted\",\"reason\":\"bkbfkgukdkex\"},\"id\":\"pofm\",\"name\":\"axcfjpgddtocjjx\",\"type\":\"vpmouexhdzxib\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"status\":\"Collected\",\"reason\":\"qbzvddntwnd\"},\"id\":\"cbtwnpzaoqvuh\",\"name\":\"hcffcyddglmjthjq\",\"type\":\"wpyeicxmqciwqvh\"}],\"nextLink\":\"ixuigdtopbobj\"}") - .toObject(DiagnosticsPackageListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsPackageListResult model = - new DiagnosticsPackageListResult() - .withValue(Arrays.asList(new DiagnosticsPackageInner(), new DiagnosticsPackageInner())); - model = BinaryData.fromObject(model).toObject(DiagnosticsPackageListResult.class); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagePropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagePropertiesFormatTests.java deleted file mode 100644 index fa5d6d450250..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagePropertiesFormatTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.DiagnosticsPackagePropertiesFormat; - -public final class DiagnosticsPackagePropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticsPackagePropertiesFormat model = - BinaryData - .fromString("{\"provisioningState\":\"Canceled\",\"status\":\"Error\",\"reason\":\"ijcoejctb\"}") - .toObject(DiagnosticsPackagePropertiesFormat.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsPackagePropertiesFormat model = new DiagnosticsPackagePropertiesFormat(); - model = BinaryData.fromObject(model).toObject(DiagnosticsPackagePropertiesFormat.class); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesCreateOrUpdateMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesCreateOrUpdateMockTests.java deleted file mode 100644 index 65fa4d71e4d2..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesCreateOrUpdateMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.DiagnosticsPackage; -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 DiagnosticsPackagesCreateOrUpdateMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"status\":\"Collecting\",\"reason\":\"fmjnnawtqa\"},\"id\":\"xuckpggqoweyir\",\"name\":\"hlisngw\",\"type\":\"lqqmpiz\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DiagnosticsPackage response = - manager - .diagnosticsPackages() - .createOrUpdate("jkwrusnkq", "hsyrqunj", "hdenxaulk", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesDeleteMockTests.java deleted file mode 100644 index ea9732673f64..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 DiagnosticsPackagesDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .diagnosticsPackages() - .delete("rgxffmshkw", "bkgozxwopdbydpi", "qaclnapxbiy", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesGetWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesGetWithResponseMockTests.java deleted file mode 100644 index fb84452a0b5a..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesGetWithResponseMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.DiagnosticsPackage; -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 DiagnosticsPackagesGetWithResponseMockTests { - @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\":{\"provisioningState\":\"Accepted\",\"status\":\"Collecting\",\"reason\":\"grwsdp\"},\"id\":\"atzv\",\"name\":\"bglbyvict\",\"type\":\"tbrxkjz\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DiagnosticsPackage response = - manager - .diagnosticsPackages() - .getWithResponse("uwnpqxpxiwfcng", "saasiixtmkzj", "kv", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesListByPacketCoreControlPlaneMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesListByPacketCoreControlPlaneMockTests.java deleted file mode 100644 index 24647bb97397..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsPackagesListByPacketCoreControlPlaneMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.DiagnosticsPackage; -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 DiagnosticsPackagesListByPacketCoreControlPlaneMockTests { - @Test - public void testListByPacketCoreControlPlane() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"status\":\"Collected\",\"reason\":\"uuyilfl\"},\"id\":\"iquvrehm\",\"name\":\"njhvsujztc\",\"type\":\"ytqj\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .diagnosticsPackages() - .listByPacketCoreControlPlane("nugj", "nfsm", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsUploadConfigurationTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsUploadConfigurationTests.java deleted file mode 100644 index a67dddb63148..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/DiagnosticsUploadConfigurationTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.DiagnosticsUploadConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticsUploadConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticsUploadConfiguration model = - BinaryData - .fromString("{\"storageAccountContainerUrl\":\"epsbjtazqu\"}") - .toObject(DiagnosticsUploadConfiguration.class); - Assertions.assertEquals("epsbjtazqu", model.storageAccountContainerUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsUploadConfiguration model = - new DiagnosticsUploadConfiguration().withStorageAccountContainerUrl("epsbjtazqu"); - model = BinaryData.fromObject(model).toObject(DiagnosticsUploadConfiguration.class); - Assertions.assertEquals("epsbjtazqu", model.storageAccountContainerUrl()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/HttpsServerCertificateTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/HttpsServerCertificateTests.java deleted file mode 100644 index 0e8eec139b0a..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/HttpsServerCertificateTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.HttpsServerCertificate; -import org.junit.jupiter.api.Assertions; - -public final class HttpsServerCertificateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HttpsServerCertificate model = - BinaryData - .fromString( - "{\"certificateUrl\":\"jtoqne\",\"provisioning\":{\"state\":\"Failed\",\"reason\":\"plpho\"}}") - .toObject(HttpsServerCertificate.class); - Assertions.assertEquals("jtoqne", model.certificateUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpsServerCertificate model = new HttpsServerCertificate().withCertificateUrl("jtoqne"); - model = BinaryData.fromObject(model).toObject(HttpsServerCertificate.class); - Assertions.assertEquals("jtoqne", model.certificateUrl()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/IdentityAndTagsObjectTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/IdentityAndTagsObjectTests.java deleted file mode 100644 index 5b360b30ba98..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/IdentityAndTagsObjectTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.IdentityAndTagsObject; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentity; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mobilenetwork.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IdentityAndTagsObjectTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdentityAndTagsObject model = - BinaryData - .fromString( - "{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"xy\":{\"principalId\":\"e3e6e0cb-585a-49cb-a745-dfd0da3d2013\",\"clientId\":\"ae588393-1176-4f2d-b94b-7169558bf377\"},\"oyrxvwfudwpzntxh\":{\"principalId\":\"6c89282a-6a95-4223-8c89-b7b28007fd44\",\"clientId\":\"603dd9e9-151e-477e-9387-9f7bda37672d\"},\"lrqjbhckfr\":{\"principalId\":\"c56d3585-fe1c-42f8-b14b-3e6371b61bc7\",\"clientId\":\"b5c86b40-5c29-4017-beea-72410d4c07bc\"}}},\"tags\":{\"uzbpzkafku\":\"xsbkyvpyca\",\"rnwb\":\"b\"}}") - .toObject(IdentityAndTagsObject.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xsbkyvpyca", model.tags().get("uzbpzkafku")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdentityAndTagsObject model = - new IdentityAndTagsObject() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "xy", - new UserAssignedIdentity(), - "oyrxvwfudwpzntxh", - new UserAssignedIdentity(), - "lrqjbhckfr", - new UserAssignedIdentity()))) - .withTags(mapOf("uzbpzkafku", "xsbkyvpyca", "rnwb", "b")); - model = BinaryData.fromObject(model).toObject(IdentityAndTagsObject.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xsbkyvpyca", model.tags().get("uzbpzkafku")); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/InstallationTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/InstallationTests.java deleted file mode 100644 index 74646cec4aa2..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/InstallationTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.DesiredInstallationState; -import com.azure.resourcemanager.mobilenetwork.models.Installation; -import org.junit.jupiter.api.Assertions; - -public final class InstallationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Installation model = - BinaryData - .fromString( - "{\"desiredState\":\"Uninstalled\",\"state\":\"Failed\",\"reinstallRequired\":\"Required\",\"reasons\":[\"NoSlices\",\"NoAttachedDataNetworks\"],\"operation\":{\"id\":\"dwzbaiue\"}}") - .toObject(Installation.class); - Assertions.assertEquals(DesiredInstallationState.UNINSTALLED, model.desiredState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Installation model = new Installation().withDesiredState(DesiredInstallationState.UNINSTALLED); - model = BinaryData.fromObject(model).toObject(Installation.class); - Assertions.assertEquals(DesiredInstallationState.UNINSTALLED, model.desiredState()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/InterfacePropertiesTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/InterfacePropertiesTests.java deleted file mode 100644 index 83c63d72b723..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/InterfacePropertiesTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import org.junit.jupiter.api.Assertions; - -public final class InterfacePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InterfaceProperties model = - BinaryData - .fromString( - "{\"name\":\"vyq\",\"ipv4Address\":\"wby\",\"ipv4Subnet\":\"k\",\"ipv4Gateway\":\"dumjgrtfwvuk\"}") - .toObject(InterfaceProperties.class); - Assertions.assertEquals("vyq", model.name()); - Assertions.assertEquals("wby", model.ipv4Address()); - Assertions.assertEquals("k", model.ipv4Subnet()); - Assertions.assertEquals("dumjgrtfwvuk", model.ipv4Gateway()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InterfaceProperties model = - new InterfaceProperties() - .withName("vyq") - .withIpv4Address("wby") - .withIpv4Subnet("k") - .withIpv4Gateway("dumjgrtfwvuk"); - model = BinaryData.fromObject(model).toObject(InterfaceProperties.class); - Assertions.assertEquals("vyq", model.name()); - Assertions.assertEquals("wby", model.ipv4Address()); - Assertions.assertEquals("k", model.ipv4Subnet()); - Assertions.assertEquals("dumjgrtfwvuk", model.ipv4Gateway()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/LocalDiagnosticsAccessConfigurationTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/LocalDiagnosticsAccessConfigurationTests.java deleted file mode 100644 index d03beecd1ba4..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/LocalDiagnosticsAccessConfigurationTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.AuthenticationType; -import com.azure.resourcemanager.mobilenetwork.models.HttpsServerCertificate; -import com.azure.resourcemanager.mobilenetwork.models.LocalDiagnosticsAccessConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class LocalDiagnosticsAccessConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LocalDiagnosticsAccessConfiguration model = - BinaryData - .fromString( - "{\"authenticationType\":\"AAD\",\"httpsServerCertificate\":{\"certificateUrl\":\"nxdhbt\",\"provisioning\":{\"state\":\"Provisioned\",\"reason\":\"wpn\"}}}") - .toObject(LocalDiagnosticsAccessConfiguration.class); - Assertions.assertEquals(AuthenticationType.AAD, model.authenticationType()); - Assertions.assertEquals("nxdhbt", model.httpsServerCertificate().certificateUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LocalDiagnosticsAccessConfiguration model = - new LocalDiagnosticsAccessConfiguration() - .withAuthenticationType(AuthenticationType.AAD) - .withHttpsServerCertificate(new HttpsServerCertificate().withCertificateUrl("nxdhbt")); - model = BinaryData.fromObject(model).toObject(LocalDiagnosticsAccessConfiguration.class); - Assertions.assertEquals(AuthenticationType.AAD, model.authenticationType()); - Assertions.assertEquals("nxdhbt", model.httpsServerCertificate().certificateUrl()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ManagedServiceIdentityTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 518765ec67a0..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ManagedServiceIdentityTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentity; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mobilenetwork.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = - BinaryData - .fromString( - "{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ueefjzwfqkqu\":{\"principalId\":\"8e875600-97ae-49a3-9862-b85fd11f2189\",\"clientId\":\"e2290002-d2fb-4f63-a943-e19f632bea22\"},\"suyonobglaocq\":{\"principalId\":\"4ed185a1-923b-46a6-a873-a83a387665ca\",\"clientId\":\"c56d6fd8-b9cf-4260-b1f5-820f2cd6b3fd\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("ueefjzwfqkqu", new UserAssignedIdentity(), "suyonobglaocq", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, 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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworkResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworkResourceIdTests.java deleted file mode 100644 index a3d3140fb49a..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworkResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; -import org.junit.jupiter.api.Assertions; - -public final class MobileNetworkResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MobileNetworkResourceId model = - BinaryData.fromString("{\"id\":\"sv\"}").toObject(MobileNetworkResourceId.class); - Assertions.assertEquals("sv", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MobileNetworkResourceId model = new MobileNetworkResourceId().withId("sv"); - model = BinaryData.fromObject(model).toObject(MobileNetworkResourceId.class); - Assertions.assertEquals("sv", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksDeleteMockTests.java deleted file mode 100644 index 4190d24aec34..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 MobileNetworksDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.mobileNetworks().delete("w", "auunfprnjletlx", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/NaptConfigurationTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/NaptConfigurationTests.java deleted file mode 100644 index 701b9b9c4508..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/NaptConfigurationTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.NaptConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.NaptEnabled; -import com.azure.resourcemanager.mobilenetwork.models.PinholeTimeouts; -import com.azure.resourcemanager.mobilenetwork.models.PortRange; -import com.azure.resourcemanager.mobilenetwork.models.PortReuseHoldTimes; -import org.junit.jupiter.api.Assertions; - -public final class NaptConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NaptConfiguration model = - BinaryData - .fromString( - "{\"enabled\":\"Disabled\",\"portRange\":{\"minPort\":1991761310,\"maxPort\":1674535960},\"portReuseHoldTime\":{\"tcp\":14804050,\"udp\":2045600331},\"pinholeLimits\":1132741350,\"pinholeTimeouts\":{\"tcp\":1617618462,\"udp\":1833864756,\"icmp\":1656493513}}") - .toObject(NaptConfiguration.class); - Assertions.assertEquals(NaptEnabled.DISABLED, model.enabled()); - Assertions.assertEquals(1991761310, model.portRange().minPort()); - Assertions.assertEquals(1674535960, model.portRange().maxPort()); - Assertions.assertEquals(14804050, model.portReuseHoldTime().tcp()); - Assertions.assertEquals(2045600331, model.portReuseHoldTime().udp()); - Assertions.assertEquals(1132741350, model.pinholeLimits()); - Assertions.assertEquals(1617618462, model.pinholeTimeouts().tcp()); - Assertions.assertEquals(1833864756, model.pinholeTimeouts().udp()); - Assertions.assertEquals(1656493513, model.pinholeTimeouts().icmp()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NaptConfiguration model = - new NaptConfiguration() - .withEnabled(NaptEnabled.DISABLED) - .withPortRange(new PortRange().withMinPort(1991761310).withMaxPort(1674535960)) - .withPortReuseHoldTime(new PortReuseHoldTimes().withTcp(14804050).withUdp(2045600331)) - .withPinholeLimits(1132741350) - .withPinholeTimeouts( - new PinholeTimeouts().withTcp(1617618462).withUdp(1833864756).withIcmp(1656493513)); - model = BinaryData.fromObject(model).toObject(NaptConfiguration.class); - Assertions.assertEquals(NaptEnabled.DISABLED, model.enabled()); - Assertions.assertEquals(1991761310, model.portRange().minPort()); - Assertions.assertEquals(1674535960, model.portRange().maxPort()); - Assertions.assertEquals(14804050, model.portReuseHoldTime().tcp()); - Assertions.assertEquals(2045600331, model.portReuseHoldTime().udp()); - Assertions.assertEquals(1132741350, model.pinholeLimits()); - Assertions.assertEquals(1617618462, model.pinholeTimeouts().tcp()); - Assertions.assertEquals(1833864756, model.pinholeTimeouts().udp()); - Assertions.assertEquals(1656493513, model.pinholeTimeouts().icmp()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationDisplayTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationDisplayTests.java deleted file mode 100644 index 9ff96fca1107..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.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\":\"vo\",\"resource\":\"ujjugwdkcglh\",\"operation\":\"azjdyggd\",\"description\":\"ixhbkuofqweykhm\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("vo", model.provider()); - Assertions.assertEquals("ujjugwdkcglh", model.resource()); - Assertions.assertEquals("azjdyggd", model.operation()); - Assertions.assertEquals("ixhbkuofqweykhm", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = - new OperationDisplay() - .withProvider("vo") - .withResource("ujjugwdkcglh") - .withOperation("azjdyggd") - .withDescription("ixhbkuofqweykhm"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("vo", model.provider()); - Assertions.assertEquals("ujjugwdkcglh", model.resource()); - Assertions.assertEquals("azjdyggd", model.operation()); - Assertions.assertEquals("ixhbkuofqweykhm", model.description()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationInnerTests.java deleted file mode 100644 index f8dc3709a04a..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationInnerTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.OperationInner; -import org.junit.jupiter.api.Assertions; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"isDataAction\":false,\"name\":\"yfsoppu\",\"display\":{\"provider\":\"snzwd\",\"resource\":\"bavo\",\"operation\":\"zdmohctbqvu\",\"description\":\"xdn\"}}") - .toObject(OperationInner.class); - Assertions.assertEquals(false, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withIsDataAction(false); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals(false, model.isDataAction()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationListTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationListTests.java deleted file mode 100644 index 3797dc89f439..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationListTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.OperationList; - -public final class OperationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationList model = - BinaryData - .fromString( - "{\"value\":[{\"isDataAction\":true,\"name\":\"rvynhzgpph\",\"display\":{\"provider\":\"yncocpecfvmmcoo\",\"resource\":\"xlzevgbmqjqabcy\",\"operation\":\"ivkwlzuvccfwnfnb\",\"description\":\"fionl\"}},{\"isDataAction\":false,\"name\":\"tqgtzxdpnqbqq\",\"display\":{\"provider\":\"jfeallnwsub\",\"resource\":\"njampm\",\"operation\":\"nzscxa\",\"description\":\"ooch\"}},{\"isDataAction\":false,\"name\":\"qvpkvlrxnjeaseip\",\"display\":{\"provider\":\"f\",\"resource\":\"keyyi\",\"operation\":\"jbdlwtgrhpdjpju\",\"description\":\"sxazjpq\"}},{\"isDataAction\":false,\"name\":\"alhbx\",\"display\":{\"provider\":\"jj\",\"resource\":\"v\",\"operation\":\"dgwdslfhot\",\"description\":\"cynpwlbjnp\"}}],\"nextLink\":\"cftadeh\"}") - .toObject(OperationList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = new OperationList(); - model = BinaryData.fromObject(model).toObject(OperationList.class); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationsListMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationsListMockTests.java deleted file mode 100644 index 6f7516e20d19..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/OperationsListMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.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\":[{\"isDataAction\":true,\"name\":\"zgp\",\"display\":{\"provider\":\"vhjknidi\",\"resource\":\"qjxgpnrhgovfgp\",\"operation\":\"qmhhaowj\",\"description\":\"zvuporqzdfuydz\"}}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .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(true, response.iterator().next().isDataAction()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCaptureInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCaptureInnerTests.java deleted file mode 100644 index b2ce4bad37d1..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCaptureInnerTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCaptureInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PacketCaptureInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCaptureInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\",\"status\":\"Running\",\"reason\":\"exfwhy\",\"captureStartTime\":\"2021-05-17T05:51:50Z\",\"networkInterfaces\":[\"yvdcsitynnaa\",\"dectehfiqsc\"],\"bytesToCapturePerPacket\":991412043845588361,\"totalBytesPerSession\":7720678337601187559,\"timeLimitInSeconds\":732207919},\"id\":\"kgqhcjrefovg\",\"name\":\"kqsleyyvxy\",\"type\":\"jpkcattpng\"}") - .toObject(PacketCaptureInner.class); - Assertions.assertEquals("yvdcsitynnaa", model.networkInterfaces().get(0)); - Assertions.assertEquals(991412043845588361L, model.bytesToCapturePerPacket()); - Assertions.assertEquals(7720678337601187559L, model.totalBytesPerSession()); - Assertions.assertEquals(732207919, model.timeLimitInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCaptureInner model = - new PacketCaptureInner() - .withNetworkInterfaces(Arrays.asList("yvdcsitynnaa", "dectehfiqsc")) - .withBytesToCapturePerPacket(991412043845588361L) - .withTotalBytesPerSession(7720678337601187559L) - .withTimeLimitInSeconds(732207919); - model = BinaryData.fromObject(model).toObject(PacketCaptureInner.class); - Assertions.assertEquals("yvdcsitynnaa", model.networkInterfaces().get(0)); - Assertions.assertEquals(991412043845588361L, model.bytesToCapturePerPacket()); - Assertions.assertEquals(7720678337601187559L, model.totalBytesPerSession()); - Assertions.assertEquals(732207919, model.timeLimitInSeconds()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCaptureListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCaptureListResultTests.java deleted file mode 100644 index ea6ad47478b5..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCaptureListResultTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCaptureInner; -import com.azure.resourcemanager.mobilenetwork.models.PacketCaptureListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PacketCaptureListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCaptureListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"status\":\"Error\",\"reason\":\"qyud\",\"captureStartTime\":\"2021-08-19T10:45:17Z\",\"networkInterfaces\":[\"b\",\"oczvy\",\"fqrvkdvjsllrmvvd\",\"watkpnpulexxb\"],\"bytesToCapturePerPacket\":8119628141774012024,\"totalBytesPerSession\":6075438403018061337,\"timeLimitInSeconds\":223654021},\"id\":\"zb\",\"name\":\"j\",\"type\":\"sovmyokacspkwl\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"status\":\"Running\",\"reason\":\"xjmflbvv\",\"captureStartTime\":\"2021-01-14T17:49:26Z\",\"networkInterfaces\":[\"cciw\",\"zjuqkhrsaj\",\"wkuofoskghsauu\",\"mjmvxieduugidyjr\"],\"bytesToCapturePerPacket\":3682891038702940178,\"totalBytesPerSession\":7621842593771814376,\"timeLimitInSeconds\":28529322},\"id\":\"xc\",\"name\":\"onpc\",\"type\":\"hocohslkev\"},{\"properties\":{\"provisioningState\":\"Failed\",\"status\":\"Running\",\"reason\":\"buhfmvfaxkffeiit\",\"captureStartTime\":\"2021-08-31T22:03:19Z\",\"networkInterfaces\":[\"zy\"],\"bytesToCapturePerPacket\":4685428530799529051,\"totalBytesPerSession\":6199142667074725987,\"timeLimitInSeconds\":63743502},\"id\":\"zoggigrxwburvjxx\",\"name\":\"nspydptkoenkoukn\",\"type\":\"udwtiukbl\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"status\":\"Error\",\"reason\":\"cipazyxoegukgjnp\",\"captureStartTime\":\"2021-06-13T14:39:26Z\",\"networkInterfaces\":[\"gevqznty\",\"mrbpizcdrqj\",\"dpydn\",\"yhxdeoejzicwi\"],\"bytesToCapturePerPacket\":6694189583402716643,\"totalBytesPerSession\":1558927295996088992,\"timeLimitInSeconds\":1731680066},\"id\":\"ishc\",\"name\":\"khaj\",\"type\":\"eyeam\"}],\"nextLink\":\"hagalpbuxwgipwh\"}") - .toObject(PacketCaptureListResult.class); - Assertions.assertEquals("b", model.value().get(0).networkInterfaces().get(0)); - Assertions.assertEquals(8119628141774012024L, model.value().get(0).bytesToCapturePerPacket()); - Assertions.assertEquals(6075438403018061337L, model.value().get(0).totalBytesPerSession()); - Assertions.assertEquals(223654021, model.value().get(0).timeLimitInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCaptureListResult model = - new PacketCaptureListResult() - .withValue( - Arrays - .asList( - new PacketCaptureInner() - .withNetworkInterfaces(Arrays.asList("b", "oczvy", "fqrvkdvjsllrmvvd", "watkpnpulexxb")) - .withBytesToCapturePerPacket(8119628141774012024L) - .withTotalBytesPerSession(6075438403018061337L) - .withTimeLimitInSeconds(223654021), - new PacketCaptureInner() - .withNetworkInterfaces( - Arrays.asList("cciw", "zjuqkhrsaj", "wkuofoskghsauu", "mjmvxieduugidyjr")) - .withBytesToCapturePerPacket(3682891038702940178L) - .withTotalBytesPerSession(7621842593771814376L) - .withTimeLimitInSeconds(28529322), - new PacketCaptureInner() - .withNetworkInterfaces(Arrays.asList("zy")) - .withBytesToCapturePerPacket(4685428530799529051L) - .withTotalBytesPerSession(6199142667074725987L) - .withTimeLimitInSeconds(63743502), - new PacketCaptureInner() - .withNetworkInterfaces( - Arrays.asList("gevqznty", "mrbpizcdrqj", "dpydn", "yhxdeoejzicwi")) - .withBytesToCapturePerPacket(6694189583402716643L) - .withTotalBytesPerSession(1558927295996088992L) - .withTimeLimitInSeconds(1731680066))); - model = BinaryData.fromObject(model).toObject(PacketCaptureListResult.class); - Assertions.assertEquals("b", model.value().get(0).networkInterfaces().get(0)); - Assertions.assertEquals(8119628141774012024L, model.value().get(0).bytesToCapturePerPacket()); - Assertions.assertEquals(6075438403018061337L, model.value().get(0).totalBytesPerSession()); - Assertions.assertEquals(223654021, model.value().get(0).timeLimitInSeconds()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturePropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturePropertiesFormatTests.java deleted file mode 100644 index bde6ca40bdc3..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturePropertiesFormatTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCapturePropertiesFormat; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PacketCapturePropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCapturePropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Failed\",\"status\":\"Stopped\",\"reason\":\"sqpjhvmdajvn\",\"captureStartTime\":\"2021-10-10T23:28:16Z\",\"networkInterfaces\":[\"q\",\"canoaeupf\",\"yhltrpmopjmcm\"],\"bytesToCapturePerPacket\":265760237696237793,\"totalBytesPerSession\":8426383833555811142,\"timeLimitInSeconds\":2088786530}") - .toObject(PacketCapturePropertiesFormat.class); - Assertions.assertEquals("q", model.networkInterfaces().get(0)); - Assertions.assertEquals(265760237696237793L, model.bytesToCapturePerPacket()); - Assertions.assertEquals(8426383833555811142L, model.totalBytesPerSession()); - Assertions.assertEquals(2088786530, model.timeLimitInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCapturePropertiesFormat model = - new PacketCapturePropertiesFormat() - .withNetworkInterfaces(Arrays.asList("q", "canoaeupf", "yhltrpmopjmcm")) - .withBytesToCapturePerPacket(265760237696237793L) - .withTotalBytesPerSession(8426383833555811142L) - .withTimeLimitInSeconds(2088786530); - model = BinaryData.fromObject(model).toObject(PacketCapturePropertiesFormat.class); - Assertions.assertEquals("q", model.networkInterfaces().get(0)); - Assertions.assertEquals(265760237696237793L, model.bytesToCapturePerPacket()); - Assertions.assertEquals(8426383833555811142L, model.totalBytesPerSession()); - Assertions.assertEquals(2088786530, model.timeLimitInSeconds()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesCreateOrUpdateMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesCreateOrUpdateMockTests.java deleted file mode 100644 index 052c762d7e80..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesCreateOrUpdateMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.PacketCapture; -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 PacketCapturesCreateOrUpdateMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"status\":\"NotStarted\",\"reason\":\"ubqmamh\",\"captureStartTime\":\"2021-08-24T12:41:38Z\",\"networkInterfaces\":[\"xz\",\"azttaboidvmfq\"],\"bytesToCapturePerPacket\":3132194827411846414,\"totalBytesPerSession\":8140031450715324589,\"timeLimitInSeconds\":1380428673},\"id\":\"pdfgkmtdherngbt\",\"name\":\"juahokqto\",\"type\":\"kauxof\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PacketCapture response = - manager - .packetCaptures() - .define("ujqlafcbahh") - .withExistingPacketCoreControlPlane("oxoebqi", "jipnwj") - .withNetworkInterfaces(Arrays.asList("viauogphua", "tvt")) - .withBytesToCapturePerPacket(8179260768876663444L) - .withTotalBytesPerSession(8804652635806499294L) - .withTimeLimitInSeconds(1995364399) - .create(); - - Assertions.assertEquals("xz", response.networkInterfaces().get(0)); - Assertions.assertEquals(3132194827411846414L, response.bytesToCapturePerPacket()); - Assertions.assertEquals(8140031450715324589L, response.totalBytesPerSession()); - Assertions.assertEquals(1380428673, response.timeLimitInSeconds()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesDeleteMockTests.java deleted file mode 100644 index 11b62819d3c5..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 PacketCapturesDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.packetCaptures().delete("ohqfzizv", "xmmkjs", "thnwpzte", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesGetWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesGetWithResponseMockTests.java deleted file mode 100644 index b37db0fa30b0..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesGetWithResponseMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.PacketCapture; -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 PacketCapturesGetWithResponseMockTests { - @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\":{\"provisioningState\":\"Accepted\",\"status\":\"NotStarted\",\"reason\":\"wiwtglxxhl\",\"captureStartTime\":\"2021-02-24T17:36:23Z\",\"networkInterfaces\":[\"icrmnzh\",\"gmqgjs\",\"vpqcb\",\"rmbodt\"],\"bytesToCapturePerPacket\":4761446188291703076,\"totalBytesPerSession\":6402554888202206387,\"timeLimitInSeconds\":26841896},\"id\":\"bakclacjfrnxous\",\"name\":\"au\",\"type\":\"lwvsgm\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PacketCapture response = - manager - .packetCaptures() - .getWithResponse("kfvxcnq", "xqpswok", "vkhlggdhbemz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("icrmnzh", response.networkInterfaces().get(0)); - Assertions.assertEquals(4761446188291703076L, response.bytesToCapturePerPacket()); - Assertions.assertEquals(6402554888202206387L, response.totalBytesPerSession()); - Assertions.assertEquals(26841896, response.timeLimitInSeconds()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesListByPacketCoreControlPlaneMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesListByPacketCoreControlPlaneMockTests.java deleted file mode 100644 index b534008f3af1..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesListByPacketCoreControlPlaneMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.PacketCapture; -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 PacketCapturesListByPacketCoreControlPlaneMockTests { - @Test - public void testListByPacketCoreControlPlane() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"status\":\"Error\",\"reason\":\"qhibtozipqwjedm\",\"captureStartTime\":\"2021-01-18T06:45:43Z\",\"networkInterfaces\":[\"g\"],\"bytesToCapturePerPacket\":3365280671327791435,\"totalBytesPerSession\":5181301429444209355,\"timeLimitInSeconds\":538601125},\"id\":\"kmqp\",\"name\":\"o\",\"type\":\"hlfbcgwgc\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.packetCaptures().listByPacketCoreControlPlane("phdu", "neiknpg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("g", response.iterator().next().networkInterfaces().get(0)); - Assertions.assertEquals(3365280671327791435L, response.iterator().next().bytesToCapturePerPacket()); - Assertions.assertEquals(5181301429444209355L, response.iterator().next().totalBytesPerSession()); - Assertions.assertEquals(538601125, response.iterator().next().timeLimitInSeconds()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesStopMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesStopMockTests.java deleted file mode 100644 index da07a22fe952..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCapturesStopMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AsyncOperationStatus; -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 PacketCapturesStopMockTests { - @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 = - "{\"id\":\"hnykz\",\"name\":\"gswvxwlmzqwm\",\"status\":\"tx\",\"resourceId\":\"mxmcuqudtcvclxy\",\"startTime\":\"2021-06-24T22:05:31Z\",\"endTime\":\"2021-08-20T13:54:14Z\",\"percentComplete\":56.83583807388026,\"properties\":\"datauiyjib\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AsyncOperationStatus response = - manager.packetCaptures().stop("ovmribiattg", "lu", "fotang", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hnykz", response.id()); - Assertions.assertEquals("gswvxwlmzqwm", response.name()); - Assertions.assertEquals("tx", response.status()); - Assertions.assertEquals("mxmcuqudtcvclxy", response.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-24T22:05:31Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-20T13:54:14Z"), response.endTime()); - Assertions.assertEquals(56.83583807388026D, response.percentComplete()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneCollectDiagnosticsPackageTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneCollectDiagnosticsPackageTests.java deleted file mode 100644 index e38c957feafe..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneCollectDiagnosticsPackageTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneCollectDiagnosticsPackage; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreControlPlaneCollectDiagnosticsPackageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreControlPlaneCollectDiagnosticsPackage model = - BinaryData - .fromString("{\"storageAccountBlobUrl\":\"ahzxctobgbk\"}") - .toObject(PacketCoreControlPlaneCollectDiagnosticsPackage.class); - Assertions.assertEquals("ahzxctobgbk", model.storageAccountBlobUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreControlPlaneCollectDiagnosticsPackage model = - new PacketCoreControlPlaneCollectDiagnosticsPackage().withStorageAccountBlobUrl("ahzxctobgbk"); - model = BinaryData.fromObject(model).toObject(PacketCoreControlPlaneCollectDiagnosticsPackage.class); - Assertions.assertEquals("ahzxctobgbk", model.storageAccountBlobUrl()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneInnerTests.java deleted file mode 100644 index 1c896ac6efd9..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneInnerTests.java +++ /dev/null @@ -1,146 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneInner; -import com.azure.resourcemanager.mobilenetwork.models.AuthenticationType; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackEdgeDeviceResourceId; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackHciClusterResourceId; -import com.azure.resourcemanager.mobilenetwork.models.BillingSku; -import com.azure.resourcemanager.mobilenetwork.models.ConnectedClusterResourceId; -import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; -import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; -import com.azure.resourcemanager.mobilenetwork.models.DesiredInstallationState; -import com.azure.resourcemanager.mobilenetwork.models.DiagnosticsUploadConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.HttpsServerCertificate; -import com.azure.resourcemanager.mobilenetwork.models.Installation; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import com.azure.resourcemanager.mobilenetwork.models.LocalDiagnosticsAccessConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentity; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mobilenetwork.models.PlatformConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.SiteResourceId; -import com.azure.resourcemanager.mobilenetwork.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreControlPlaneInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreControlPlaneInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Deleting\",\"installation\":{\"desiredState\":\"Installed\",\"state\":\"Failed\",\"reinstallRequired\":\"NotRequired\",\"reasons\":[\"NoAttachedDataNetworks\"],\"operation\":{\"id\":\"zbinjeputtm\"}},\"sites\":[{\"id\":\"wnuzoqftiyqzrnkc\"},{\"id\":\"vyxlwhzlsicohoqq\"}],\"platform\":{\"type\":\"AKS-HCI\",\"azureStackEdgeDevice\":{\"id\":\"lryav\"},\"azureStackEdgeDevices\":[{\"id\":\"eun\"}],\"azureStackHciCluster\":{\"id\":\"qhgyxzkonocukok\"},\"connectedCluster\":{\"id\":\"axuconuq\"},\"customLocation\":{\"id\":\"fkbey\"}},\"coreNetworkTechnology\":\"5GC\",\"version\":\"mjmwvvjektcx\",\"installedVersion\":\"nhwlrsffrzpwvl\",\"rollbackVersion\":\"q\",\"controlPlaneAccessInterface\":{\"name\":\"iqylihkaetck\",\"ipv4Address\":\"fcivfsnkym\",\"ipv4Subnet\":\"tqhjfbebrjcx\",\"ipv4Gateway\":\"fuwutttxf\"},\"sku\":\"G1\",\"ueMtu\":871472535,\"localDiagnosticsAccess\":{\"authenticationType\":\"AAD\",\"httpsServerCertificate\":{\"certificateUrl\":\"phxepcyvahf\",\"provisioning\":{\"state\":\"Provisioned\",\"reason\":\"qxj\"}}},\"diagnosticsUpload\":{\"storageAccountContainerUrl\":\"ujqgidok\"},\"interopSettings\":\"dataljyoxgvcltb\"},\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"jeszzhbijhtxfv\":{\"principalId\":\"c330c655-1399-4955-b1a5-c0ba62de7208\",\"clientId\":\"e13960de-9eec-45fd-b2d7-080e69b1988a\"},\"fsm\":{\"principalId\":\"fb0c4583-9886-4f1b-867e-491afcb96d24\",\"clientId\":\"2eb5ce63-fb75-4141-a6bc-15e921f03ebf\"},\"hmpvecx\":{\"principalId\":\"a40433a6-0ad2-4389-b205-bc92efcaa173\",\"clientId\":\"a5591a44-c922-4b0f-891f-8408936af73f\"}}},\"location\":\"debfqkkrbmpukgri\",\"tags\":{\"ahmgkbrp\":\"zlfbxzpuzycispnq\",\"hibnuqqkpika\":\"y\",\"buynhijggm\":\"rgvtqag\"},\"id\":\"bfs\",\"name\":\"arbu\",\"type\":\"rcvpnazzmhjrunmp\"}") - .toObject(PacketCoreControlPlaneInner.class); - Assertions.assertEquals("debfqkkrbmpukgri", model.location()); - Assertions.assertEquals("zlfbxzpuzycispnq", model.tags().get("ahmgkbrp")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals(DesiredInstallationState.INSTALLED, model.installation().desiredState()); - Assertions.assertEquals("wnuzoqftiyqzrnkc", model.sites().get(0).id()); - Assertions.assertEquals(PlatformType.AKS_HCI, model.platform().type()); - Assertions.assertEquals("lryav", model.platform().azureStackEdgeDevice().id()); - Assertions.assertEquals("qhgyxzkonocukok", model.platform().azureStackHciCluster().id()); - Assertions.assertEquals("axuconuq", model.platform().connectedCluster().id()); - Assertions.assertEquals("fkbey", model.platform().customLocation().id()); - Assertions.assertEquals(CoreNetworkType.FIVE_GC, model.coreNetworkTechnology()); - Assertions.assertEquals("mjmwvvjektcx", model.version()); - Assertions.assertEquals("iqylihkaetck", model.controlPlaneAccessInterface().name()); - Assertions.assertEquals("fcivfsnkym", model.controlPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("tqhjfbebrjcx", model.controlPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("fuwutttxf", model.controlPlaneAccessInterface().ipv4Gateway()); - Assertions.assertEquals(BillingSku.G1, model.sku()); - Assertions.assertEquals(871472535, model.ueMtu()); - Assertions.assertEquals(AuthenticationType.AAD, model.localDiagnosticsAccess().authenticationType()); - Assertions - .assertEquals("phxepcyvahf", model.localDiagnosticsAccess().httpsServerCertificate().certificateUrl()); - Assertions.assertEquals("ujqgidok", model.diagnosticsUpload().storageAccountContainerUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreControlPlaneInner model = - new PacketCoreControlPlaneInner() - .withLocation("debfqkkrbmpukgri") - .withTags(mapOf("ahmgkbrp", "zlfbxzpuzycispnq", "hibnuqqkpika", "y", "buynhijggm", "rgvtqag")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities( - mapOf( - "jeszzhbijhtxfv", - new UserAssignedIdentity(), - "fsm", - new UserAssignedIdentity(), - "hmpvecx", - new UserAssignedIdentity()))) - .withInstallation(new Installation().withDesiredState(DesiredInstallationState.INSTALLED)) - .withSites( - Arrays - .asList( - new SiteResourceId().withId("wnuzoqftiyqzrnkc"), - new SiteResourceId().withId("vyxlwhzlsicohoqq"))) - .withPlatform( - new PlatformConfiguration() - .withType(PlatformType.AKS_HCI) - .withAzureStackEdgeDevice(new AzureStackEdgeDeviceResourceId().withId("lryav")) - .withAzureStackHciCluster(new AzureStackHciClusterResourceId().withId("qhgyxzkonocukok")) - .withConnectedCluster(new ConnectedClusterResourceId().withId("axuconuq")) - .withCustomLocation(new CustomLocationResourceId().withId("fkbey"))) - .withCoreNetworkTechnology(CoreNetworkType.FIVE_GC) - .withVersion("mjmwvvjektcx") - .withControlPlaneAccessInterface( - new InterfaceProperties() - .withName("iqylihkaetck") - .withIpv4Address("fcivfsnkym") - .withIpv4Subnet("tqhjfbebrjcx") - .withIpv4Gateway("fuwutttxf")) - .withSku(BillingSku.G1) - .withUeMtu(871472535) - .withLocalDiagnosticsAccess( - new LocalDiagnosticsAccessConfiguration() - .withAuthenticationType(AuthenticationType.AAD) - .withHttpsServerCertificate(new HttpsServerCertificate().withCertificateUrl("phxepcyvahf"))) - .withDiagnosticsUpload(new DiagnosticsUploadConfiguration().withStorageAccountContainerUrl("ujqgidok")) - .withInteropSettings("dataljyoxgvcltb"); - model = BinaryData.fromObject(model).toObject(PacketCoreControlPlaneInner.class); - Assertions.assertEquals("debfqkkrbmpukgri", model.location()); - Assertions.assertEquals("zlfbxzpuzycispnq", model.tags().get("ahmgkbrp")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals(DesiredInstallationState.INSTALLED, model.installation().desiredState()); - Assertions.assertEquals("wnuzoqftiyqzrnkc", model.sites().get(0).id()); - Assertions.assertEquals(PlatformType.AKS_HCI, model.platform().type()); - Assertions.assertEquals("lryav", model.platform().azureStackEdgeDevice().id()); - Assertions.assertEquals("qhgyxzkonocukok", model.platform().azureStackHciCluster().id()); - Assertions.assertEquals("axuconuq", model.platform().connectedCluster().id()); - Assertions.assertEquals("fkbey", model.platform().customLocation().id()); - Assertions.assertEquals(CoreNetworkType.FIVE_GC, model.coreNetworkTechnology()); - Assertions.assertEquals("mjmwvvjektcx", model.version()); - Assertions.assertEquals("iqylihkaetck", model.controlPlaneAccessInterface().name()); - Assertions.assertEquals("fcivfsnkym", model.controlPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("tqhjfbebrjcx", model.controlPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("fuwutttxf", model.controlPlaneAccessInterface().ipv4Gateway()); - Assertions.assertEquals(BillingSku.G1, model.sku()); - Assertions.assertEquals(871472535, model.ueMtu()); - Assertions.assertEquals(AuthenticationType.AAD, model.localDiagnosticsAccess().authenticationType()); - Assertions - .assertEquals("phxepcyvahf", model.localDiagnosticsAccess().httpsServerCertificate().certificateUrl()); - Assertions.assertEquals("ujqgidok", model.diagnosticsUpload().storageAccountContainerUrl()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneListResultTests.java deleted file mode 100644 index c5b3f0b19131..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneListResultTests.java +++ /dev/null @@ -1,222 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneInner; -import com.azure.resourcemanager.mobilenetwork.models.AuthenticationType; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackEdgeDeviceResourceId; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackHciClusterResourceId; -import com.azure.resourcemanager.mobilenetwork.models.BillingSku; -import com.azure.resourcemanager.mobilenetwork.models.ConnectedClusterResourceId; -import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; -import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; -import com.azure.resourcemanager.mobilenetwork.models.DesiredInstallationState; -import com.azure.resourcemanager.mobilenetwork.models.DiagnosticsUploadConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.HttpsServerCertificate; -import com.azure.resourcemanager.mobilenetwork.models.Installation; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import com.azure.resourcemanager.mobilenetwork.models.LocalDiagnosticsAccessConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentity; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneListResult; -import com.azure.resourcemanager.mobilenetwork.models.PlatformConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.SiteResourceId; -import com.azure.resourcemanager.mobilenetwork.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreControlPlaneListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreControlPlaneListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"installation\":{\"desiredState\":\"Uninstalled\",\"state\":\"Upgrading\",\"reinstallRequired\":\"Required\",\"reasons\":[\"NoSlices\"],\"operation\":{\"id\":\"spkdee\"}},\"sites\":[{\"id\":\"ofmxagkvtmelmqkr\"},{\"id\":\"ahvljuaha\"},{\"id\":\"uhcdhm\"}],\"platform\":{\"type\":\"3P-AZURE-STACK-HCI\",\"azureStackEdgeDevice\":{\"id\":\"laexqp\"},\"azureStackEdgeDevices\":[{\"id\":\"dmwsrcrgvxpvgomz\"}],\"azureStackHciCluster\":{\"id\":\"misgwbnb\"},\"connectedCluster\":{\"id\":\"ldawkzbaliourqha\"},\"customLocation\":{\"id\":\"uhashsfwx\"}},\"coreNetworkTechnology\":\"EPC" - + " + 5GC\",\"version\":\"z\",\"installedVersion\":\"ugicjooxdjebw\",\"rollbackVersion\":\"cwwfvovbvme\",\"controlPlaneAccessInterface\":{\"name\":\"civyhzceuo\",\"ipv4Address\":\"jrwjueiotwm\",\"ipv4Subnet\":\"ytdxwit\",\"ipv4Gateway\":\"rjaw\"},\"sku\":\"G5\",\"ueMtu\":1621003688,\"localDiagnosticsAccess\":{\"authenticationType\":\"Password\",\"httpsServerCertificate\":{\"certificateUrl\":\"ni\",\"provisioning\":{}}},\"diagnosticsUpload\":{\"storageAccountContainerUrl\":\"fbkp\"},\"interopSettings\":\"datagklwn\"},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"whvylw\":{\"principalId\":\"37574e11-edbf-45a2-a892-710c0baf2080\",\"clientId\":\"278b2c95-6ed2-4735-a35a-46f44176708d\"},\"dhxujznbmpo\":{\"principalId\":\"241ce80a-673b-4d54-8c60-0864fa3aac07\",\"clientId\":\"67c8d0c5-69a7-47c5-8dd5-7aba97c1bae3\"},\"przqlveu\":{\"principalId\":\"cecedd2a-2c19-4712-8154-175f5655fa41\",\"clientId\":\"176c59d0-f4b0-4cb8-b4e1-1f4307dd0584\"},\"pjmkhfxobbc\":{\"principalId\":\"65781622-72fa-4a59-a768-0e7ed019fcb4\",\"clientId\":\"2c9888ec-0f2e-4ed9-a84f-d7d557e9a417\"}}},\"location\":\"s\",\"tags\":{\"fgb\":\"riplrbpbewtg\",\"wxzvlvqhjkb\":\"c\",\"iebwwaloayqcgwrt\":\"gibtnm\",\"zg\":\"j\"},\"id\":\"yzm\",\"name\":\"txon\",\"type\":\"mtsavjcbpwxqp\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"installation\":{\"desiredState\":\"Installed\",\"state\":\"Updating\",\"reinstallRequired\":\"Required\",\"reasons\":[\"NoAttachedDataNetworks\",\"NoAttachedDataNetworks\",\"NoAttachedDataNetworks\"],\"operation\":{\"id\":\"mdyvxqtayriw\"}},\"sites\":[{\"id\":\"oyq\"}],\"platform\":{\"type\":\"3P-AZURE-STACK-HCI\",\"azureStackEdgeDevice\":{\"id\":\"rmcqiby\"},\"azureStackEdgeDevices\":[{\"id\":\"jvkn\"},{\"id\":\"e\"},{\"id\":\"qsgzvahapj\"},{\"id\":\"zhpvgqzcjrvxd\"}],\"azureStackHciCluster\":{\"id\":\"lmwlxkvugfhzo\"},\"connectedCluster\":{\"id\":\"wjvzunluthnn\"},\"customLocation\":{\"id\":\"nxipeil\"}},\"coreNetworkTechnology\":\"EPC" - + " + 5GC\",\"version\":\"aejxd\",\"installedVersion\":\"tskzbbtdzumveek\",\"rollbackVersion\":\"wozuhkf\",\"controlPlaneAccessInterface\":{\"name\":\"sjyofdx\",\"ipv4Address\":\"us\",\"ipv4Subnet\":\"touwaboekqv\",\"ipv4Gateway\":\"lns\"},\"sku\":\"G10\",\"ueMtu\":314739755,\"localDiagnosticsAccess\":{\"authenticationType\":\"Password\",\"httpsServerCertificate\":{\"certificateUrl\":\"jsflhhcaalnjix\",\"provisioning\":{}}},\"diagnosticsUpload\":{\"storageAccountContainerUrl\":\"yaw\"},\"interopSettings\":\"datayaqcslyjpkiidz\"},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ixhnrztf\":{\"principalId\":\"b80cdd3f-13a9-4729-bd68-a4466dd42615\",\"clientId\":\"1e366abc-7f7e-455a-ae57-d10d19d4200a\"},\"bnxknalaulppg\":{\"principalId\":\"c6d23d6d-58a7-437d-9ecd-26e1fcd13c7f\",\"clientId\":\"4a963bb7-6b20-41bd-80c9-90981b9d48ba\"},\"pnapnyiropuh\":{\"principalId\":\"a36196dd-9218-42a0-8f71-5909121d0e46\",\"clientId\":\"99b38e48-ca81-43ab-bfde-ce358e0696d6\"}}},\"location\":\"gvpgy\",\"tags\":{\"medjvcslynqwwncw\":\"git\",\"pkteo\":\"zhxgktrmgucn\"},\"id\":\"llwptfdy\",\"name\":\"pfqbuaceopzf\",\"type\":\"rhhuaopppcqeqx\"}],\"nextLink\":\"z\"}") - .toObject(PacketCoreControlPlaneListResult.class); - Assertions.assertEquals("s", model.value().get(0).location()); - Assertions.assertEquals("riplrbpbewtg", model.value().get(0).tags().get("fgb")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions - .assertEquals(DesiredInstallationState.UNINSTALLED, model.value().get(0).installation().desiredState()); - Assertions.assertEquals("ofmxagkvtmelmqkr", model.value().get(0).sites().get(0).id()); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.value().get(0).platform().type()); - Assertions.assertEquals("laexqp", model.value().get(0).platform().azureStackEdgeDevice().id()); - Assertions.assertEquals("misgwbnb", model.value().get(0).platform().azureStackHciCluster().id()); - Assertions.assertEquals("ldawkzbaliourqha", model.value().get(0).platform().connectedCluster().id()); - Assertions.assertEquals("uhashsfwx", model.value().get(0).platform().customLocation().id()); - Assertions.assertEquals(CoreNetworkType.EPC_5GC, model.value().get(0).coreNetworkTechnology()); - Assertions.assertEquals("z", model.value().get(0).version()); - Assertions.assertEquals("civyhzceuo", model.value().get(0).controlPlaneAccessInterface().name()); - Assertions.assertEquals("jrwjueiotwm", model.value().get(0).controlPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("ytdxwit", model.value().get(0).controlPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("rjaw", model.value().get(0).controlPlaneAccessInterface().ipv4Gateway()); - Assertions.assertEquals(BillingSku.G5, model.value().get(0).sku()); - Assertions.assertEquals(1621003688, model.value().get(0).ueMtu()); - Assertions - .assertEquals( - AuthenticationType.PASSWORD, model.value().get(0).localDiagnosticsAccess().authenticationType()); - Assertions - .assertEquals( - "ni", model.value().get(0).localDiagnosticsAccess().httpsServerCertificate().certificateUrl()); - Assertions.assertEquals("fbkp", model.value().get(0).diagnosticsUpload().storageAccountContainerUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreControlPlaneListResult model = - new PacketCoreControlPlaneListResult() - .withValue( - Arrays - .asList( - new PacketCoreControlPlaneInner() - .withLocation("s") - .withTags( - mapOf( - "fgb", - "riplrbpbewtg", - "wxzvlvqhjkb", - "c", - "iebwwaloayqcgwrt", - "gibtnm", - "zg", - "j")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "whvylw", - new UserAssignedIdentity(), - "dhxujznbmpo", - new UserAssignedIdentity(), - "przqlveu", - new UserAssignedIdentity(), - "pjmkhfxobbc", - new UserAssignedIdentity()))) - .withInstallation( - new Installation().withDesiredState(DesiredInstallationState.UNINSTALLED)) - .withSites( - Arrays - .asList( - new SiteResourceId().withId("ofmxagkvtmelmqkr"), - new SiteResourceId().withId("ahvljuaha"), - new SiteResourceId().withId("uhcdhm"))) - .withPlatform( - new PlatformConfiguration() - .withType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withAzureStackEdgeDevice(new AzureStackEdgeDeviceResourceId().withId("laexqp")) - .withAzureStackHciCluster( - new AzureStackHciClusterResourceId().withId("misgwbnb")) - .withConnectedCluster( - new ConnectedClusterResourceId().withId("ldawkzbaliourqha")) - .withCustomLocation(new CustomLocationResourceId().withId("uhashsfwx"))) - .withCoreNetworkTechnology(CoreNetworkType.EPC_5GC) - .withVersion("z") - .withControlPlaneAccessInterface( - new InterfaceProperties() - .withName("civyhzceuo") - .withIpv4Address("jrwjueiotwm") - .withIpv4Subnet("ytdxwit") - .withIpv4Gateway("rjaw")) - .withSku(BillingSku.G5) - .withUeMtu(1621003688) - .withLocalDiagnosticsAccess( - new LocalDiagnosticsAccessConfiguration() - .withAuthenticationType(AuthenticationType.PASSWORD) - .withHttpsServerCertificate( - new HttpsServerCertificate().withCertificateUrl("ni"))) - .withDiagnosticsUpload( - new DiagnosticsUploadConfiguration().withStorageAccountContainerUrl("fbkp")) - .withInteropSettings("datagklwn"), - new PacketCoreControlPlaneInner() - .withLocation("gvpgy") - .withTags(mapOf("medjvcslynqwwncw", "git", "pkteo", "zhxgktrmgucn")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "ixhnrztf", - new UserAssignedIdentity(), - "bnxknalaulppg", - new UserAssignedIdentity(), - "pnapnyiropuh", - new UserAssignedIdentity()))) - .withInstallation( - new Installation().withDesiredState(DesiredInstallationState.INSTALLED)) - .withSites(Arrays.asList(new SiteResourceId().withId("oyq"))) - .withPlatform( - new PlatformConfiguration() - .withType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withAzureStackEdgeDevice( - new AzureStackEdgeDeviceResourceId().withId("rmcqiby")) - .withAzureStackHciCluster( - new AzureStackHciClusterResourceId().withId("lmwlxkvugfhzo")) - .withConnectedCluster(new ConnectedClusterResourceId().withId("wjvzunluthnn")) - .withCustomLocation(new CustomLocationResourceId().withId("nxipeil"))) - .withCoreNetworkTechnology(CoreNetworkType.EPC_5GC) - .withVersion("aejxd") - .withControlPlaneAccessInterface( - new InterfaceProperties() - .withName("sjyofdx") - .withIpv4Address("us") - .withIpv4Subnet("touwaboekqv") - .withIpv4Gateway("lns")) - .withSku(BillingSku.G10) - .withUeMtu(314739755) - .withLocalDiagnosticsAccess( - new LocalDiagnosticsAccessConfiguration() - .withAuthenticationType(AuthenticationType.PASSWORD) - .withHttpsServerCertificate( - new HttpsServerCertificate().withCertificateUrl("jsflhhcaalnjix"))) - .withDiagnosticsUpload( - new DiagnosticsUploadConfiguration().withStorageAccountContainerUrl("yaw")) - .withInteropSettings("datayaqcslyjpkiidz"))); - model = BinaryData.fromObject(model).toObject(PacketCoreControlPlaneListResult.class); - Assertions.assertEquals("s", model.value().get(0).location()); - Assertions.assertEquals("riplrbpbewtg", model.value().get(0).tags().get("fgb")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions - .assertEquals(DesiredInstallationState.UNINSTALLED, model.value().get(0).installation().desiredState()); - Assertions.assertEquals("ofmxagkvtmelmqkr", model.value().get(0).sites().get(0).id()); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.value().get(0).platform().type()); - Assertions.assertEquals("laexqp", model.value().get(0).platform().azureStackEdgeDevice().id()); - Assertions.assertEquals("misgwbnb", model.value().get(0).platform().azureStackHciCluster().id()); - Assertions.assertEquals("ldawkzbaliourqha", model.value().get(0).platform().connectedCluster().id()); - Assertions.assertEquals("uhashsfwx", model.value().get(0).platform().customLocation().id()); - Assertions.assertEquals(CoreNetworkType.EPC_5GC, model.value().get(0).coreNetworkTechnology()); - Assertions.assertEquals("z", model.value().get(0).version()); - Assertions.assertEquals("civyhzceuo", model.value().get(0).controlPlaneAccessInterface().name()); - Assertions.assertEquals("jrwjueiotwm", model.value().get(0).controlPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("ytdxwit", model.value().get(0).controlPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("rjaw", model.value().get(0).controlPlaneAccessInterface().ipv4Gateway()); - Assertions.assertEquals(BillingSku.G5, model.value().get(0).sku()); - Assertions.assertEquals(1621003688, model.value().get(0).ueMtu()); - Assertions - .assertEquals( - AuthenticationType.PASSWORD, model.value().get(0).localDiagnosticsAccess().authenticationType()); - Assertions - .assertEquals( - "ni", model.value().get(0).localDiagnosticsAccess().httpsServerCertificate().certificateUrl()); - Assertions.assertEquals("fbkp", model.value().get(0).diagnosticsUpload().storageAccountContainerUrl()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanePropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanePropertiesFormatTests.java deleted file mode 100644 index 1f16722dd14f..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanePropertiesFormatTests.java +++ /dev/null @@ -1,112 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlanePropertiesFormat; -import com.azure.resourcemanager.mobilenetwork.models.AuthenticationType; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackEdgeDeviceResourceId; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackHciClusterResourceId; -import com.azure.resourcemanager.mobilenetwork.models.BillingSku; -import com.azure.resourcemanager.mobilenetwork.models.ConnectedClusterResourceId; -import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; -import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; -import com.azure.resourcemanager.mobilenetwork.models.DesiredInstallationState; -import com.azure.resourcemanager.mobilenetwork.models.DiagnosticsUploadConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.HttpsServerCertificate; -import com.azure.resourcemanager.mobilenetwork.models.Installation; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import com.azure.resourcemanager.mobilenetwork.models.LocalDiagnosticsAccessConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PlatformConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.SiteResourceId; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreControlPlanePropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreControlPlanePropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Accepted\",\"installation\":{\"desiredState\":\"Installed\",\"state\":\"Updating\",\"reinstallRequired\":\"Required\",\"reasons\":[\"NoAttachedDataNetworks\",\"NoSlices\",\"NoSlices\",\"NoAttachedDataNetworks\"],\"operation\":{\"id\":\"k\"}},\"sites\":[{\"id\":\"henbtkcxywnytn\"},{\"id\":\"synlqidybyxczfc\"},{\"id\":\"haaxdbabphl\"},{\"id\":\"rqlfktsthsucocmn\"}],\"platform\":{\"type\":\"3P-AZURE-STACK-HCI\",\"azureStackEdgeDevice\":{\"id\":\"zt\"},\"azureStackEdgeDevices\":[{\"id\":\"wwrq\"},{\"id\":\"uedck\"}],\"azureStackHciCluster\":{\"id\":\"wbiexzfey\"},\"connectedCluster\":{\"id\":\"axibxujw\"},\"customLocation\":{\"id\":\"qwalmuzyoxaepd\"}},\"coreNetworkTechnology\":\"EPC" - + " + 5GC\",\"version\":\"ncuxrhdwb\",\"installedVersion\":\"xbniwdjs\",\"rollbackVersion\":\"tsdbpgn\",\"controlPlaneAccessInterface\":{\"name\":\"txhp\",\"ipv4Address\":\"bzpfzab\",\"ipv4Subnet\":\"cuh\",\"ipv4Gateway\":\"tcty\"},\"sku\":\"G2\",\"ueMtu\":2142473497,\"localDiagnosticsAccess\":{\"authenticationType\":\"Password\",\"httpsServerCertificate\":{\"certificateUrl\":\"ovplw\",\"provisioning\":{\"state\":\"Failed\",\"reason\":\"yuguosvmkfssx\"}}},\"diagnosticsUpload\":{\"storageAccountContainerUrl\":\"kkfpl\"},\"interopSettings\":\"datagsxnkjzkdeslpv\"}") - .toObject(PacketCoreControlPlanePropertiesFormat.class); - Assertions.assertEquals(DesiredInstallationState.INSTALLED, model.installation().desiredState()); - Assertions.assertEquals("henbtkcxywnytn", model.sites().get(0).id()); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.platform().type()); - Assertions.assertEquals("zt", model.platform().azureStackEdgeDevice().id()); - Assertions.assertEquals("wbiexzfey", model.platform().azureStackHciCluster().id()); - Assertions.assertEquals("axibxujw", model.platform().connectedCluster().id()); - Assertions.assertEquals("qwalmuzyoxaepd", model.platform().customLocation().id()); - Assertions.assertEquals(CoreNetworkType.EPC_5GC, model.coreNetworkTechnology()); - Assertions.assertEquals("ncuxrhdwb", model.version()); - Assertions.assertEquals("txhp", model.controlPlaneAccessInterface().name()); - Assertions.assertEquals("bzpfzab", model.controlPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("cuh", model.controlPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("tcty", model.controlPlaneAccessInterface().ipv4Gateway()); - Assertions.assertEquals(BillingSku.G2, model.sku()); - Assertions.assertEquals(2142473497, model.ueMtu()); - Assertions.assertEquals(AuthenticationType.PASSWORD, model.localDiagnosticsAccess().authenticationType()); - Assertions.assertEquals("ovplw", model.localDiagnosticsAccess().httpsServerCertificate().certificateUrl()); - Assertions.assertEquals("kkfpl", model.diagnosticsUpload().storageAccountContainerUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreControlPlanePropertiesFormat model = - new PacketCoreControlPlanePropertiesFormat() - .withInstallation(new Installation().withDesiredState(DesiredInstallationState.INSTALLED)) - .withSites( - Arrays - .asList( - new SiteResourceId().withId("henbtkcxywnytn"), - new SiteResourceId().withId("synlqidybyxczfc"), - new SiteResourceId().withId("haaxdbabphl"), - new SiteResourceId().withId("rqlfktsthsucocmn"))) - .withPlatform( - new PlatformConfiguration() - .withType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withAzureStackEdgeDevice(new AzureStackEdgeDeviceResourceId().withId("zt")) - .withAzureStackHciCluster(new AzureStackHciClusterResourceId().withId("wbiexzfey")) - .withConnectedCluster(new ConnectedClusterResourceId().withId("axibxujw")) - .withCustomLocation(new CustomLocationResourceId().withId("qwalmuzyoxaepd"))) - .withCoreNetworkTechnology(CoreNetworkType.EPC_5GC) - .withVersion("ncuxrhdwb") - .withControlPlaneAccessInterface( - new InterfaceProperties() - .withName("txhp") - .withIpv4Address("bzpfzab") - .withIpv4Subnet("cuh") - .withIpv4Gateway("tcty")) - .withSku(BillingSku.G2) - .withUeMtu(2142473497) - .withLocalDiagnosticsAccess( - new LocalDiagnosticsAccessConfiguration() - .withAuthenticationType(AuthenticationType.PASSWORD) - .withHttpsServerCertificate(new HttpsServerCertificate().withCertificateUrl("ovplw"))) - .withDiagnosticsUpload(new DiagnosticsUploadConfiguration().withStorageAccountContainerUrl("kkfpl")) - .withInteropSettings("datagsxnkjzkdeslpv"); - model = BinaryData.fromObject(model).toObject(PacketCoreControlPlanePropertiesFormat.class); - Assertions.assertEquals(DesiredInstallationState.INSTALLED, model.installation().desiredState()); - Assertions.assertEquals("henbtkcxywnytn", model.sites().get(0).id()); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.platform().type()); - Assertions.assertEquals("zt", model.platform().azureStackEdgeDevice().id()); - Assertions.assertEquals("wbiexzfey", model.platform().azureStackHciCluster().id()); - Assertions.assertEquals("axibxujw", model.platform().connectedCluster().id()); - Assertions.assertEquals("qwalmuzyoxaepd", model.platform().customLocation().id()); - Assertions.assertEquals(CoreNetworkType.EPC_5GC, model.coreNetworkTechnology()); - Assertions.assertEquals("ncuxrhdwb", model.version()); - Assertions.assertEquals("txhp", model.controlPlaneAccessInterface().name()); - Assertions.assertEquals("bzpfzab", model.controlPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("cuh", model.controlPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("tcty", model.controlPlaneAccessInterface().ipv4Gateway()); - Assertions.assertEquals(BillingSku.G2, model.sku()); - Assertions.assertEquals(2142473497, model.ueMtu()); - Assertions.assertEquals(AuthenticationType.PASSWORD, model.localDiagnosticsAccess().authenticationType()); - Assertions.assertEquals("ovplw", model.localDiagnosticsAccess().httpsServerCertificate().certificateUrl()); - Assertions.assertEquals("kkfpl", model.diagnosticsUpload().storageAccountContainerUrl()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneResourceIdTests.java deleted file mode 100644 index 5bdb99c685c7..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneResourceId; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreControlPlaneResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreControlPlaneResourceId model = - BinaryData.fromString("{\"id\":\"rxpdlcgqlsi\"}").toObject(PacketCoreControlPlaneResourceId.class); - Assertions.assertEquals("rxpdlcgqlsi", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreControlPlaneResourceId model = new PacketCoreControlPlaneResourceId().withId("rxpdlcgqlsi"); - model = BinaryData.fromObject(model).toObject(PacketCoreControlPlaneResourceId.class); - Assertions.assertEquals("rxpdlcgqlsi", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionInnerTests.java deleted file mode 100644 index d79975ae508a..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionInnerTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneVersionInner; -import com.azure.resourcemanager.mobilenetwork.models.ObsoleteVersion; -import com.azure.resourcemanager.mobilenetwork.models.Platform; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.RecommendedVersion; -import com.azure.resourcemanager.mobilenetwork.models.VersionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreControlPlaneVersionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreControlPlaneVersionInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\",\"platforms\":[{\"platformType\":\"AKS-HCI\",\"versionState\":\"Unknown\",\"minimumPlatformSoftwareVersion\":\"grcfb\",\"maximumPlatformSoftwareVersion\":\"rmfqjhhkxbpvj\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"AKS-HCI\",\"versionState\":\"Active\",\"minimumPlatformSoftwareVersion\":\"u\",\"maximumPlatformSoftwareVersion\":\"vkr\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"AKS-HCI\",\"versionState\":\"ValidationFailed\",\"minimumPlatformSoftwareVersion\":\"jfauvjfdxxi\",\"maximumPlatformSoftwareVersion\":\"tvtc\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"NotObsolete\"}]},\"id\":\"oqmcbxvwvxyslq\",\"name\":\"hsfxoblytkb\",\"type\":\"mpew\"}") - .toObject(PacketCoreControlPlaneVersionInner.class); - Assertions.assertEquals(PlatformType.AKS_HCI, model.platforms().get(0).platformType()); - Assertions.assertEquals(VersionState.UNKNOWN, model.platforms().get(0).versionState()); - Assertions.assertEquals("grcfb", model.platforms().get(0).minimumPlatformSoftwareVersion()); - Assertions.assertEquals("rmfqjhhkxbpvj", model.platforms().get(0).maximumPlatformSoftwareVersion()); - Assertions.assertEquals(RecommendedVersion.RECOMMENDED, model.platforms().get(0).recommendedVersion()); - Assertions.assertEquals(ObsoleteVersion.NOT_OBSOLETE, model.platforms().get(0).obsoleteVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreControlPlaneVersionInner model = - new PacketCoreControlPlaneVersionInner() - .withPlatforms( - Arrays - .asList( - new Platform() - .withPlatformType(PlatformType.AKS_HCI) - .withVersionState(VersionState.UNKNOWN) - .withMinimumPlatformSoftwareVersion("grcfb") - .withMaximumPlatformSoftwareVersion("rmfqjhhkxbpvj") - .withRecommendedVersion(RecommendedVersion.RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.NOT_OBSOLETE), - new Platform() - .withPlatformType(PlatformType.AKS_HCI) - .withVersionState(VersionState.ACTIVE) - .withMinimumPlatformSoftwareVersion("u") - .withMaximumPlatformSoftwareVersion("vkr") - .withRecommendedVersion(RecommendedVersion.NOT_RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.NOT_OBSOLETE), - new Platform() - .withPlatformType(PlatformType.AKS_HCI) - .withVersionState(VersionState.VALIDATION_FAILED) - .withMinimumPlatformSoftwareVersion("jfauvjfdxxi") - .withMaximumPlatformSoftwareVersion("tvtc") - .withRecommendedVersion(RecommendedVersion.RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.NOT_OBSOLETE))); - model = BinaryData.fromObject(model).toObject(PacketCoreControlPlaneVersionInner.class); - Assertions.assertEquals(PlatformType.AKS_HCI, model.platforms().get(0).platformType()); - Assertions.assertEquals(VersionState.UNKNOWN, model.platforms().get(0).versionState()); - Assertions.assertEquals("grcfb", model.platforms().get(0).minimumPlatformSoftwareVersion()); - Assertions.assertEquals("rmfqjhhkxbpvj", model.platforms().get(0).maximumPlatformSoftwareVersion()); - Assertions.assertEquals(RecommendedVersion.RECOMMENDED, model.platforms().get(0).recommendedVersion()); - Assertions.assertEquals(ObsoleteVersion.NOT_OBSOLETE, model.platforms().get(0).obsoleteVersion()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionListResultTests.java deleted file mode 100644 index acb2a8529e18..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionListResultTests.java +++ /dev/null @@ -1,152 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneVersionInner; -import com.azure.resourcemanager.mobilenetwork.models.ObsoleteVersion; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneVersionListResult; -import com.azure.resourcemanager.mobilenetwork.models.Platform; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.RecommendedVersion; -import com.azure.resourcemanager.mobilenetwork.models.VersionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreControlPlaneVersionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreControlPlaneVersionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"platforms\":[{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"Validating\",\"minimumPlatformSoftwareVersion\":\"oujmkcjhwqytj\",\"maximumPlatformSoftwareVersion\":\"bnw\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"Unknown\",\"minimumPlatformSoftwareVersion\":\"naenqpehindo\",\"maximumPlatformSoftwareVersion\":\"mifthnzdnd\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"AKS-HCI\",\"versionState\":\"Unknown\",\"minimumPlatformSoftwareVersion\":\"nduhavhqlkthum\",\"maximumPlatformSoftwareVersion\":\"olbgycduiertgccy\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"Obsolete\"},{\"platformType\":\"AKS-HCI\",\"versionState\":\"Validating\",\"minimumPlatformSoftwareVersion\":\"lfmmdnbbglzpswi\",\"maximumPlatformSoftwareVersion\":\"mcwyhzdxssadb\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"NotObsolete\"}]},\"id\":\"fznudaodvxzb\",\"name\":\"cblylpstdbhhxsr\",\"type\":\"dzu\"},{\"properties\":{\"provisioningState\":\"Deleted\",\"platforms\":[{\"platformType\":\"AKS-HCI\",\"versionState\":\"Preview\",\"minimumPlatformSoftwareVersion\":\"vfiwjmygtdss\",\"maximumPlatformSoftwareVersion\":\"wtmwerio\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"AKS-HCI\",\"versionState\":\"Unknown\",\"minimumPlatformSoftwareVersion\":\"bnetshh\",\"maximumPlatformSoftwareVersion\":\"h\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"Unknown\",\"minimumPlatformSoftwareVersion\":\"mwmbes\",\"maximumPlatformSoftwareVersion\":\"nkww\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"Obsolete\"},{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"Preview\",\"minimumPlatformSoftwareVersion\":\"aokonzmnsik\",\"maximumPlatformSoftwareVersion\":\"kqze\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"Obsolete\"}]},\"id\":\"tfz\",\"name\":\"mhhv\",\"type\":\"gureodkwobdag\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"platforms\":[{\"platformType\":\"AKS-HCI\",\"versionState\":\"ValidationFailed\",\"minimumPlatformSoftwareVersion\":\"akbogqxndlkzgxh\",\"maximumPlatformSoftwareVersion\":\"iplbpodxunkbebxm\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"Deprecated\",\"minimumPlatformSoftwareVersion\":\"qtkoievs\",\"maximumPlatformSoftwareVersion\":\"tgqr\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"Obsolete\"}]},\"id\":\"wlauwzizxbmpg\",\"name\":\"jefuzmuvpbttdumo\",\"type\":\"p\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"platforms\":[{\"platformType\":\"AKS-HCI\",\"versionState\":\"Preview\",\"minimumPlatformSoftwareVersion\":\"hjpglkf\",\"maximumPlatformSoftwareVersion\":\"hdneuelfph\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"Obsolete\"}]},\"id\":\"ozfikdowwq\",\"name\":\"uvxzxclvi\",\"type\":\"hhqzonosgg\"}],\"nextLink\":\"c\"}") - .toObject(PacketCoreControlPlaneVersionListResult.class); - Assertions - .assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.value().get(0).platforms().get(0).platformType()); - Assertions.assertEquals(VersionState.VALIDATING, model.value().get(0).platforms().get(0).versionState()); - Assertions - .assertEquals("oujmkcjhwqytj", model.value().get(0).platforms().get(0).minimumPlatformSoftwareVersion()); - Assertions.assertEquals("bnw", model.value().get(0).platforms().get(0).maximumPlatformSoftwareVersion()); - Assertions - .assertEquals( - RecommendedVersion.NOT_RECOMMENDED, model.value().get(0).platforms().get(0).recommendedVersion()); - Assertions - .assertEquals(ObsoleteVersion.NOT_OBSOLETE, model.value().get(0).platforms().get(0).obsoleteVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreControlPlaneVersionListResult model = - new PacketCoreControlPlaneVersionListResult() - .withValue( - Arrays - .asList( - new PacketCoreControlPlaneVersionInner() - .withPlatforms( - Arrays - .asList( - new Platform() - .withPlatformType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withVersionState(VersionState.VALIDATING) - .withMinimumPlatformSoftwareVersion("oujmkcjhwqytj") - .withMaximumPlatformSoftwareVersion("bnw") - .withRecommendedVersion(RecommendedVersion.NOT_RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.NOT_OBSOLETE), - new Platform() - .withPlatformType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withVersionState(VersionState.UNKNOWN) - .withMinimumPlatformSoftwareVersion("naenqpehindo") - .withMaximumPlatformSoftwareVersion("mifthnzdnd") - .withRecommendedVersion(RecommendedVersion.NOT_RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.NOT_OBSOLETE), - new Platform() - .withPlatformType(PlatformType.AKS_HCI) - .withVersionState(VersionState.UNKNOWN) - .withMinimumPlatformSoftwareVersion("nduhavhqlkthum") - .withMaximumPlatformSoftwareVersion("olbgycduiertgccy") - .withRecommendedVersion(RecommendedVersion.RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.OBSOLETE), - new Platform() - .withPlatformType(PlatformType.AKS_HCI) - .withVersionState(VersionState.VALIDATING) - .withMinimumPlatformSoftwareVersion("lfmmdnbbglzpswi") - .withMaximumPlatformSoftwareVersion("mcwyhzdxssadb") - .withRecommendedVersion(RecommendedVersion.NOT_RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.NOT_OBSOLETE))), - new PacketCoreControlPlaneVersionInner() - .withPlatforms( - Arrays - .asList( - new Platform() - .withPlatformType(PlatformType.AKS_HCI) - .withVersionState(VersionState.PREVIEW) - .withMinimumPlatformSoftwareVersion("vfiwjmygtdss") - .withMaximumPlatformSoftwareVersion("wtmwerio") - .withRecommendedVersion(RecommendedVersion.RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.NOT_OBSOLETE), - new Platform() - .withPlatformType(PlatformType.AKS_HCI) - .withVersionState(VersionState.UNKNOWN) - .withMinimumPlatformSoftwareVersion("bnetshh") - .withMaximumPlatformSoftwareVersion("h") - .withRecommendedVersion(RecommendedVersion.NOT_RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.NOT_OBSOLETE), - new Platform() - .withPlatformType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withVersionState(VersionState.UNKNOWN) - .withMinimumPlatformSoftwareVersion("mwmbes") - .withMaximumPlatformSoftwareVersion("nkww") - .withRecommendedVersion(RecommendedVersion.NOT_RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.OBSOLETE), - new Platform() - .withPlatformType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withVersionState(VersionState.PREVIEW) - .withMinimumPlatformSoftwareVersion("aokonzmnsik") - .withMaximumPlatformSoftwareVersion("kqze") - .withRecommendedVersion(RecommendedVersion.NOT_RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.OBSOLETE))), - new PacketCoreControlPlaneVersionInner() - .withPlatforms( - Arrays - .asList( - new Platform() - .withPlatformType(PlatformType.AKS_HCI) - .withVersionState(VersionState.VALIDATION_FAILED) - .withMinimumPlatformSoftwareVersion("akbogqxndlkzgxh") - .withMaximumPlatformSoftwareVersion("iplbpodxunkbebxm") - .withRecommendedVersion(RecommendedVersion.RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.NOT_OBSOLETE), - new Platform() - .withPlatformType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withVersionState(VersionState.DEPRECATED) - .withMinimumPlatformSoftwareVersion("qtkoievs") - .withMaximumPlatformSoftwareVersion("tgqr") - .withRecommendedVersion(RecommendedVersion.NOT_RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.OBSOLETE))), - new PacketCoreControlPlaneVersionInner() - .withPlatforms( - Arrays - .asList( - new Platform() - .withPlatformType(PlatformType.AKS_HCI) - .withVersionState(VersionState.PREVIEW) - .withMinimumPlatformSoftwareVersion("hjpglkf") - .withMaximumPlatformSoftwareVersion("hdneuelfph") - .withRecommendedVersion(RecommendedVersion.NOT_RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.OBSOLETE))))); - model = BinaryData.fromObject(model).toObject(PacketCoreControlPlaneVersionListResult.class); - Assertions - .assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.value().get(0).platforms().get(0).platformType()); - Assertions.assertEquals(VersionState.VALIDATING, model.value().get(0).platforms().get(0).versionState()); - Assertions - .assertEquals("oujmkcjhwqytj", model.value().get(0).platforms().get(0).minimumPlatformSoftwareVersion()); - Assertions.assertEquals("bnw", model.value().get(0).platforms().get(0).maximumPlatformSoftwareVersion()); - Assertions - .assertEquals( - RecommendedVersion.NOT_RECOMMENDED, model.value().get(0).platforms().get(0).recommendedVersion()); - Assertions - .assertEquals(ObsoleteVersion.NOT_OBSOLETE, model.value().get(0).platforms().get(0).obsoleteVersion()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionPropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionPropertiesFormatTests.java deleted file mode 100644 index 528247502edd..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionPropertiesFormatTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneVersionPropertiesFormat; -import com.azure.resourcemanager.mobilenetwork.models.ObsoleteVersion; -import com.azure.resourcemanager.mobilenetwork.models.Platform; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.RecommendedVersion; -import com.azure.resourcemanager.mobilenetwork.models.VersionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreControlPlaneVersionPropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreControlPlaneVersionPropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Canceled\",\"platforms\":[{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"Preview\",\"minimumPlatformSoftwareVersion\":\"vshqjohxcr\",\"maximumPlatformSoftwareVersion\":\"fovasr\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"Active\",\"minimumPlatformSoftwareVersion\":\"ubcgjbirxb\",\"maximumPlatformSoftwareVersion\":\"bsrfbj\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"Obsolete\"}]}") - .toObject(PacketCoreControlPlaneVersionPropertiesFormat.class); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.platforms().get(0).platformType()); - Assertions.assertEquals(VersionState.PREVIEW, model.platforms().get(0).versionState()); - Assertions.assertEquals("vshqjohxcr", model.platforms().get(0).minimumPlatformSoftwareVersion()); - Assertions.assertEquals("fovasr", model.platforms().get(0).maximumPlatformSoftwareVersion()); - Assertions.assertEquals(RecommendedVersion.RECOMMENDED, model.platforms().get(0).recommendedVersion()); - Assertions.assertEquals(ObsoleteVersion.NOT_OBSOLETE, model.platforms().get(0).obsoleteVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreControlPlaneVersionPropertiesFormat model = - new PacketCoreControlPlaneVersionPropertiesFormat() - .withPlatforms( - Arrays - .asList( - new Platform() - .withPlatformType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withVersionState(VersionState.PREVIEW) - .withMinimumPlatformSoftwareVersion("vshqjohxcr") - .withMaximumPlatformSoftwareVersion("fovasr") - .withRecommendedVersion(RecommendedVersion.RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.NOT_OBSOLETE), - new Platform() - .withPlatformType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withVersionState(VersionState.ACTIVE) - .withMinimumPlatformSoftwareVersion("ubcgjbirxb") - .withMaximumPlatformSoftwareVersion("bsrfbj") - .withRecommendedVersion(RecommendedVersion.RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.OBSOLETE))); - model = BinaryData.fromObject(model).toObject(PacketCoreControlPlaneVersionPropertiesFormat.class); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.platforms().get(0).platformType()); - Assertions.assertEquals(VersionState.PREVIEW, model.platforms().get(0).versionState()); - Assertions.assertEquals("vshqjohxcr", model.platforms().get(0).minimumPlatformSoftwareVersion()); - Assertions.assertEquals("fovasr", model.platforms().get(0).maximumPlatformSoftwareVersion()); - Assertions.assertEquals(RecommendedVersion.RECOMMENDED, model.platforms().get(0).recommendedVersion()); - Assertions.assertEquals(ObsoleteVersion.NOT_OBSOLETE, model.platforms().get(0).obsoleteVersion()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsGetBySubscriptionWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsGetBySubscriptionWithResponseMockTests.java deleted file mode 100644 index 71c0c9679513..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsGetBySubscriptionWithResponseMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.ObsoleteVersion; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneVersion; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.RecommendedVersion; -import com.azure.resourcemanager.mobilenetwork.models.VersionState; -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 PacketCoreControlPlaneVersionsGetBySubscriptionWithResponseMockTests { - @Test - public void testGetBySubscriptionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Unknown\",\"platforms\":[{\"platformType\":\"AKS-HCI\",\"versionState\":\"Preview\",\"minimumPlatformSoftwareVersion\":\"bukklels\",\"maximumPlatformSoftwareVersion\":\"blycsxzujksr\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"Obsolete\"},{\"platformType\":\"AKS-HCI\",\"versionState\":\"Deprecated\",\"minimumPlatformSoftwareVersion\":\"vmjcdoewb\",\"maximumPlatformSoftwareVersion\":\"yvteowxvgpiudeu\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"Obsolete\"}]},\"id\":\"ecpaxwkufyk\",\"name\":\"vuhx\",\"type\":\"pmru\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PacketCoreControlPlaneVersion response = - manager - .packetCoreControlPlaneVersions() - .getBySubscriptionWithResponse("eml", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PlatformType.AKS_HCI, response.platforms().get(0).platformType()); - Assertions.assertEquals(VersionState.PREVIEW, response.platforms().get(0).versionState()); - Assertions.assertEquals("bukklels", response.platforms().get(0).minimumPlatformSoftwareVersion()); - Assertions.assertEquals("blycsxzujksr", response.platforms().get(0).maximumPlatformSoftwareVersion()); - Assertions.assertEquals(RecommendedVersion.RECOMMENDED, response.platforms().get(0).recommendedVersion()); - Assertions.assertEquals(ObsoleteVersion.OBSOLETE, response.platforms().get(0).obsoleteVersion()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsGetWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsGetWithResponseMockTests.java deleted file mode 100644 index b95c07564314..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsGetWithResponseMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.ObsoleteVersion; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneVersion; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.RecommendedVersion; -import com.azure.resourcemanager.mobilenetwork.models.VersionState; -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 PacketCoreControlPlaneVersionsGetWithResponseMockTests { - @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\":{\"provisioningState\":\"Deleted\",\"platforms\":[{\"platformType\":\"AKS-HCI\",\"versionState\":\"Unknown\",\"minimumPlatformSoftwareVersion\":\"sinuqtljqobbpih\",\"maximumPlatformSoftwareVersion\":\"cecybmrqbrjbbmpx\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"Validating\",\"minimumPlatformSoftwareVersion\":\"rseqwjksghudgz\",\"maximumPlatformSoftwareVersion\":\"ogjggsvoujkxibda\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"Unknown\",\"minimumPlatformSoftwareVersion\":\"xfbvfb\",\"maximumPlatformSoftwareVersion\":\"y\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"Obsolete\"}]},\"id\":\"pgddeimawz\",\"name\":\"vgkk\",\"type\":\"muikjcjcaztbws\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PacketCoreControlPlaneVersion response = - manager - .packetCoreControlPlaneVersions() - .getWithResponse("qejo", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PlatformType.AKS_HCI, response.platforms().get(0).platformType()); - Assertions.assertEquals(VersionState.UNKNOWN, response.platforms().get(0).versionState()); - Assertions.assertEquals("sinuqtljqobbpih", response.platforms().get(0).minimumPlatformSoftwareVersion()); - Assertions.assertEquals("cecybmrqbrjbbmpx", response.platforms().get(0).maximumPlatformSoftwareVersion()); - Assertions.assertEquals(RecommendedVersion.NOT_RECOMMENDED, response.platforms().get(0).recommendedVersion()); - Assertions.assertEquals(ObsoleteVersion.NOT_OBSOLETE, response.platforms().get(0).obsoleteVersion()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsListBySubscriptionMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsListBySubscriptionMockTests.java deleted file mode 100644 index 0b2c9500bd57..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsListBySubscriptionMockTests.java +++ /dev/null @@ -1,86 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.ObsoleteVersion; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneVersion; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.RecommendedVersion; -import com.azure.resourcemanager.mobilenetwork.models.VersionState; -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 PacketCoreControlPlaneVersionsListBySubscriptionMockTests { - @Test - public void testListBySubscription() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"platforms\":[{\"platformType\":\"AKS-HCI\",\"versionState\":\"ValidationFailed\",\"minimumPlatformSoftwareVersion\":\"lujdjltymkmv\",\"maximumPlatformSoftwareVersion\":\"ihywartspph\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"ValidationFailed\",\"minimumPlatformSoftwareVersion\":\"j\",\"maximumPlatformSoftwareVersion\":\"mmuc\",\"recommendedVersion\":\"NotRecommended\",\"obsoleteVersion\":\"NotObsolete\"}]},\"id\":\"kflrmymy\",\"name\":\"nc\",\"type\":\"lhrisw\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.packetCoreControlPlaneVersions().listBySubscription(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PlatformType.AKS_HCI, response.iterator().next().platforms().get(0).platformType()); - Assertions - .assertEquals(VersionState.VALIDATION_FAILED, response.iterator().next().platforms().get(0).versionState()); - Assertions - .assertEquals( - "lujdjltymkmv", response.iterator().next().platforms().get(0).minimumPlatformSoftwareVersion()); - Assertions - .assertEquals( - "ihywartspph", response.iterator().next().platforms().get(0).maximumPlatformSoftwareVersion()); - Assertions - .assertEquals( - RecommendedVersion.NOT_RECOMMENDED, response.iterator().next().platforms().get(0).recommendedVersion()); - Assertions - .assertEquals( - ObsoleteVersion.NOT_OBSOLETE, response.iterator().next().platforms().get(0).obsoleteVersion()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsListMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsListMockTests.java deleted file mode 100644 index 7b04f4244980..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlaneVersionsListMockTests.java +++ /dev/null @@ -1,85 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.ObsoleteVersion; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneVersion; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.RecommendedVersion; -import com.azure.resourcemanager.mobilenetwork.models.VersionState; -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 PacketCoreControlPlaneVersionsListMockTests { - @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\":{\"provisioningState\":\"Failed\",\"platforms\":[{\"platformType\":\"AKS-HCI\",\"versionState\":\"Unknown\",\"minimumPlatformSoftwareVersion\":\"likytwvczcswka\",\"maximumPlatformSoftwareVersion\":\"ejyfdvlvhbwrnfx\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"NotObsolete\"},{\"platformType\":\"AKS-HCI\",\"versionState\":\"ValidationFailed\",\"minimumPlatformSoftwareVersion\":\"n\",\"maximumPlatformSoftwareVersion\":\"aoyankcoeqswa\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"NotObsolete\"}]},\"id\":\"tmhdroznnhdr\",\"name\":\"ktgj\",\"type\":\"sggux\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.packetCoreControlPlaneVersions().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PlatformType.AKS_HCI, response.iterator().next().platforms().get(0).platformType()); - Assertions.assertEquals(VersionState.UNKNOWN, response.iterator().next().platforms().get(0).versionState()); - Assertions - .assertEquals( - "likytwvczcswka", response.iterator().next().platforms().get(0).minimumPlatformSoftwareVersion()); - Assertions - .assertEquals( - "ejyfdvlvhbwrnfx", response.iterator().next().platforms().get(0).maximumPlatformSoftwareVersion()); - Assertions - .assertEquals( - RecommendedVersion.RECOMMENDED, response.iterator().next().platforms().get(0).recommendedVersion()); - Assertions - .assertEquals( - ObsoleteVersion.NOT_OBSOLETE, response.iterator().next().platforms().get(0).obsoleteVersion()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesCollectDiagnosticsPackageMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesCollectDiagnosticsPackageMockTests.java deleted file mode 100644 index 2f682d7a0520..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesCollectDiagnosticsPackageMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AsyncOperationStatus; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneCollectDiagnosticsPackage; -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 PacketCoreControlPlanesCollectDiagnosticsPackageMockTests { - @Test - public void testCollectDiagnosticsPackage() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"dsxwefoh\",\"name\":\"bvopwndyqle\",\"status\":\"llklmtk\",\"resourceId\":\"owkxxpv\",\"startTime\":\"2021-05-25T20:35:41Z\",\"endTime\":\"2021-03-26T11:09:49Z\",\"percentComplete\":57.798705970841546,\"properties\":\"datazfhotlh\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AsyncOperationStatus response = - manager - .packetCoreControlPlanes() - .collectDiagnosticsPackage( - "oafcluqvox", - "ycjimryvwgcwwpbm", - new PacketCoreControlPlaneCollectDiagnosticsPackage().withStorageAccountBlobUrl("gwe"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dsxwefoh", response.id()); - Assertions.assertEquals("bvopwndyqle", response.name()); - Assertions.assertEquals("llklmtk", response.status()); - Assertions.assertEquals("owkxxpv", response.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-25T20:35:41Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-26T11:09:49Z"), response.endTime()); - Assertions.assertEquals(57.798705970841546D, response.percentComplete()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesCreateOrUpdateMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesCreateOrUpdateMockTests.java deleted file mode 100644 index 0ebdcec6b3ae..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,158 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AuthenticationType; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackEdgeDeviceResourceId; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackHciClusterResourceId; -import com.azure.resourcemanager.mobilenetwork.models.BillingSku; -import com.azure.resourcemanager.mobilenetwork.models.ConnectedClusterResourceId; -import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; -import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; -import com.azure.resourcemanager.mobilenetwork.models.DesiredInstallationState; -import com.azure.resourcemanager.mobilenetwork.models.DiagnosticsUploadConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.HttpsServerCertificate; -import com.azure.resourcemanager.mobilenetwork.models.Installation; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import com.azure.resourcemanager.mobilenetwork.models.LocalDiagnosticsAccessConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentity; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlane; -import com.azure.resourcemanager.mobilenetwork.models.PlatformConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.SiteResourceId; -import com.azure.resourcemanager.mobilenetwork.models.UserAssignedIdentity; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -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 PacketCoreControlPlanesCreateOrUpdateMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"installation\":{\"desiredState\":\"Installed\",\"state\":\"Installed\",\"reinstallRequired\":\"NotRequired\",\"reasons\":[\"NoPacketCoreDataPlane\",\"NoAttachedDataNetworks\",\"NoPacketCoreDataPlane\"],\"operation\":{\"id\":\"ejikzoeovvtzejet\"}},\"sites\":[{\"id\":\"ln\"}],\"platform\":{\"type\":\"AKS-HCI\",\"azureStackEdgeDevice\":{\"id\":\"yjuzkdb\"},\"azureStackEdgeDevices\":[{\"id\":\"lxrzvhqjwtr\"}],\"azureStackHciCluster\":{\"id\":\"gv\"},\"connectedCluster\":{\"id\":\"pcrrk\"},\"customLocation\":{\"id\":\"awjmjsmw\"}},\"coreNetworkTechnology\":\"EPC" - + " + 5GC\",\"version\":\"dxfzzzwyjaf\",\"installedVersion\":\"lhguyn\",\"rollbackVersion\":\"hlgmltxdwhmoz\",\"controlPlaneAccessInterface\":{\"name\":\"gzvlnsnn\",\"ipv4Address\":\"fpafolpymwamxq\",\"ipv4Subnet\":\"agpgdph\",\"ipv4Gateway\":\"dulajvlejchcs\"},\"sku\":\"G1\",\"ueMtu\":1625370422,\"localDiagnosticsAccess\":{\"authenticationType\":\"AAD\",\"httpsServerCertificate\":{\"certificateUrl\":\"zlanrupdwvnph\",\"provisioning\":{\"state\":\"Failed\",\"reason\":\"pjhmqrhvthl\"}}},\"diagnosticsUpload\":{\"storageAccountContainerUrl\":\"wdcxsmlzzhz\"},\"interopSettings\":\"dataxetlgydlhqv\"},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"afiqgeaarbgjekg\":{\"principalId\":\"7def5a54-8429-4ec2-b3aa-f08ef5f5e2df\",\"clientId\":\"336a46ee-865e-4882-8093-9428867686b7\"},\"byu\":{\"principalId\":\"cb3da54b-1327-4cb2-b244-d95f50a752b7\",\"clientId\":\"0c501c4f-b9d2-4355-b2d6-f0f524c3862d\"},\"wcwvmzeg\":{\"principalId\":\"71267096-fe0d-4f74-94c9-ba0b8a7a17e3\",\"clientId\":\"30ad5056-200a-4725-854d-03eed0131e6b\"}}},\"location\":\"nfhjirwgdnqzbr\",\"tags\":{\"tk\":\"pzhz\",\"lkeuac\":\"jcitdigsxcdglj\",\"dgycxnmskwhqjjy\":\"tomflrytswfpf\"},\"id\":\"lurlpshhkvp\",\"name\":\"dwqslsrhmpqvw\",\"type\":\"skondcbrwimu\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PacketCoreControlPlane response = - manager - .packetCoreControlPlanes() - .define("rtws") - .withRegion("sfxsf") - .withExistingResourceGroup("cyychunsjlp") - .withSites(Arrays.asList(new SiteResourceId().withId("ocu"))) - .withPlatform( - new PlatformConfiguration() - .withType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withAzureStackEdgeDevice(new AzureStackEdgeDeviceResourceId().withId("whhmemhooc")) - .withAzureStackHciCluster(new AzureStackHciClusterResourceId().withId("ykyujxsg")) - .withConnectedCluster(new ConnectedClusterResourceId().withId("srrryejylmbkzu")) - .withCustomLocation(new CustomLocationResourceId().withId("igrfihotjewl"))) - .withControlPlaneAccessInterface( - new InterfaceProperties() - .withName("diw") - .withIpv4Address("rkwpzdqtvhcspod") - .withIpv4Subnet("axsipietgb") - .withIpv4Gateway("jfulbmoic")) - .withSku(BillingSku.G2) - .withLocalDiagnosticsAccess( - new LocalDiagnosticsAccessConfiguration() - .withAuthenticationType(AuthenticationType.PASSWORD) - .withHttpsServerCertificate(new HttpsServerCertificate().withCertificateUrl("pubntnbatz"))) - .withTags(mapOf("vagbwidqlvhukove", "lvt")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("ggcvk", new UserAssignedIdentity(), "izrzb", new UserAssignedIdentity()))) - .withInstallation(new Installation().withDesiredState(DesiredInstallationState.INSTALLED)) - .withCoreNetworkTechnology(CoreNetworkType.EPC_5GC) - .withVersion("zj") - .withUeMtu(1057950970) - .withDiagnosticsUpload(new DiagnosticsUploadConfiguration().withStorageAccountContainerUrl("attcju")) - .withInteropSettings("datalrvkmjc") - .create(); - - Assertions.assertEquals("nfhjirwgdnqzbr", response.location()); - Assertions.assertEquals("pzhz", response.tags().get("tk")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals(DesiredInstallationState.INSTALLED, response.installation().desiredState()); - Assertions.assertEquals("ln", response.sites().get(0).id()); - Assertions.assertEquals(PlatformType.AKS_HCI, response.platform().type()); - Assertions.assertEquals("yjuzkdb", response.platform().azureStackEdgeDevice().id()); - Assertions.assertEquals("gv", response.platform().azureStackHciCluster().id()); - Assertions.assertEquals("pcrrk", response.platform().connectedCluster().id()); - Assertions.assertEquals("awjmjsmw", response.platform().customLocation().id()); - Assertions.assertEquals(CoreNetworkType.EPC_5GC, response.coreNetworkTechnology()); - Assertions.assertEquals("dxfzzzwyjaf", response.version()); - Assertions.assertEquals("gzvlnsnn", response.controlPlaneAccessInterface().name()); - Assertions.assertEquals("fpafolpymwamxq", response.controlPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("agpgdph", response.controlPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("dulajvlejchcs", response.controlPlaneAccessInterface().ipv4Gateway()); - Assertions.assertEquals(BillingSku.G1, response.sku()); - Assertions.assertEquals(1625370422, response.ueMtu()); - Assertions.assertEquals(AuthenticationType.AAD, response.localDiagnosticsAccess().authenticationType()); - Assertions - .assertEquals("zlanrupdwvnph", response.localDiagnosticsAccess().httpsServerCertificate().certificateUrl()); - Assertions.assertEquals("wdcxsmlzzhz", response.diagnosticsUpload().storageAccountContainerUrl()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesDeleteMockTests.java deleted file mode 100644 index b7a189af3384..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 PacketCoreControlPlanesDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .packetCoreControlPlanes() - .delete("hfphwpnulaiywze", "ywhslwkojpllndnp", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesGetByResourceGroupWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index ddb64592932c..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,99 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AuthenticationType; -import com.azure.resourcemanager.mobilenetwork.models.BillingSku; -import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; -import com.azure.resourcemanager.mobilenetwork.models.DesiredInstallationState; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlane; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -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 PacketCoreControlPlanesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Accepted\",\"installation\":{\"desiredState\":\"Installed\",\"state\":\"Failed\",\"reinstallRequired\":\"Required\",\"reasons\":[\"NoAttachedDataNetworks\",\"NoPacketCoreDataPlane\"],\"operation\":{\"id\":\"uyturml\"}},\"sites\":[{\"id\":\"owolbaui\"},{\"id\":\"opionszon\"},{\"id\":\"pngajin\"},{\"id\":\"ixjawrtm\"}],\"platform\":{\"type\":\"3P-AZURE-STACK-HCI\",\"azureStackEdgeDevice\":{\"id\":\"myccx\"},\"azureStackEdgeDevices\":[{\"id\":\"coxovn\"},{\"id\":\"khenlus\"}],\"azureStackHciCluster\":{\"id\":\"rd\"},\"connectedCluster\":{\"id\":\"xtxrdcqtjvidt\"},\"customLocation\":{\"id\":\"epu\"}},\"coreNetworkTechnology\":\"EPC" - + " + 5GC\",\"version\":\"jtcvuwkasizies\",\"installedVersion\":\"ughtuqfecjxeygtu\",\"rollbackVersion\":\"uicbuewmrsw\",\"controlPlaneAccessInterface\":{\"name\":\"lx\",\"ipv4Address\":\"rhwpus\",\"ipv4Subnet\":\"baqehgpdoh\",\"ipv4Gateway\":\"qatucoigebxnc\"},\"sku\":\"G0\",\"ueMtu\":2085427407,\"localDiagnosticsAccess\":{\"authenticationType\":\"Password\",\"httpsServerCertificate\":{\"certificateUrl\":\"nwgfmxjgcgbjbgd\",\"provisioning\":{\"state\":\"NotProvisioned\",\"reason\":\"y\"}}},\"diagnosticsUpload\":{\"storageAccountContainerUrl\":\"aquflqbctqha\"},\"interopSettings\":\"datajrwdkqz\"},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"iunjxdf\":{\"principalId\":\"24a67c67-bbcf-4ede-838b-b72d25c27820\",\"clientId\":\"8de5edc7-861a-4518-8490-7c04dd52b0b8\"},\"tkw\":{\"principalId\":\"be96138f-c134-4c5e-90fe-63b29dee5f75\",\"clientId\":\"dafc2419-3ac3-4a72-a4ba-89c36f1f0146\"},\"yamlbnse\":{\"principalId\":\"d61399b6-2903-417c-aaa3-1a0b06e4de6b\",\"clientId\":\"26cc3188-425c-4ba8-8f5c-661a9b381f1e\"},\"jjvpilguooqja\":{\"principalId\":\"b948bdf0-43fa-47a2-8133-b98e72b82b20\",\"clientId\":\"8b92a50d-181f-4f07-a511-a93b5e8c57af\"}}},\"location\":\"d\",\"tags\":{\"kjbsah\":\"ueio\",\"oebn\":\"tdtpdelqacslmo\",\"dirazf\":\"xofvcjk\",\"bmdujtmvcopexc\":\"xejw\"},\"id\":\"jurbuhhlkyqltqsr\",\"name\":\"gtuwkff\",\"type\":\"jk\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PacketCoreControlPlane response = - manager - .packetCoreControlPlanes() - .getByResourceGroupWithResponse("wrpqafgfugsnnf", "yetefyp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("d", response.location()); - Assertions.assertEquals("ueio", response.tags().get("kjbsah")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals(DesiredInstallationState.INSTALLED, response.installation().desiredState()); - Assertions.assertEquals("owolbaui", response.sites().get(0).id()); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, response.platform().type()); - Assertions.assertEquals("myccx", response.platform().azureStackEdgeDevice().id()); - Assertions.assertEquals("rd", response.platform().azureStackHciCluster().id()); - Assertions.assertEquals("xtxrdcqtjvidt", response.platform().connectedCluster().id()); - Assertions.assertEquals("epu", response.platform().customLocation().id()); - Assertions.assertEquals(CoreNetworkType.EPC_5GC, response.coreNetworkTechnology()); - Assertions.assertEquals("jtcvuwkasizies", response.version()); - Assertions.assertEquals("lx", response.controlPlaneAccessInterface().name()); - Assertions.assertEquals("rhwpus", response.controlPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("baqehgpdoh", response.controlPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("qatucoigebxnc", response.controlPlaneAccessInterface().ipv4Gateway()); - Assertions.assertEquals(BillingSku.G0, response.sku()); - Assertions.assertEquals(2085427407, response.ueMtu()); - Assertions.assertEquals(AuthenticationType.PASSWORD, response.localDiagnosticsAccess().authenticationType()); - Assertions - .assertEquals( - "nwgfmxjgcgbjbgd", response.localDiagnosticsAccess().httpsServerCertificate().certificateUrl()); - Assertions.assertEquals("aquflqbctqha", response.diagnosticsUpload().storageAccountContainerUrl()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListByResourceGroupMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListByResourceGroupMockTests.java deleted file mode 100644 index 6ea8b090d4fd..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListByResourceGroupMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AuthenticationType; -import com.azure.resourcemanager.mobilenetwork.models.BillingSku; -import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; -import com.azure.resourcemanager.mobilenetwork.models.DesiredInstallationState; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlane; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -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 PacketCoreControlPlanesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"installation\":{\"desiredState\":\"Uninstalled\",\"state\":\"Uninstalling\",\"reinstallRequired\":\"Required\",\"reasons\":[\"NoPacketCoreDataPlane\"],\"operation\":{\"id\":\"dxxewuninv\"}},\"sites\":[{\"id\":\"bchaqd\"}],\"platform\":{\"type\":\"AKS-HCI\",\"azureStackEdgeDevice\":{\"id\":\"ec\"},\"azureStackEdgeDevices\":[{\"id\":\"tmxxdtddmflhuy\"}],\"azureStackHciCluster\":{\"id\":\"zv\"},\"connectedCluster\":{\"id\":\"napxbannovv\"},\"customLocation\":{\"id\":\"czytprwn\"}},\"coreNetworkTechnology\":\"EPC" - + " + 5GC\",\"version\":\"ev\",\"installedVersion\":\"lyokrrrou\",\"rollbackVersion\":\"vnsasbcrymodi\",\"controlPlaneAccessInterface\":{\"name\":\"xkl\",\"ipv4Address\":\"d\",\"ipv4Subnet\":\"azpmkmlmv\",\"ipv4Gateway\":\"f\"},\"sku\":\"G5\",\"ueMtu\":496692380,\"localDiagnosticsAccess\":{\"authenticationType\":\"Password\",\"httpsServerCertificate\":{\"certificateUrl\":\"bzxliohrdddtfgxq\",\"provisioning\":{\"state\":\"Failed\",\"reason\":\"bbnz\"}}},\"diagnosticsUpload\":{\"storageAccountContainerUrl\":\"yknapqofyuicdh\"},\"interopSettings\":\"datadyb\"},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"bid\":{\"principalId\":\"26f5e9bb-45c3-4469-ab27-122fdb380b08\",\"clientId\":\"ccd04423-1e1a-46ab-a125-a66f34c07da0\"}}},\"location\":\"m\",\"tags\":{\"yoxoy\":\"plfmuvapckccrrvw\"},\"id\":\"ukphaimmoiroq\",\"name\":\"oshbragapyy\",\"type\":\"mfsvbpav\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.packetCoreControlPlanes().listByResourceGroup("lcqxypokk", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("m", response.iterator().next().location()); - Assertions.assertEquals("plfmuvapckccrrvw", response.iterator().next().tags().get("yoxoy")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions - .assertEquals( - DesiredInstallationState.UNINSTALLED, response.iterator().next().installation().desiredState()); - Assertions.assertEquals("bchaqd", response.iterator().next().sites().get(0).id()); - Assertions.assertEquals(PlatformType.AKS_HCI, response.iterator().next().platform().type()); - Assertions.assertEquals("ec", response.iterator().next().platform().azureStackEdgeDevice().id()); - Assertions.assertEquals("zv", response.iterator().next().platform().azureStackHciCluster().id()); - Assertions.assertEquals("napxbannovv", response.iterator().next().platform().connectedCluster().id()); - Assertions.assertEquals("czytprwn", response.iterator().next().platform().customLocation().id()); - Assertions.assertEquals(CoreNetworkType.EPC_5GC, response.iterator().next().coreNetworkTechnology()); - Assertions.assertEquals("ev", response.iterator().next().version()); - Assertions.assertEquals("xkl", response.iterator().next().controlPlaneAccessInterface().name()); - Assertions.assertEquals("d", response.iterator().next().controlPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("azpmkmlmv", response.iterator().next().controlPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("f", response.iterator().next().controlPlaneAccessInterface().ipv4Gateway()); - Assertions.assertEquals(BillingSku.G5, response.iterator().next().sku()); - Assertions.assertEquals(496692380, response.iterator().next().ueMtu()); - Assertions - .assertEquals( - AuthenticationType.PASSWORD, response.iterator().next().localDiagnosticsAccess().authenticationType()); - Assertions - .assertEquals( - "bzxliohrdddtfgxq", - response.iterator().next().localDiagnosticsAccess().httpsServerCertificate().certificateUrl()); - Assertions - .assertEquals( - "yknapqofyuicdh", response.iterator().next().diagnosticsUpload().storageAccountContainerUrl()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListMockTests.java deleted file mode 100644 index 379ff698de74..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListMockTests.java +++ /dev/null @@ -1,101 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AuthenticationType; -import com.azure.resourcemanager.mobilenetwork.models.BillingSku; -import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; -import com.azure.resourcemanager.mobilenetwork.models.DesiredInstallationState; -import com.azure.resourcemanager.mobilenetwork.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlane; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -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 PacketCoreControlPlanesListMockTests { - @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\":{\"provisioningState\":\"Canceled\",\"installation\":{\"desiredState\":\"Installed\",\"state\":\"Reinstalling\",\"reinstallRequired\":\"Required\",\"reasons\":[\"NoSlices\",\"NoPacketCoreDataPlane\",\"NoPacketCoreDataPlane\",\"NoAttachedDataNetworks\"],\"operation\":{\"id\":\"jtkbusqogsfika\"}},\"sites\":[{\"id\":\"ansharujtjiqxfz\"}],\"platform\":{\"type\":\"AKS-HCI\",\"azureStackEdgeDevice\":{\"id\":\"ttvwkpqh\"},\"azureStackEdgeDevices\":[{\"id\":\"nuygbqeqqekewvnq\"},{\"id\":\"cdlguauc\"}],\"azureStackHciCluster\":{\"id\":\"djwnlaxpunjqi\"},\"connectedCluster\":{\"id\":\"zvvitacgxmfcs\"},\"customLocation\":{\"id\":\"rxhtvso\"}},\"coreNetworkTechnology\":\"5GC\",\"version\":\"ntsj\",\"installedVersion\":\"rsxypruuu\",\"rollbackVersion\":\"nchrszizoyu\",\"controlPlaneAccessInterface\":{\"name\":\"yetnd\",\"ipv4Address\":\"fqyggagflnlgmtr\",\"ipv4Subnet\":\"hzjmucftbyrp\",\"ipv4Gateway\":\"ohkpigqfu\"},\"sku\":\"G0\",\"ueMtu\":1931491413,\"localDiagnosticsAccess\":{\"authenticationType\":\"AAD\",\"httpsServerCertificate\":{\"certificateUrl\":\"kwklsnoxaxmq\",\"provisioning\":{\"state\":\"NotProvisioned\",\"reason\":\"hjnhgwydyynfsvk\"}}},\"diagnosticsUpload\":{\"storageAccountContainerUrl\":\"bvqt\"},\"interopSettings\":\"dataarfdlpukhpyrnei\"},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"khnmgbrou\":{\"principalId\":\"86ce3af5-1108-4980-bcc6-96888e4e62c0\",\"clientId\":\"42b8a20b-203f-463e-9bf6-bc0617261a75\"},\"bhfhpfpazjzoy\":{\"principalId\":\"008c79cf-fa53-4a1d-a01e-887a59156594\",\"clientId\":\"c72190d2-6107-4e7a-9160-8096ee2d9525\"},\"hpdulon\":{\"principalId\":\"61effec2-2432-4161-aca7-fbdf214ed29e\",\"clientId\":\"43fb8f75-27f0-43ad-816b-4e26d58b5223\"}}},\"location\":\"cnpqwteht\",\"tags\":{\"duugwbsre\":\"rhrljyoogwxhn\"},\"id\":\"rfqkfuar\",\"name\":\"nlvhhtklnvnafvv\",\"type\":\"yfedevjbo\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.packetCoreControlPlanes().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cnpqwteht", response.iterator().next().location()); - Assertions.assertEquals("rhrljyoogwxhn", response.iterator().next().tags().get("duugwbsre")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions - .assertEquals(DesiredInstallationState.INSTALLED, response.iterator().next().installation().desiredState()); - Assertions.assertEquals("ansharujtjiqxfz", response.iterator().next().sites().get(0).id()); - Assertions.assertEquals(PlatformType.AKS_HCI, response.iterator().next().platform().type()); - Assertions.assertEquals("ttvwkpqh", response.iterator().next().platform().azureStackEdgeDevice().id()); - Assertions.assertEquals("djwnlaxpunjqi", response.iterator().next().platform().azureStackHciCluster().id()); - Assertions.assertEquals("zvvitacgxmfcs", response.iterator().next().platform().connectedCluster().id()); - Assertions.assertEquals("rxhtvso", response.iterator().next().platform().customLocation().id()); - Assertions.assertEquals(CoreNetworkType.FIVE_GC, response.iterator().next().coreNetworkTechnology()); - Assertions.assertEquals("ntsj", response.iterator().next().version()); - Assertions.assertEquals("yetnd", response.iterator().next().controlPlaneAccessInterface().name()); - Assertions - .assertEquals("fqyggagflnlgmtr", response.iterator().next().controlPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("hzjmucftbyrp", response.iterator().next().controlPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("ohkpigqfu", response.iterator().next().controlPlaneAccessInterface().ipv4Gateway()); - Assertions.assertEquals(BillingSku.G0, response.iterator().next().sku()); - Assertions.assertEquals(1931491413, response.iterator().next().ueMtu()); - Assertions - .assertEquals( - AuthenticationType.AAD, response.iterator().next().localDiagnosticsAccess().authenticationType()); - Assertions - .assertEquals( - "kwklsnoxaxmq", - response.iterator().next().localDiagnosticsAccess().httpsServerCertificate().certificateUrl()); - Assertions.assertEquals("bvqt", response.iterator().next().diagnosticsUpload().storageAccountContainerUrl()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesReinstallMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesReinstallMockTests.java deleted file mode 100644 index 0c5c93cb48dc..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesReinstallMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AsyncOperationStatus; -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 PacketCoreControlPlanesReinstallMockTests { - @Test - public void testReinstall() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"ldpuviy\",\"name\":\"aabeolhbhlvbmxuq\",\"status\":\"bsxtkcudfbsfarfs\",\"resourceId\":\"wlkjxn\",\"startTime\":\"2021-11-12T06:14:41Z\",\"endTime\":\"2021-09-14T22:57:22Z\",\"percentComplete\":68.21263647311004,\"properties\":\"datahqykizmdk\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AsyncOperationStatus response = - manager.packetCoreControlPlanes().reinstall("ri", "krsrrmoucs", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ldpuviy", response.id()); - Assertions.assertEquals("aabeolhbhlvbmxuq", response.name()); - Assertions.assertEquals("bsxtkcudfbsfarfs", response.status()); - Assertions.assertEquals("wlkjxn", response.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-12T06:14:41Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T22:57:22Z"), response.endTime()); - Assertions.assertEquals(68.21263647311004D, response.percentComplete()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesRollbackMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesRollbackMockTests.java deleted file mode 100644 index ed31ff4f7a34..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesRollbackMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AsyncOperationStatus; -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 PacketCoreControlPlanesRollbackMockTests { - @Test - public void testRollback() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"caac\",\"name\":\"mmcpug\",\"status\":\"ehqepvufhbzehe\",\"resourceId\":\"oqhnlb\",\"startTime\":\"2021-03-31T09:47:51Z\",\"endTime\":\"2021-10-25T15:47:49Z\",\"percentComplete\":80.14092848799747,\"properties\":\"datalgsc\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AsyncOperationStatus response = - manager.packetCoreControlPlanes().rollback("opfppdbwnupgah", "kuma", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("caac", response.id()); - Assertions.assertEquals("mmcpug", response.name()); - Assertions.assertEquals("ehqepvufhbzehe", response.status()); - Assertions.assertEquals("oqhnlb", response.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-31T09:47:51Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-25T15:47:49Z"), response.endTime()); - Assertions.assertEquals(80.14092848799747D, response.percentComplete()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlaneInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlaneInnerTests.java deleted file mode 100644 index 33061de32348..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlaneInnerTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreDataPlaneInner; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreDataPlaneInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreDataPlaneInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Unknown\",\"userPlaneAccessInterface\":{\"name\":\"dsjnka\",\"ipv4Address\":\"utiiswacf\",\"ipv4Subnet\":\"dkzzewkfvhqcrail\",\"ipv4Gateway\":\"n\"}},\"location\":\"fuflrwdmhdlx\",\"tags\":{\"cnihgwqapnedgfbc\":\"xsaga\",\"dcvd\":\"kcvqvpke\",\"pcjwv\":\"hvoodsotbobzd\",\"mutwuoe\":\"hdldwmgxcxrsl\"},\"id\":\"rpkhjwn\",\"name\":\"yqsluic\",\"type\":\"dggkzzlvmbmpa\"}") - .toObject(PacketCoreDataPlaneInner.class); - Assertions.assertEquals("fuflrwdmhdlx", model.location()); - Assertions.assertEquals("xsaga", model.tags().get("cnihgwqapnedgfbc")); - Assertions.assertEquals("dsjnka", model.userPlaneAccessInterface().name()); - Assertions.assertEquals("utiiswacf", model.userPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("dkzzewkfvhqcrail", model.userPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("n", model.userPlaneAccessInterface().ipv4Gateway()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreDataPlaneInner model = - new PacketCoreDataPlaneInner() - .withLocation("fuflrwdmhdlx") - .withTags( - mapOf( - "cnihgwqapnedgfbc", - "xsaga", - "dcvd", - "kcvqvpke", - "pcjwv", - "hvoodsotbobzd", - "mutwuoe", - "hdldwmgxcxrsl")) - .withUserPlaneAccessInterface( - new InterfaceProperties() - .withName("dsjnka") - .withIpv4Address("utiiswacf") - .withIpv4Subnet("dkzzewkfvhqcrail") - .withIpv4Gateway("n")); - model = BinaryData.fromObject(model).toObject(PacketCoreDataPlaneInner.class); - Assertions.assertEquals("fuflrwdmhdlx", model.location()); - Assertions.assertEquals("xsaga", model.tags().get("cnihgwqapnedgfbc")); - Assertions.assertEquals("dsjnka", model.userPlaneAccessInterface().name()); - Assertions.assertEquals("utiiswacf", model.userPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("dkzzewkfvhqcrail", model.userPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("n", model.userPlaneAccessInterface().ipv4Gateway()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlaneListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlaneListResultTests.java deleted file mode 100644 index 5b6056809d1e..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlaneListResultTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreDataPlaneInner; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlaneListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreDataPlaneListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreDataPlaneListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"userPlaneAccessInterface\":{\"name\":\"cpwi\",\"ipv4Address\":\"vqtmnub\",\"ipv4Subnet\":\"kpzksmondjmq\",\"ipv4Gateway\":\"vypomgkopkwho\"}},\"location\":\"pajqgxysm\",\"tags\":{\"qvmkcxo\":\"bq\",\"tddckcb\":\"apvhelxprgly\"},\"id\":\"uejrjxgc\",\"name\":\"qibrhosxsdqrhzoy\",\"type\":\"i\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"userPlaneAccessInterface\":{\"name\":\"yiba\",\"ipv4Address\":\"fluszdtm\",\"ipv4Subnet\":\"kwofyyvoq\",\"ipv4Gateway\":\"piexpbtgiw\"}},\"location\":\"oenwashr\",\"tags\":{\"ulpiuj\":\"kcnqxwbpo\",\"obyu\":\"aasipqi\"},\"id\":\"erpqlpqwcciuqg\",\"name\":\"dbutauvfbtkuwhh\",\"type\":\"hykojoxafnndlpic\"}],\"nextLink\":\"o\"}") - .toObject(PacketCoreDataPlaneListResult.class); - Assertions.assertEquals("pajqgxysm", model.value().get(0).location()); - Assertions.assertEquals("bq", model.value().get(0).tags().get("qvmkcxo")); - Assertions.assertEquals("cpwi", model.value().get(0).userPlaneAccessInterface().name()); - Assertions.assertEquals("vqtmnub", model.value().get(0).userPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("kpzksmondjmq", model.value().get(0).userPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("vypomgkopkwho", model.value().get(0).userPlaneAccessInterface().ipv4Gateway()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreDataPlaneListResult model = - new PacketCoreDataPlaneListResult() - .withValue( - Arrays - .asList( - new PacketCoreDataPlaneInner() - .withLocation("pajqgxysm") - .withTags(mapOf("qvmkcxo", "bq", "tddckcb", "apvhelxprgly")) - .withUserPlaneAccessInterface( - new InterfaceProperties() - .withName("cpwi") - .withIpv4Address("vqtmnub") - .withIpv4Subnet("kpzksmondjmq") - .withIpv4Gateway("vypomgkopkwho")), - new PacketCoreDataPlaneInner() - .withLocation("oenwashr") - .withTags(mapOf("ulpiuj", "kcnqxwbpo", "obyu", "aasipqi")) - .withUserPlaneAccessInterface( - new InterfaceProperties() - .withName("yiba") - .withIpv4Address("fluszdtm") - .withIpv4Subnet("kwofyyvoq") - .withIpv4Gateway("piexpbtgiw")))); - model = BinaryData.fromObject(model).toObject(PacketCoreDataPlaneListResult.class); - Assertions.assertEquals("pajqgxysm", model.value().get(0).location()); - Assertions.assertEquals("bq", model.value().get(0).tags().get("qvmkcxo")); - Assertions.assertEquals("cpwi", model.value().get(0).userPlaneAccessInterface().name()); - Assertions.assertEquals("vqtmnub", model.value().get(0).userPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("kpzksmondjmq", model.value().get(0).userPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("vypomgkopkwho", model.value().get(0).userPlaneAccessInterface().ipv4Gateway()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanePropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanePropertiesFormatTests.java deleted file mode 100644 index a87e970af68d..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanePropertiesFormatTests.java +++ /dev/null @@ -1,42 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreDataPlanePropertiesFormat; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import org.junit.jupiter.api.Assertions; - -public final class PacketCoreDataPlanePropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PacketCoreDataPlanePropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Deleted\",\"userPlaneAccessInterface\":{\"name\":\"fv\",\"ipv4Address\":\"fy\",\"ipv4Subnet\":\"bpfvm\",\"ipv4Gateway\":\"hrfou\"}}") - .toObject(PacketCoreDataPlanePropertiesFormat.class); - Assertions.assertEquals("fv", model.userPlaneAccessInterface().name()); - Assertions.assertEquals("fy", model.userPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("bpfvm", model.userPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("hrfou", model.userPlaneAccessInterface().ipv4Gateway()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PacketCoreDataPlanePropertiesFormat model = - new PacketCoreDataPlanePropertiesFormat() - .withUserPlaneAccessInterface( - new InterfaceProperties() - .withName("fv") - .withIpv4Address("fy") - .withIpv4Subnet("bpfvm") - .withIpv4Gateway("hrfou")); - model = BinaryData.fromObject(model).toObject(PacketCoreDataPlanePropertiesFormat.class); - Assertions.assertEquals("fv", model.userPlaneAccessInterface().name()); - Assertions.assertEquals("fy", model.userPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("bpfvm", model.userPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("hrfou", model.userPlaneAccessInterface().ipv4Gateway()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesCreateOrUpdateMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesCreateOrUpdateMockTests.java deleted file mode 100644 index 2259783c83aa..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,98 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlane; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -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 PacketCoreDataPlanesCreateOrUpdateMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"userPlaneAccessInterface\":{\"name\":\"qagnepzwakl\",\"ipv4Address\":\"sbq\",\"ipv4Subnet\":\"agwwrxaom\",\"ipv4Gateway\":\"sgl\"}},\"location\":\"czezkhhlt\",\"tags\":{\"oyueayfbpcmsp\":\"dhqoawj\",\"mg\":\"byrrueqth\"},\"id\":\"mbscbbx\",\"name\":\"gdhxi\",\"type\":\"d\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PacketCoreDataPlane response = - manager - .packetCoreDataPlanes() - .define("ypobkdqzr") - .withRegion("nbkkjanurnnq") - .withExistingPacketCoreControlPlane("wmkoisq", "ssffxuifmc") - .withUserPlaneAccessInterface( - new InterfaceProperties() - .withName("lo") - .withIpv4Address("gtrczzydmxzjijpv") - .withIpv4Subnet("urkihci") - .withIpv4Gateway("defxrdc")) - .withTags(mapOf("ogypxrxvbfihwu", "bpizxqltgr")) - .create(); - - Assertions.assertEquals("czezkhhlt", response.location()); - Assertions.assertEquals("dhqoawj", response.tags().get("oyueayfbpcmsp")); - Assertions.assertEquals("qagnepzwakl", response.userPlaneAccessInterface().name()); - Assertions.assertEquals("sbq", response.userPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("agwwrxaom", response.userPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("sgl", response.userPlaneAccessInterface().ipv4Gateway()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesDeleteMockTests.java deleted file mode 100644 index 8373dd751405..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 PacketCoreDataPlanesDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .packetCoreDataPlanes() - .delete("lmiiiovg", "cgxuugqkctotiowl", "teqdptj", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesGetWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesGetWithResponseMockTests.java deleted file mode 100644 index abc8ba266627..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesGetWithResponseMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlane; -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 PacketCoreDataPlanesGetWithResponseMockTests { - @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\":{\"provisioningState\":\"Failed\",\"userPlaneAccessInterface\":{\"name\":\"ypivlsbb\",\"ipv4Address\":\"mcub\",\"ipv4Subnet\":\"ifoxxkubvphav\",\"ipv4Gateway\":\"h\"}},\"location\":\"bqgvgovpbbtte\",\"tags\":{\"kdfrdbiqmrjgeihf\":\"knssqyzqed\",\"wfiwzcxmj\":\"lg\",\"ljvrcmyfqipgxhnp\":\"byephmgt\",\"nuilee\":\"myqwcab\"},\"id\":\"aswlp\",\"name\":\"ugmrmf\",\"type\":\"lrxw\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PacketCoreDataPlane response = - manager - .packetCoreDataPlanes() - .getWithResponse( - "wdtgukranblw", "hqlkccuzgygqwaho", "ulwgniiprglvawuw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bqgvgovpbbtte", response.location()); - Assertions.assertEquals("knssqyzqed", response.tags().get("kdfrdbiqmrjgeihf")); - Assertions.assertEquals("ypivlsbb", response.userPlaneAccessInterface().name()); - Assertions.assertEquals("mcub", response.userPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("ifoxxkubvphav", response.userPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("h", response.userPlaneAccessInterface().ipv4Gateway()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesListByPacketCoreControlPlaneMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesListByPacketCoreControlPlaneMockTests.java deleted file mode 100644 index 6cec9c622d88..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesListByPacketCoreControlPlaneMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlane; -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 PacketCoreDataPlanesListByPacketCoreControlPlaneMockTests { - @Test - public void testListByPacketCoreControlPlane() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"userPlaneAccessInterface\":{\"name\":\"eds\",\"ipv4Address\":\"wuived\",\"ipv4Subnet\":\"gyeewxeiq\",\"ipv4Gateway\":\"smgomguaml\"}},\"location\":\"l\",\"tags\":{\"fcshh\":\"splzga\",\"nxkympqanxrjk\":\"new\",\"ypnyghshxc\":\"xtwbta\",\"ycphdrwjjkhvyo\":\"lhkgmnsghp\"},\"id\":\"ac\",\"name\":\"u\",\"type\":\"vxnqmhrpqpd\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .packetCoreDataPlanes() - .listByPacketCoreControlPlane("oauk", "fkvcisi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("l", response.iterator().next().location()); - Assertions.assertEquals("splzga", response.iterator().next().tags().get("fcshh")); - Assertions.assertEquals("eds", response.iterator().next().userPlaneAccessInterface().name()); - Assertions.assertEquals("wuived", response.iterator().next().userPlaneAccessInterface().ipv4Address()); - Assertions.assertEquals("gyeewxeiq", response.iterator().next().userPlaneAccessInterface().ipv4Subnet()); - Assertions.assertEquals("smgomguaml", response.iterator().next().userPlaneAccessInterface().ipv4Gateway()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PccRuleConfigurationTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PccRuleConfigurationTests.java deleted file mode 100644 index d3034886b53e..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PccRuleConfigurationTests.java +++ /dev/null @@ -1,87 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleQosPolicy; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.SdfDirection; -import com.azure.resourcemanager.mobilenetwork.models.ServiceDataFlowTemplate; -import com.azure.resourcemanager.mobilenetwork.models.TrafficControlPermission; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PccRuleConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PccRuleConfiguration model = - BinaryData - .fromString( - "{\"ruleName\":\"gitvg\",\"rulePrecedence\":1795332478,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"ixkwmyijejveg\",\"downlink\":\"hbpnaixexccbd\"},\"5qi\":303838192,\"allocationAndRetentionPriorityLevel\":393468474,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"maximumBitRate\":{\"uplink\":\"rrvqa\",\"downlink\":\"qkghtpwijnhy\"}},\"trafficControl\":\"Enabled\",\"serviceDataFlowTemplates\":[{\"templateName\":\"ycxzbfvoo\",\"direction\":\"Bidirectional\",\"protocol\":[\"vmtgjqppy\",\"s\"],\"remoteIpList\":[\"on\",\"myhgfipnsxkmc\",\"a\"],\"ports\":[\"rjreafxts\",\"umh\",\"glikkxwslolb\"]}]}") - .toObject(PccRuleConfiguration.class); - Assertions.assertEquals("gitvg", model.ruleName()); - Assertions.assertEquals(1795332478, model.rulePrecedence()); - Assertions.assertEquals(303838192, model.ruleQosPolicy().fiveQi()); - Assertions.assertEquals(393468474, model.ruleQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.MAY_PREEMPT, model.ruleQosPolicy().preemptionCapability()); - Assertions.assertEquals(PreemptionVulnerability.PREEMPTABLE, model.ruleQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("rrvqa", model.ruleQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("qkghtpwijnhy", model.ruleQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("ixkwmyijejveg", model.ruleQosPolicy().guaranteedBitRate().uplink()); - Assertions.assertEquals("hbpnaixexccbd", model.ruleQosPolicy().guaranteedBitRate().downlink()); - Assertions.assertEquals(TrafficControlPermission.ENABLED, model.trafficControl()); - Assertions.assertEquals("ycxzbfvoo", model.serviceDataFlowTemplates().get(0).templateName()); - Assertions.assertEquals(SdfDirection.BIDIRECTIONAL, model.serviceDataFlowTemplates().get(0).direction()); - Assertions.assertEquals("vmtgjqppy", model.serviceDataFlowTemplates().get(0).protocol().get(0)); - Assertions.assertEquals("on", model.serviceDataFlowTemplates().get(0).remoteIpList().get(0)); - Assertions.assertEquals("rjreafxts", model.serviceDataFlowTemplates().get(0).ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PccRuleConfiguration model = - new PccRuleConfiguration() - .withRuleName("gitvg") - .withRulePrecedence(1795332478) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withFiveQi(303838192) - .withAllocationAndRetentionPriorityLevel(393468474) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withMaximumBitRate(new Ambr().withUplink("rrvqa").withDownlink("qkghtpwijnhy")) - .withGuaranteedBitRate(new Ambr().withUplink("ixkwmyijejveg").withDownlink("hbpnaixexccbd"))) - .withTrafficControl(TrafficControlPermission.ENABLED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("ycxzbfvoo") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList("vmtgjqppy", "s")) - .withRemoteIpList(Arrays.asList("on", "myhgfipnsxkmc", "a")) - .withPorts(Arrays.asList("rjreafxts", "umh", "glikkxwslolb")))); - model = BinaryData.fromObject(model).toObject(PccRuleConfiguration.class); - Assertions.assertEquals("gitvg", model.ruleName()); - Assertions.assertEquals(1795332478, model.rulePrecedence()); - Assertions.assertEquals(303838192, model.ruleQosPolicy().fiveQi()); - Assertions.assertEquals(393468474, model.ruleQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.MAY_PREEMPT, model.ruleQosPolicy().preemptionCapability()); - Assertions.assertEquals(PreemptionVulnerability.PREEMPTABLE, model.ruleQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("rrvqa", model.ruleQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("qkghtpwijnhy", model.ruleQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("ixkwmyijejveg", model.ruleQosPolicy().guaranteedBitRate().uplink()); - Assertions.assertEquals("hbpnaixexccbd", model.ruleQosPolicy().guaranteedBitRate().downlink()); - Assertions.assertEquals(TrafficControlPermission.ENABLED, model.trafficControl()); - Assertions.assertEquals("ycxzbfvoo", model.serviceDataFlowTemplates().get(0).templateName()); - Assertions.assertEquals(SdfDirection.BIDIRECTIONAL, model.serviceDataFlowTemplates().get(0).direction()); - Assertions.assertEquals("vmtgjqppy", model.serviceDataFlowTemplates().get(0).protocol().get(0)); - Assertions.assertEquals("on", model.serviceDataFlowTemplates().get(0).remoteIpList().get(0)); - Assertions.assertEquals("rjreafxts", model.serviceDataFlowTemplates().get(0).ports().get(0)); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PccRuleQosPolicyTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PccRuleQosPolicyTests.java deleted file mode 100644 index 5323a756d189..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PccRuleQosPolicyTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleQosPolicy; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import org.junit.jupiter.api.Assertions; - -public final class PccRuleQosPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PccRuleQosPolicy model = - BinaryData - .fromString( - "{\"guaranteedBitRate\":{\"uplink\":\"vuzlm\",\"downlink\":\"felfktg\"},\"5qi\":957829467,\"allocationAndRetentionPriorityLevel\":1827941579,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"znoigbrn\",\"downlink\":\"w\"}}") - .toObject(PccRuleQosPolicy.class); - Assertions.assertEquals(957829467, model.fiveQi()); - Assertions.assertEquals(1827941579, model.allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.MAY_PREEMPT, model.preemptionCapability()); - Assertions.assertEquals(PreemptionVulnerability.NOT_PREEMPTABLE, model.preemptionVulnerability()); - Assertions.assertEquals("znoigbrn", model.maximumBitRate().uplink()); - Assertions.assertEquals("w", model.maximumBitRate().downlink()); - Assertions.assertEquals("vuzlm", model.guaranteedBitRate().uplink()); - Assertions.assertEquals("felfktg", model.guaranteedBitRate().downlink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PccRuleQosPolicy model = - new PccRuleQosPolicy() - .withFiveQi(957829467) - .withAllocationAndRetentionPriorityLevel(1827941579) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withMaximumBitRate(new Ambr().withUplink("znoigbrn").withDownlink("w")) - .withGuaranteedBitRate(new Ambr().withUplink("vuzlm").withDownlink("felfktg")); - model = BinaryData.fromObject(model).toObject(PccRuleQosPolicy.class); - Assertions.assertEquals(957829467, model.fiveQi()); - Assertions.assertEquals(1827941579, model.allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.MAY_PREEMPT, model.preemptionCapability()); - Assertions.assertEquals(PreemptionVulnerability.NOT_PREEMPTABLE, model.preemptionVulnerability()); - Assertions.assertEquals("znoigbrn", model.maximumBitRate().uplink()); - Assertions.assertEquals("w", model.maximumBitRate().downlink()); - Assertions.assertEquals("vuzlm", model.guaranteedBitRate().uplink()); - Assertions.assertEquals("felfktg", model.guaranteedBitRate().downlink()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PinholeTimeoutsTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PinholeTimeoutsTests.java deleted file mode 100644 index dc07b59a0743..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PinholeTimeoutsTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.PinholeTimeouts; -import org.junit.jupiter.api.Assertions; - -public final class PinholeTimeoutsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PinholeTimeouts model = - BinaryData - .fromString("{\"tcp\":1863276924,\"udp\":253959415,\"icmp\":1793570177}") - .toObject(PinholeTimeouts.class); - Assertions.assertEquals(1863276924, model.tcp()); - Assertions.assertEquals(253959415, model.udp()); - Assertions.assertEquals(1793570177, model.icmp()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PinholeTimeouts model = new PinholeTimeouts().withTcp(1863276924).withUdp(253959415).withIcmp(1793570177); - model = BinaryData.fromObject(model).toObject(PinholeTimeouts.class); - Assertions.assertEquals(1863276924, model.tcp()); - Assertions.assertEquals(253959415, model.udp()); - Assertions.assertEquals(1793570177, model.icmp()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PlatformConfigurationTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PlatformConfigurationTests.java deleted file mode 100644 index 96cf4429c4f5..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PlatformConfigurationTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackEdgeDeviceResourceId; -import com.azure.resourcemanager.mobilenetwork.models.AzureStackHciClusterResourceId; -import com.azure.resourcemanager.mobilenetwork.models.ConnectedClusterResourceId; -import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; -import com.azure.resourcemanager.mobilenetwork.models.PlatformConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import org.junit.jupiter.api.Assertions; - -public final class PlatformConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlatformConfiguration model = - BinaryData - .fromString( - "{\"type\":\"3P-AZURE-STACK-HCI\",\"azureStackEdgeDevice\":{\"id\":\"hsmtxpsiebtfhvp\"},\"azureStackEdgeDevices\":[{\"id\":\"pskrdqmh\"},{\"id\":\"jdhtldwkyzxu\"}],\"azureStackHciCluster\":{\"id\":\"kn\"},\"connectedCluster\":{\"id\":\"scwsv\"},\"customLocation\":{\"id\":\"otogtwrupqs\"}}") - .toObject(PlatformConfiguration.class); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.type()); - Assertions.assertEquals("hsmtxpsiebtfhvp", model.azureStackEdgeDevice().id()); - Assertions.assertEquals("kn", model.azureStackHciCluster().id()); - Assertions.assertEquals("scwsv", model.connectedCluster().id()); - Assertions.assertEquals("otogtwrupqs", model.customLocation().id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlatformConfiguration model = - new PlatformConfiguration() - .withType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withAzureStackEdgeDevice(new AzureStackEdgeDeviceResourceId().withId("hsmtxpsiebtfhvp")) - .withAzureStackHciCluster(new AzureStackHciClusterResourceId().withId("kn")) - .withConnectedCluster(new ConnectedClusterResourceId().withId("scwsv")) - .withCustomLocation(new CustomLocationResourceId().withId("otogtwrupqs")); - model = BinaryData.fromObject(model).toObject(PlatformConfiguration.class); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.type()); - Assertions.assertEquals("hsmtxpsiebtfhvp", model.azureStackEdgeDevice().id()); - Assertions.assertEquals("kn", model.azureStackHciCluster().id()); - Assertions.assertEquals("scwsv", model.connectedCluster().id()); - Assertions.assertEquals("otogtwrupqs", model.customLocation().id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PlatformTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PlatformTests.java deleted file mode 100644 index d0e35944f253..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PlatformTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.ObsoleteVersion; -import com.azure.resourcemanager.mobilenetwork.models.Platform; -import com.azure.resourcemanager.mobilenetwork.models.PlatformType; -import com.azure.resourcemanager.mobilenetwork.models.RecommendedVersion; -import com.azure.resourcemanager.mobilenetwork.models.VersionState; -import org.junit.jupiter.api.Assertions; - -public final class PlatformTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Platform model = - BinaryData - .fromString( - "{\"platformType\":\"3P-AZURE-STACK-HCI\",\"versionState\":\"Deprecated\",\"minimumPlatformSoftwareVersion\":\"pvjzbe\",\"maximumPlatformSoftwareVersion\":\"l\",\"recommendedVersion\":\"Recommended\",\"obsoleteVersion\":\"Obsolete\"}") - .toObject(Platform.class); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.platformType()); - Assertions.assertEquals(VersionState.DEPRECATED, model.versionState()); - Assertions.assertEquals("pvjzbe", model.minimumPlatformSoftwareVersion()); - Assertions.assertEquals("l", model.maximumPlatformSoftwareVersion()); - Assertions.assertEquals(RecommendedVersion.RECOMMENDED, model.recommendedVersion()); - Assertions.assertEquals(ObsoleteVersion.OBSOLETE, model.obsoleteVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Platform model = - new Platform() - .withPlatformType(PlatformType.THREE_P_AZURE_STACK_HCI) - .withVersionState(VersionState.DEPRECATED) - .withMinimumPlatformSoftwareVersion("pvjzbe") - .withMaximumPlatformSoftwareVersion("l") - .withRecommendedVersion(RecommendedVersion.RECOMMENDED) - .withObsoleteVersion(ObsoleteVersion.OBSOLETE); - model = BinaryData.fromObject(model).toObject(Platform.class); - Assertions.assertEquals(PlatformType.THREE_P_AZURE_STACK_HCI, model.platformType()); - Assertions.assertEquals(VersionState.DEPRECATED, model.versionState()); - Assertions.assertEquals("pvjzbe", model.minimumPlatformSoftwareVersion()); - Assertions.assertEquals("l", model.maximumPlatformSoftwareVersion()); - Assertions.assertEquals(RecommendedVersion.RECOMMENDED, model.recommendedVersion()); - Assertions.assertEquals(ObsoleteVersion.OBSOLETE, model.obsoleteVersion()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PlmnIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PlmnIdTests.java deleted file mode 100644 index 7d85a6d0ee59..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PlmnIdTests.java +++ /dev/null @@ -1,27 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.PlmnId; -import org.junit.jupiter.api.Assertions; - -public final class PlmnIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlmnId model = - BinaryData.fromString("{\"mcc\":\"tutqxlngxlefgug\",\"mnc\":\"xkrxdqmi\"}").toObject(PlmnId.class); - Assertions.assertEquals("tutqxlngxlefgug", model.mcc()); - Assertions.assertEquals("xkrxdqmi", model.mnc()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlmnId model = new PlmnId().withMcc("tutqxlngxlefgug").withMnc("xkrxdqmi"); - model = BinaryData.fromObject(model).toObject(PlmnId.class); - Assertions.assertEquals("tutqxlngxlefgug", model.mcc()); - Assertions.assertEquals("xkrxdqmi", model.mnc()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PortRangeTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PortRangeTests.java deleted file mode 100644 index 2da938b904ea..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PortRangeTests.java +++ /dev/null @@ -1,27 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.PortRange; -import org.junit.jupiter.api.Assertions; - -public final class PortRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PortRange model = - BinaryData.fromString("{\"minPort\":761147414,\"maxPort\":1410896813}").toObject(PortRange.class); - Assertions.assertEquals(761147414, model.minPort()); - Assertions.assertEquals(1410896813, model.maxPort()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PortRange model = new PortRange().withMinPort(761147414).withMaxPort(1410896813); - model = BinaryData.fromObject(model).toObject(PortRange.class); - Assertions.assertEquals(761147414, model.minPort()); - Assertions.assertEquals(1410896813, model.maxPort()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PortReuseHoldTimesTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PortReuseHoldTimesTests.java deleted file mode 100644 index a31d3560a709..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/PortReuseHoldTimesTests.java +++ /dev/null @@ -1,27 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.PortReuseHoldTimes; -import org.junit.jupiter.api.Assertions; - -public final class PortReuseHoldTimesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PortReuseHoldTimes model = - BinaryData.fromString("{\"tcp\":464271708,\"udp\":48641393}").toObject(PortReuseHoldTimes.class); - Assertions.assertEquals(464271708, model.tcp()); - Assertions.assertEquals(48641393, model.udp()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PortReuseHoldTimes model = new PortReuseHoldTimes().withTcp(464271708).withUdp(48641393); - model = BinaryData.fromObject(model).toObject(PortReuseHoldTimes.class); - Assertions.assertEquals(464271708, model.tcp()); - Assertions.assertEquals(48641393, model.udp()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/QosPolicyTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/QosPolicyTests.java deleted file mode 100644 index 0669d8e5897e..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/QosPolicyTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.QosPolicy; -import org.junit.jupiter.api.Assertions; - -public final class QosPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QosPolicy model = - BinaryData - .fromString( - "{\"5qi\":1458242132,\"allocationAndRetentionPriorityLevel\":2100624724,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"yhgsopbyrqufe\",\"downlink\":\"xuvw\"}}") - .toObject(QosPolicy.class); - Assertions.assertEquals(1458242132, model.fiveQi()); - Assertions.assertEquals(2100624724, model.allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.NOT_PREEMPT, model.preemptionCapability()); - Assertions.assertEquals(PreemptionVulnerability.NOT_PREEMPTABLE, model.preemptionVulnerability()); - Assertions.assertEquals("yhgsopbyrqufe", model.maximumBitRate().uplink()); - Assertions.assertEquals("xuvw", model.maximumBitRate().downlink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QosPolicy model = - new QosPolicy() - .withFiveQi(1458242132) - .withAllocationAndRetentionPriorityLevel(2100624724) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withMaximumBitRate(new Ambr().withUplink("yhgsopbyrqufe").withDownlink("xuvw")); - model = BinaryData.fromObject(model).toObject(QosPolicy.class); - Assertions.assertEquals(1458242132, model.fiveQi()); - Assertions.assertEquals(2100624724, model.allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.NOT_PREEMPT, model.preemptionCapability()); - Assertions.assertEquals(PreemptionVulnerability.NOT_PREEMPTABLE, model.preemptionVulnerability()); - Assertions.assertEquals("yhgsopbyrqufe", model.maximumBitRate().uplink()); - Assertions.assertEquals("xuvw", model.maximumBitRate().downlink()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceDataFlowTemplateTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceDataFlowTemplateTests.java deleted file mode 100644 index ae576dad0f7e..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceDataFlowTemplateTests.java +++ /dev/null @@ -1,44 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.SdfDirection; -import com.azure.resourcemanager.mobilenetwork.models.ServiceDataFlowTemplate; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceDataFlowTemplateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceDataFlowTemplate model = - BinaryData - .fromString( - "{\"templateName\":\"wkpnbsaz\",\"direction\":\"Downlink\",\"protocol\":[\"oqkag\",\"hsxttaugzxnf\",\"azpxdtnkdmkqjjl\"],\"remoteIpList\":[\"envrkpyouaibrebq\",\"aysjkixqtnqttez\"],\"ports\":[\"ffiakp\",\"pqqmted\"]}") - .toObject(ServiceDataFlowTemplate.class); - Assertions.assertEquals("wkpnbsaz", model.templateName()); - Assertions.assertEquals(SdfDirection.DOWNLINK, model.direction()); - Assertions.assertEquals("oqkag", model.protocol().get(0)); - Assertions.assertEquals("envrkpyouaibrebq", model.remoteIpList().get(0)); - Assertions.assertEquals("ffiakp", model.ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceDataFlowTemplate model = - new ServiceDataFlowTemplate() - .withTemplateName("wkpnbsaz") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList("oqkag", "hsxttaugzxnf", "azpxdtnkdmkqjjl")) - .withRemoteIpList(Arrays.asList("envrkpyouaibrebq", "aysjkixqtnqttez")) - .withPorts(Arrays.asList("ffiakp", "pqqmted")); - model = BinaryData.fromObject(model).toObject(ServiceDataFlowTemplate.class); - Assertions.assertEquals("wkpnbsaz", model.templateName()); - Assertions.assertEquals(SdfDirection.DOWNLINK, model.direction()); - Assertions.assertEquals("oqkag", model.protocol().get(0)); - Assertions.assertEquals("envrkpyouaibrebq", model.remoteIpList().get(0)); - Assertions.assertEquals("ffiakp", model.ports().get(0)); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceInnerTests.java deleted file mode 100644 index 4f6ef5aeb740..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceInnerTests.java +++ /dev/null @@ -1,313 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.ServiceInner; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleQosPolicy; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.QosPolicy; -import com.azure.resourcemanager.mobilenetwork.models.SdfDirection; -import com.azure.resourcemanager.mobilenetwork.models.ServiceDataFlowTemplate; -import com.azure.resourcemanager.mobilenetwork.models.TrafficControlPermission; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ServiceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\",\"servicePrecedence\":1638328793,\"serviceQosPolicy\":{\"5qi\":84729056,\"allocationAndRetentionPriorityLevel\":1322696494,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"maximumBitRate\":{\"uplink\":\"dreqnovvqf\",\"downlink\":\"vljxywsu\"}},\"pccRules\":[{\"ruleName\":\"yrs\",\"rulePrecedence\":371488938,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"tgadgvraeaen\",\"downlink\":\"qnzarrwl\"},\"5qi\":1397845425,\"allocationAndRetentionPriorityLevel\":1309534736,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"maximumBitRate\":{\"uplink\":\"cewiipfpub\",\"downlink\":\"ibwwiftohqkv\"}},\"trafficControl\":\"Blocked\",\"serviceDataFlowTemplates\":[{\"templateName\":\"sgplsakn\",\"direction\":\"Uplink\",\"protocol\":[\"synljphuopxodl\",\"iyntorzihle\",\"sjswsrms\"],\"remoteIpList\":[\"zrpzb\",\"hckqqzqioxiy\",\"uiizynke\",\"yatrwy\"],\"ports\":[\"ibzyhwitsmyp\",\"ynpcdpumnzgmwznm\",\"biknsorgjhxbld\",\"lwwrl\"]},{\"templateName\":\"dmtnc\",\"direction\":\"Downlink\",\"protocol\":[\"otllxdyhgsyo\"],\"remoteIpList\":[\"gjltdtbnnhado\",\"crkvcikhnv\",\"amqgxqquezikyw\",\"gxk\"],\"ports\":[\"atmelwui\"]}]},{\"ruleName\":\"iccjzkzivgvvcna\",\"rulePrecedence\":980473752,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"rnxxmueed\",\"downlink\":\"drd\"},\"5qi\":817024636,\"allocationAndRetentionPriorityLevel\":467483193,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"healmfmtda\",\"downlink\":\"ygdvwv\"}},\"trafficControl\":\"Blocked\",\"serviceDataFlowTemplates\":[{\"templateName\":\"hgwxrtfudx\",\"direction\":\"Downlink\",\"protocol\":[\"gyqagvrvmnpkuk\"],\"remoteIpList\":[\"i\",\"dblx\"],\"ports\":[\"mfnjh\",\"j\",\"wmszkk\"]},{\"templateName\":\"oqreyfkzikfjawn\",\"direction\":\"Downlink\",\"protocol\":[\"vxwc\"],\"remoteIpList\":[\"lpcirelsf\",\"aenwabf\",\"tkl\",\"dxbjhwuaanozj\"],\"ports\":[\"hyoulpjr\"]},{\"templateName\":\"xagl\",\"direction\":\"Uplink\",\"protocol\":[\"mjwosytx\",\"tcs\"],\"remoteIpList\":[\"cktqumiekkezzi\",\"hlyfjhdgqgg\",\"bdunygaeqid\"],\"ports\":[\"atpxl\",\"rxcyjmoad\",\"uvarmywdmjsjq\",\"jhhyxxrwlycoduhp\"]},{\"templateName\":\"xkgymareqnajxqu\",\"direction\":\"Bidirectional\",\"protocol\":[\"ky\"],\"remoteIpList\":[\"beddgssofw\",\"mzqa\"],\"ports\":[\"mnjijpxacqqudf\",\"byxbaaabjy\"]}]},{\"ruleName\":\"ayffim\",\"rulePrecedence\":1578513386,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"uzqogsexnevf\",\"downlink\":\"nwnwme\"},\"5qi\":1440499034,\"allocationAndRetentionPriorityLevel\":10547913,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"maximumBitRate\":{\"uplink\":\"soibjudpfrx\",\"downlink\":\"rthzvaytdwkqbrqu\"}},\"trafficControl\":\"Blocked\",\"serviceDataFlowTemplates\":[{\"templateName\":\"h\",\"direction\":\"Uplink\",\"protocol\":[\"i\",\"ivpdtiir\",\"tdqoaxoruzfgsq\",\"yfxrx\"],\"remoteIpList\":[\"eptra\"],\"ports\":[\"ezw\",\"wnwxuqlcvyd\"]},{\"templateName\":\"patdooaojkniodko\",\"direction\":\"Bidirectional\",\"protocol\":[\"wnujhemmsbvdk\"],\"remoteIpList\":[\"odtji\",\"fw\",\"lfltka\",\"jvefkdlfoakggkfp\"],\"ports\":[\"owpulpq\"]},{\"templateName\":\"lyls\",\"direction\":\"Downlink\",\"protocol\":[\"qjnsjervtia\"],\"remoteIpList\":[\"sdszue\",\"psbzkfzbeyvpn\",\"icvi\"],\"ports\":[\"jjxd\"]},{\"templateName\":\"rbuukzclewyhmlwp\",\"direction\":\"Bidirectional\",\"protocol\":[\"zpof\",\"cckwyfzqwhxxbu\",\"qa\",\"zfeqztppri\"],\"remoteIpList\":[\"xorjaltolmncwsob\",\"wcsdbnwdcfhucq\",\"pfuvglsbjjca\",\"vxb\"],\"ports\":[\"udutnco\",\"mr\",\"xqtvcofu\"]}]},{\"ruleName\":\"f\",\"rulePrecedence\":573023383,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"jub\",\"downlink\":\"dknnqvsazn\"},\"5qi\":764676926,\"allocationAndRetentionPriorityLevel\":1165613569,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"maximumBitRate\":{\"uplink\":\"sahmky\",\"downlink\":\"grauwjuetaebur\"}},\"trafficControl\":\"Enabled\",\"serviceDataFlowTemplates\":[{\"templateName\":\"ovsm\",\"direction\":\"Bidirectional\",\"protocol\":[\"wabm\",\"oefki\"],\"remoteIpList\":[\"vtpuqujmqlgk\"],\"ports\":[\"ndo\",\"ongbjcnt\",\"jitcjedftwwaez\"]},{\"templateName\":\"ojvdcpzfoqo\",\"direction\":\"Bidirectional\",\"protocol\":[\"ybxarzgszu\",\"oxciqopidoamcio\"],\"remoteIpList\":[\"khazxkhnzbonlwn\"],\"ports\":[\"gokdwbwhks\",\"zcmrvexztvb\",\"qgsfraoyzkoow\",\"lmnguxaw\"]},{\"templateName\":\"aldsy\",\"direction\":\"Downlink\",\"protocol\":[\"imerqfobwyznk\",\"ykutwpf\",\"pagmhrskdsnf\",\"sd\"],\"remoteIpList\":[\"kgtdlmkkze\",\"dlhewp\",\"sdsttwvog\",\"bbejdcngqqm\"],\"ports\":[\"ufgmjzrwrdg\",\"twaenuuzko\"]},{\"templateName\":\"bminrfdwoyuhhzi\",\"direction\":\"Bidirectional\",\"protocol\":[\"fozbhdmsmlmzqhof\",\"rmaequ\",\"ah\"],\"remoteIpList\":[\"cslfaoqzpiyylha\",\"nswhcc\"],\"ports\":[\"kaivwit\"]}]}]},\"location\":\"cywuggwol\",\"tags\":{\"i\":\"zbwemh\",\"wmsweypqwd\":\"sbrgz\",\"mkttlstvlzywem\":\"ggicccnxqhue\",\"lusiy\":\"zrncsdt\"},\"id\":\"bsfgytguslfea\",\"name\":\"cy\",\"type\":\"qukyhejhzi\"}") - .toObject(ServiceInner.class); - Assertions.assertEquals("cywuggwol", model.location()); - Assertions.assertEquals("zbwemh", model.tags().get("i")); - Assertions.assertEquals(1638328793, model.servicePrecedence()); - Assertions.assertEquals(84729056, model.serviceQosPolicy().fiveQi()); - Assertions.assertEquals(1322696494, model.serviceQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.NOT_PREEMPT, model.serviceQosPolicy().preemptionCapability()); - Assertions - .assertEquals(PreemptionVulnerability.PREEMPTABLE, model.serviceQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("dreqnovvqf", model.serviceQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("vljxywsu", model.serviceQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("yrs", model.pccRules().get(0).ruleName()); - Assertions.assertEquals(371488938, model.pccRules().get(0).rulePrecedence()); - Assertions.assertEquals(1397845425, model.pccRules().get(0).ruleQosPolicy().fiveQi()); - Assertions - .assertEquals(1309534736, model.pccRules().get(0).ruleQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.NOT_PREEMPT, model.pccRules().get(0).ruleQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.PREEMPTABLE, model.pccRules().get(0).ruleQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("cewiipfpub", model.pccRules().get(0).ruleQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("ibwwiftohqkv", model.pccRules().get(0).ruleQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("tgadgvraeaen", model.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().uplink()); - Assertions.assertEquals("qnzarrwl", model.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().downlink()); - Assertions.assertEquals(TrafficControlPermission.BLOCKED, model.pccRules().get(0).trafficControl()); - Assertions.assertEquals("sgplsakn", model.pccRules().get(0).serviceDataFlowTemplates().get(0).templateName()); - Assertions - .assertEquals(SdfDirection.UPLINK, model.pccRules().get(0).serviceDataFlowTemplates().get(0).direction()); - Assertions - .assertEquals( - "synljphuopxodl", model.pccRules().get(0).serviceDataFlowTemplates().get(0).protocol().get(0)); - Assertions - .assertEquals("zrpzb", model.pccRules().get(0).serviceDataFlowTemplates().get(0).remoteIpList().get(0)); - Assertions - .assertEquals("ibzyhwitsmyp", model.pccRules().get(0).serviceDataFlowTemplates().get(0).ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceInner model = - new ServiceInner() - .withLocation("cywuggwol") - .withTags( - mapOf("i", "zbwemh", "wmsweypqwd", "sbrgz", "mkttlstvlzywem", "ggicccnxqhue", "lusiy", "zrncsdt")) - .withServicePrecedence(1638328793) - .withServiceQosPolicy( - new QosPolicy() - .withFiveQi(84729056) - .withAllocationAndRetentionPriorityLevel(1322696494) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withMaximumBitRate(new Ambr().withUplink("dreqnovvqf").withDownlink("vljxywsu"))) - .withPccRules( - Arrays - .asList( - new PccRuleConfiguration() - .withRuleName("yrs") - .withRulePrecedence(371488938) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withFiveQi(1397845425) - .withAllocationAndRetentionPriorityLevel(1309534736) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withMaximumBitRate( - new Ambr().withUplink("cewiipfpub").withDownlink("ibwwiftohqkv")) - .withGuaranteedBitRate( - new Ambr().withUplink("tgadgvraeaen").withDownlink("qnzarrwl"))) - .withTrafficControl(TrafficControlPermission.BLOCKED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("sgplsakn") - .withDirection(SdfDirection.UPLINK) - .withProtocol( - Arrays.asList("synljphuopxodl", "iyntorzihle", "sjswsrms")) - .withRemoteIpList( - Arrays.asList("zrpzb", "hckqqzqioxiy", "uiizynke", "yatrwy")) - .withPorts( - Arrays - .asList( - "ibzyhwitsmyp", - "ynpcdpumnzgmwznm", - "biknsorgjhxbld", - "lwwrl")), - new ServiceDataFlowTemplate() - .withTemplateName("dmtnc") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList("otllxdyhgsyo")) - .withRemoteIpList( - Arrays - .asList("gjltdtbnnhado", "crkvcikhnv", "amqgxqquezikyw", "gxk")) - .withPorts(Arrays.asList("atmelwui")))), - new PccRuleConfiguration() - .withRuleName("iccjzkzivgvvcna") - .withRulePrecedence(980473752) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withFiveQi(817024636) - .withAllocationAndRetentionPriorityLevel(467483193) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withMaximumBitRate(new Ambr().withUplink("healmfmtda").withDownlink("ygdvwv")) - .withGuaranteedBitRate(new Ambr().withUplink("rnxxmueed").withDownlink("drd"))) - .withTrafficControl(TrafficControlPermission.BLOCKED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("hgwxrtfudx") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList("gyqagvrvmnpkuk")) - .withRemoteIpList(Arrays.asList("i", "dblx")) - .withPorts(Arrays.asList("mfnjh", "j", "wmszkk")), - new ServiceDataFlowTemplate() - .withTemplateName("oqreyfkzikfjawn") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList("vxwc")) - .withRemoteIpList( - Arrays.asList("lpcirelsf", "aenwabf", "tkl", "dxbjhwuaanozj")) - .withPorts(Arrays.asList("hyoulpjr")), - new ServiceDataFlowTemplate() - .withTemplateName("xagl") - .withDirection(SdfDirection.UPLINK) - .withProtocol(Arrays.asList("mjwosytx", "tcs")) - .withRemoteIpList( - Arrays.asList("cktqumiekkezzi", "hlyfjhdgqgg", "bdunygaeqid")) - .withPorts( - Arrays - .asList( - "atpxl", "rxcyjmoad", "uvarmywdmjsjq", "jhhyxxrwlycoduhp")), - new ServiceDataFlowTemplate() - .withTemplateName("xkgymareqnajxqu") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList("ky")) - .withRemoteIpList(Arrays.asList("beddgssofw", "mzqa")) - .withPorts(Arrays.asList("mnjijpxacqqudf", "byxbaaabjy")))), - new PccRuleConfiguration() - .withRuleName("ayffim") - .withRulePrecedence(1578513386) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withFiveQi(1440499034) - .withAllocationAndRetentionPriorityLevel(10547913) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withMaximumBitRate( - new Ambr().withUplink("soibjudpfrx").withDownlink("rthzvaytdwkqbrqu")) - .withGuaranteedBitRate( - new Ambr().withUplink("uzqogsexnevf").withDownlink("nwnwme"))) - .withTrafficControl(TrafficControlPermission.BLOCKED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("h") - .withDirection(SdfDirection.UPLINK) - .withProtocol(Arrays.asList("i", "ivpdtiir", "tdqoaxoruzfgsq", "yfxrx")) - .withRemoteIpList(Arrays.asList("eptra")) - .withPorts(Arrays.asList("ezw", "wnwxuqlcvyd")), - new ServiceDataFlowTemplate() - .withTemplateName("patdooaojkniodko") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList("wnujhemmsbvdk")) - .withRemoteIpList( - Arrays.asList("odtji", "fw", "lfltka", "jvefkdlfoakggkfp")) - .withPorts(Arrays.asList("owpulpq")), - new ServiceDataFlowTemplate() - .withTemplateName("lyls") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList("qjnsjervtia")) - .withRemoteIpList(Arrays.asList("sdszue", "psbzkfzbeyvpn", "icvi")) - .withPorts(Arrays.asList("jjxd")), - new ServiceDataFlowTemplate() - .withTemplateName("rbuukzclewyhmlwp") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol( - Arrays.asList("zpof", "cckwyfzqwhxxbu", "qa", "zfeqztppri")) - .withRemoteIpList( - Arrays - .asList( - "xorjaltolmncwsob", - "wcsdbnwdcfhucq", - "pfuvglsbjjca", - "vxb")) - .withPorts(Arrays.asList("udutnco", "mr", "xqtvcofu")))), - new PccRuleConfiguration() - .withRuleName("f") - .withRulePrecedence(573023383) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withFiveQi(764676926) - .withAllocationAndRetentionPriorityLevel(1165613569) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withMaximumBitRate( - new Ambr().withUplink("sahmky").withDownlink("grauwjuetaebur")) - .withGuaranteedBitRate(new Ambr().withUplink("jub").withDownlink("dknnqvsazn"))) - .withTrafficControl(TrafficControlPermission.ENABLED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("ovsm") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList("wabm", "oefki")) - .withRemoteIpList(Arrays.asList("vtpuqujmqlgk")) - .withPorts(Arrays.asList("ndo", "ongbjcnt", "jitcjedftwwaez")), - new ServiceDataFlowTemplate() - .withTemplateName("ojvdcpzfoqo") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList("ybxarzgszu", "oxciqopidoamcio")) - .withRemoteIpList(Arrays.asList("khazxkhnzbonlwn")) - .withPorts( - Arrays - .asList( - "gokdwbwhks", "zcmrvexztvb", "qgsfraoyzkoow", "lmnguxaw")), - new ServiceDataFlowTemplate() - .withTemplateName("aldsy") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol( - Arrays.asList("imerqfobwyznk", "ykutwpf", "pagmhrskdsnf", "sd")) - .withRemoteIpList( - Arrays.asList("kgtdlmkkze", "dlhewp", "sdsttwvog", "bbejdcngqqm")) - .withPorts(Arrays.asList("ufgmjzrwrdg", "twaenuuzko")), - new ServiceDataFlowTemplate() - .withTemplateName("bminrfdwoyuhhzi") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList("fozbhdmsmlmzqhof", "rmaequ", "ah")) - .withRemoteIpList(Arrays.asList("cslfaoqzpiyylha", "nswhcc")) - .withPorts(Arrays.asList("kaivwit")))))); - model = BinaryData.fromObject(model).toObject(ServiceInner.class); - Assertions.assertEquals("cywuggwol", model.location()); - Assertions.assertEquals("zbwemh", model.tags().get("i")); - Assertions.assertEquals(1638328793, model.servicePrecedence()); - Assertions.assertEquals(84729056, model.serviceQosPolicy().fiveQi()); - Assertions.assertEquals(1322696494, model.serviceQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.NOT_PREEMPT, model.serviceQosPolicy().preemptionCapability()); - Assertions - .assertEquals(PreemptionVulnerability.PREEMPTABLE, model.serviceQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("dreqnovvqf", model.serviceQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("vljxywsu", model.serviceQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("yrs", model.pccRules().get(0).ruleName()); - Assertions.assertEquals(371488938, model.pccRules().get(0).rulePrecedence()); - Assertions.assertEquals(1397845425, model.pccRules().get(0).ruleQosPolicy().fiveQi()); - Assertions - .assertEquals(1309534736, model.pccRules().get(0).ruleQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.NOT_PREEMPT, model.pccRules().get(0).ruleQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.PREEMPTABLE, model.pccRules().get(0).ruleQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("cewiipfpub", model.pccRules().get(0).ruleQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("ibwwiftohqkv", model.pccRules().get(0).ruleQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("tgadgvraeaen", model.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().uplink()); - Assertions.assertEquals("qnzarrwl", model.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().downlink()); - Assertions.assertEquals(TrafficControlPermission.BLOCKED, model.pccRules().get(0).trafficControl()); - Assertions.assertEquals("sgplsakn", model.pccRules().get(0).serviceDataFlowTemplates().get(0).templateName()); - Assertions - .assertEquals(SdfDirection.UPLINK, model.pccRules().get(0).serviceDataFlowTemplates().get(0).direction()); - Assertions - .assertEquals( - "synljphuopxodl", model.pccRules().get(0).serviceDataFlowTemplates().get(0).protocol().get(0)); - Assertions - .assertEquals("zrpzb", model.pccRules().get(0).serviceDataFlowTemplates().get(0).remoteIpList().get(0)); - Assertions - .assertEquals("ibzyhwitsmyp", model.pccRules().get(0).serviceDataFlowTemplates().get(0).ports().get(0)); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceListResultTests.java deleted file mode 100644 index 6c097a7c9b3a..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceListResultTests.java +++ /dev/null @@ -1,240 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.ServiceInner; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleQosPolicy; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.QosPolicy; -import com.azure.resourcemanager.mobilenetwork.models.SdfDirection; -import com.azure.resourcemanager.mobilenetwork.models.ServiceDataFlowTemplate; -import com.azure.resourcemanager.mobilenetwork.models.ServiceListResult; -import com.azure.resourcemanager.mobilenetwork.models.TrafficControlPermission; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ServiceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"servicePrecedence\":508950619,\"serviceQosPolicy\":{\"5qi\":1482322760,\"allocationAndRetentionPriorityLevel\":968506113,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"auyqncygupkv\",\"downlink\":\"p\"}},\"pccRules\":[{\"ruleName\":\"scw\",\"rulePrecedence\":1651652179,\"ruleQosPolicy\":{\"maximumBitRate\":{\"uplink\":\"pevzhfst\",\"downlink\":\"txhojujb\"}},\"trafficControl\":\"Blocked\",\"serviceDataFlowTemplates\":[{\"templateName\":\"mc\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"hixbjxyfwnyl\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"ool\",\"direction\":\"Uplink\",\"protocol\":[],\"remoteIpList\":[]}]},{\"ruleName\":\"tpkiwkkbnujry\",\"rulePrecedence\":429689436,\"ruleQosPolicy\":{\"maximumBitRate\":{\"uplink\":\"y\",\"downlink\":\"bfpncurdo\"}},\"trafficControl\":\"Enabled\",\"serviceDataFlowTemplates\":[{\"templateName\":\"thtywub\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"bihwqknfdnt\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]}]},{\"ruleName\":\"chrdgoihxumwcto\",\"rulePrecedence\":1097443126,\"ruleQosPolicy\":{\"maximumBitRate\":{\"uplink\":\"jl\",\"downlink\":\"udfdlwgg\"}},\"trafficControl\":\"Enabled\",\"serviceDataFlowTemplates\":[{\"templateName\":\"wtovvtgsein\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"iufxqknpir\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"epttwqmsniff\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"mqnrojlpijnkr\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]}]},{\"ruleName\":\"rddh\",\"rulePrecedence\":1110792389,\"ruleQosPolicy\":{\"maximumBitRate\":{\"uplink\":\"tizzronasxif\",\"downlink\":\"ozqyzh\"}},\"trafficControl\":\"Blocked\",\"serviceDataFlowTemplates\":[{\"templateName\":\"sgogczhonnxk\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"gnyhmossxkkg\",\"direction\":\"Uplink\",\"protocol\":[],\"remoteIpList\":[]}]}]},\"location\":\"rghxjb\",\"tags\":{\"svbuswdvzyy\":\"xvcxgfrpdsofbshr\",\"awnopqgikyzirtxd\":\"ycnunvjsrtk\",\"ioilqukrydxtq\":\"uxzejntpsew\",\"ghhavgrvkffo\":\"ieoxorggufhyaomt\"},\"id\":\"jzhpjbibgjmfx\",\"name\":\"mv\",\"type\":\"cluyovwxnbkf\"}],\"nextLink\":\"zxscyhwzdgirujb\"}") - .toObject(ServiceListResult.class); - Assertions.assertEquals("rghxjb", model.value().get(0).location()); - Assertions.assertEquals("xvcxgfrpdsofbshr", model.value().get(0).tags().get("svbuswdvzyy")); - Assertions.assertEquals(508950619, model.value().get(0).servicePrecedence()); - Assertions.assertEquals(1482322760, model.value().get(0).serviceQosPolicy().fiveQi()); - Assertions - .assertEquals(968506113, model.value().get(0).serviceQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.MAY_PREEMPT, model.value().get(0).serviceQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.NOT_PREEMPTABLE, - model.value().get(0).serviceQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("auyqncygupkv", model.value().get(0).serviceQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("p", model.value().get(0).serviceQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("scw", model.value().get(0).pccRules().get(0).ruleName()); - Assertions.assertEquals(1651652179, model.value().get(0).pccRules().get(0).rulePrecedence()); - Assertions - .assertEquals("pevzhfst", model.value().get(0).pccRules().get(0).ruleQosPolicy().maximumBitRate().uplink()); - Assertions - .assertEquals( - "txhojujb", model.value().get(0).pccRules().get(0).ruleQosPolicy().maximumBitRate().downlink()); - Assertions - .assertEquals(TrafficControlPermission.BLOCKED, model.value().get(0).pccRules().get(0).trafficControl()); - Assertions - .assertEquals( - "mc", model.value().get(0).pccRules().get(0).serviceDataFlowTemplates().get(0).templateName()); - Assertions - .assertEquals( - SdfDirection.DOWNLINK, - model.value().get(0).pccRules().get(0).serviceDataFlowTemplates().get(0).direction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceListResult model = - new ServiceListResult() - .withValue( - Arrays - .asList( - new ServiceInner() - .withLocation("rghxjb") - .withTags( - mapOf( - "svbuswdvzyy", - "xvcxgfrpdsofbshr", - "awnopqgikyzirtxd", - "ycnunvjsrtk", - "ioilqukrydxtq", - "uxzejntpsew", - "ghhavgrvkffo", - "ieoxorggufhyaomt")) - .withServicePrecedence(508950619) - .withServiceQosPolicy( - new QosPolicy() - .withFiveQi(1482322760) - .withAllocationAndRetentionPriorityLevel(968506113) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withMaximumBitRate(new Ambr().withUplink("auyqncygupkv").withDownlink("p"))) - .withPccRules( - Arrays - .asList( - new PccRuleConfiguration() - .withRuleName("scw") - .withRulePrecedence(1651652179) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withMaximumBitRate( - new Ambr().withUplink("pevzhfst").withDownlink("txhojujb"))) - .withTrafficControl(TrafficControlPermission.BLOCKED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("mc") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()), - new ServiceDataFlowTemplate() - .withTemplateName("hixbjxyfwnyl") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()), - new ServiceDataFlowTemplate() - .withTemplateName("ool") - .withDirection(SdfDirection.UPLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()))), - new PccRuleConfiguration() - .withRuleName("tpkiwkkbnujry") - .withRulePrecedence(429689436) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withMaximumBitRate( - new Ambr().withUplink("y").withDownlink("bfpncurdo"))) - .withTrafficControl(TrafficControlPermission.ENABLED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("thtywub") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()), - new ServiceDataFlowTemplate() - .withTemplateName("bihwqknfdnt") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()))), - new PccRuleConfiguration() - .withRuleName("chrdgoihxumwcto") - .withRulePrecedence(1097443126) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withMaximumBitRate( - new Ambr().withUplink("jl").withDownlink("udfdlwgg"))) - .withTrafficControl(TrafficControlPermission.ENABLED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("wtovvtgsein") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()), - new ServiceDataFlowTemplate() - .withTemplateName("iufxqknpir") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()), - new ServiceDataFlowTemplate() - .withTemplateName("epttwqmsniff") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()), - new ServiceDataFlowTemplate() - .withTemplateName("mqnrojlpijnkr") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()))), - new PccRuleConfiguration() - .withRuleName("rddh") - .withRulePrecedence(1110792389) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withMaximumBitRate( - new Ambr() - .withUplink("tizzronasxif") - .withDownlink("ozqyzh"))) - .withTrafficControl(TrafficControlPermission.BLOCKED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("sgogczhonnxk") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()), - new ServiceDataFlowTemplate() - .withTemplateName("gnyhmossxkkg") - .withDirection(SdfDirection.UPLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()))))))); - model = BinaryData.fromObject(model).toObject(ServiceListResult.class); - Assertions.assertEquals("rghxjb", model.value().get(0).location()); - Assertions.assertEquals("xvcxgfrpdsofbshr", model.value().get(0).tags().get("svbuswdvzyy")); - Assertions.assertEquals(508950619, model.value().get(0).servicePrecedence()); - Assertions.assertEquals(1482322760, model.value().get(0).serviceQosPolicy().fiveQi()); - Assertions - .assertEquals(968506113, model.value().get(0).serviceQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.MAY_PREEMPT, model.value().get(0).serviceQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.NOT_PREEMPTABLE, - model.value().get(0).serviceQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("auyqncygupkv", model.value().get(0).serviceQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("p", model.value().get(0).serviceQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("scw", model.value().get(0).pccRules().get(0).ruleName()); - Assertions.assertEquals(1651652179, model.value().get(0).pccRules().get(0).rulePrecedence()); - Assertions - .assertEquals("pevzhfst", model.value().get(0).pccRules().get(0).ruleQosPolicy().maximumBitRate().uplink()); - Assertions - .assertEquals( - "txhojujb", model.value().get(0).pccRules().get(0).ruleQosPolicy().maximumBitRate().downlink()); - Assertions - .assertEquals(TrafficControlPermission.BLOCKED, model.value().get(0).pccRules().get(0).trafficControl()); - Assertions - .assertEquals( - "mc", model.value().get(0).pccRules().get(0).serviceDataFlowTemplates().get(0).templateName()); - Assertions - .assertEquals( - SdfDirection.DOWNLINK, - model.value().get(0).pccRules().get(0).serviceDataFlowTemplates().get(0).direction()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicePropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicePropertiesFormatTests.java deleted file mode 100644 index 756541364c53..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicePropertiesFormatTests.java +++ /dev/null @@ -1,205 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.ServicePropertiesFormat; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleQosPolicy; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.QosPolicy; -import com.azure.resourcemanager.mobilenetwork.models.SdfDirection; -import com.azure.resourcemanager.mobilenetwork.models.ServiceDataFlowTemplate; -import com.azure.resourcemanager.mobilenetwork.models.TrafficControlPermission; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServicePropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServicePropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Accepted\",\"servicePrecedence\":883712921,\"serviceQosPolicy\":{\"5qi\":843863757,\"allocationAndRetentionPriorityLevel\":196039433,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"srp\",\"downlink\":\"vu\"}},\"pccRules\":[{\"ruleName\":\"raehtwdwrft\",\"rulePrecedence\":575939452,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"yrcdlbhshfwprac\",\"downlink\":\"twitykhev\"},\"5qi\":87341209,\"allocationAndRetentionPriorityLevel\":685537305,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"dyodnwzxltj\",\"downlink\":\"vnhltiugcx\"}},\"trafficControl\":\"Enabled\",\"serviceDataFlowTemplates\":[{\"templateName\":\"wxqibyq\",\"direction\":\"Bidirectional\",\"protocol\":[\"owx\"],\"remoteIpList\":[\"mdjrkvfgbvfvp\",\"bodacizsjq\",\"hkr\",\"ibdeibq\"],\"ports\":[\"kghv\"]},{\"templateName\":\"ndzwmkrefa\",\"direction\":\"Bidirectional\",\"protocol\":[\"orwkqnyh\",\"b\",\"j\",\"jivfxzsjabib\"],\"remoteIpList\":[\"stawfsdjpvkv\",\"bjxbkzbzk\",\"vncjabudurgk\",\"kmokz\"],\"ports\":[\"klff\"]},{\"templateName\":\"mouwqlgzrfzeey\",\"direction\":\"Uplink\",\"protocol\":[\"zi\",\"ayuhqlbjbsy\",\"bqwrvtldgm\"],\"remoteIpList\":[\"gvmpipaslthaqfx\",\"smwutwbdsrezpd\",\"hneuyowqkd\",\"ytisibir\"],\"ports\":[\"ikpzimejza\",\"lfzxiavrmbzonoki\"]}]},{\"ruleName\":\"rjqc\",\"rulePrecedence\":749799353,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"pfrlazsz\",\"downlink\":\"nwoiind\"},\"5qi\":369486551,\"allocationAndRetentionPriorityLevel\":941939967,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"tlhflsjcdhszf\",\"downlink\":\"vfbgofeljagrqmqh\"}},\"trafficControl\":\"Enabled\",\"serviceDataFlowTemplates\":[{\"templateName\":\"iiiojnalghf\",\"direction\":\"Uplink\",\"protocol\":[\"vsexsowuelu\",\"hhahhxvrhmzkwpjg\",\"wspughftqsxhqx\"],\"remoteIpList\":[\"xukndxdigr\"],\"ports\":[\"ufzdmsyq\",\"fi\",\"whbotzingamv\",\"phoszqz\"]},{\"templateName\":\"dphqamv\",\"direction\":\"Bidirectional\",\"protocol\":[\"wynwcvtbvkayhm\",\"nvyq\",\"atkzwpcnpw\",\"cjaesgvvs\"],\"remoteIpList\":[\"yajguqfhwygzlv\",\"nk\"],\"ports\":[\"semdwzrmu\",\"apfcqdpsq\",\"qvpsvuoymg\",\"celve\"]},{\"templateName\":\"rypqlmfeo\",\"direction\":\"Bidirectional\",\"protocol\":[\"qwkyhkobop\",\"xedk\"],\"remoteIpList\":[\"epbqpcrfkbw\"],\"ports\":[\"njv\",\"dw\",\"lpqekf\",\"nkhtjsyingw\"]},{\"templateName\":\"qatmtdhtmdvy\",\"direction\":\"Uplink\",\"protocol\":[\"kdgszywkbirr\",\"uzhlhkjoqrv\",\"qaatjinrv\"],\"remoteIpList\":[\"upmfiibfg\",\"jioolvrwxk\"],\"ports\":[\"k\",\"llqwjygvjayvblmh\"]}]}]}") - .toObject(ServicePropertiesFormat.class); - Assertions.assertEquals(883712921, model.servicePrecedence()); - Assertions.assertEquals(843863757, model.serviceQosPolicy().fiveQi()); - Assertions.assertEquals(196039433, model.serviceQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.NOT_PREEMPT, model.serviceQosPolicy().preemptionCapability()); - Assertions - .assertEquals(PreemptionVulnerability.NOT_PREEMPTABLE, model.serviceQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("srp", model.serviceQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("vu", model.serviceQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("raehtwdwrft", model.pccRules().get(0).ruleName()); - Assertions.assertEquals(575939452, model.pccRules().get(0).rulePrecedence()); - Assertions.assertEquals(87341209, model.pccRules().get(0).ruleQosPolicy().fiveQi()); - Assertions - .assertEquals(685537305, model.pccRules().get(0).ruleQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.MAY_PREEMPT, model.pccRules().get(0).ruleQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.NOT_PREEMPTABLE, - model.pccRules().get(0).ruleQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("dyodnwzxltj", model.pccRules().get(0).ruleQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("vnhltiugcx", model.pccRules().get(0).ruleQosPolicy().maximumBitRate().downlink()); - Assertions - .assertEquals("yrcdlbhshfwprac", model.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().uplink()); - Assertions.assertEquals("twitykhev", model.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().downlink()); - Assertions.assertEquals(TrafficControlPermission.ENABLED, model.pccRules().get(0).trafficControl()); - Assertions.assertEquals("wxqibyq", model.pccRules().get(0).serviceDataFlowTemplates().get(0).templateName()); - Assertions - .assertEquals( - SdfDirection.BIDIRECTIONAL, model.pccRules().get(0).serviceDataFlowTemplates().get(0).direction()); - Assertions.assertEquals("owx", model.pccRules().get(0).serviceDataFlowTemplates().get(0).protocol().get(0)); - Assertions - .assertEquals( - "mdjrkvfgbvfvp", model.pccRules().get(0).serviceDataFlowTemplates().get(0).remoteIpList().get(0)); - Assertions.assertEquals("kghv", model.pccRules().get(0).serviceDataFlowTemplates().get(0).ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServicePropertiesFormat model = - new ServicePropertiesFormat() - .withServicePrecedence(883712921) - .withServiceQosPolicy( - new QosPolicy() - .withFiveQi(843863757) - .withAllocationAndRetentionPriorityLevel(196039433) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withMaximumBitRate(new Ambr().withUplink("srp").withDownlink("vu"))) - .withPccRules( - Arrays - .asList( - new PccRuleConfiguration() - .withRuleName("raehtwdwrft") - .withRulePrecedence(575939452) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withFiveQi(87341209) - .withAllocationAndRetentionPriorityLevel(685537305) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withMaximumBitRate( - new Ambr().withUplink("dyodnwzxltj").withDownlink("vnhltiugcx")) - .withGuaranteedBitRate( - new Ambr().withUplink("yrcdlbhshfwprac").withDownlink("twitykhev"))) - .withTrafficControl(TrafficControlPermission.ENABLED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("wxqibyq") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList("owx")) - .withRemoteIpList( - Arrays.asList("mdjrkvfgbvfvp", "bodacizsjq", "hkr", "ibdeibq")) - .withPorts(Arrays.asList("kghv")), - new ServiceDataFlowTemplate() - .withTemplateName("ndzwmkrefa") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList("orwkqnyh", "b", "j", "jivfxzsjabib")) - .withRemoteIpList( - Arrays.asList("stawfsdjpvkv", "bjxbkzbzk", "vncjabudurgk", "kmokz")) - .withPorts(Arrays.asList("klff")), - new ServiceDataFlowTemplate() - .withTemplateName("mouwqlgzrfzeey") - .withDirection(SdfDirection.UPLINK) - .withProtocol(Arrays.asList("zi", "ayuhqlbjbsy", "bqwrvtldgm")) - .withRemoteIpList( - Arrays - .asList( - "gvmpipaslthaqfx", - "smwutwbdsrezpd", - "hneuyowqkd", - "ytisibir")) - .withPorts(Arrays.asList("ikpzimejza", "lfzxiavrmbzonoki")))), - new PccRuleConfiguration() - .withRuleName("rjqc") - .withRulePrecedence(749799353) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withFiveQi(369486551) - .withAllocationAndRetentionPriorityLevel(941939967) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withMaximumBitRate( - new Ambr().withUplink("tlhflsjcdhszf").withDownlink("vfbgofeljagrqmqh")) - .withGuaranteedBitRate( - new Ambr().withUplink("pfrlazsz").withDownlink("nwoiind"))) - .withTrafficControl(TrafficControlPermission.ENABLED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("iiiojnalghf") - .withDirection(SdfDirection.UPLINK) - .withProtocol( - Arrays.asList("vsexsowuelu", "hhahhxvrhmzkwpjg", "wspughftqsxhqx")) - .withRemoteIpList(Arrays.asList("xukndxdigr")) - .withPorts(Arrays.asList("ufzdmsyq", "fi", "whbotzingamv", "phoszqz")), - new ServiceDataFlowTemplate() - .withTemplateName("dphqamv") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol( - Arrays.asList("wynwcvtbvkayhm", "nvyq", "atkzwpcnpw", "cjaesgvvs")) - .withRemoteIpList(Arrays.asList("yajguqfhwygzlv", "nk")) - .withPorts( - Arrays.asList("semdwzrmu", "apfcqdpsq", "qvpsvuoymg", "celve")), - new ServiceDataFlowTemplate() - .withTemplateName("rypqlmfeo") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList("qwkyhkobop", "xedk")) - .withRemoteIpList(Arrays.asList("epbqpcrfkbw")) - .withPorts(Arrays.asList("njv", "dw", "lpqekf", "nkhtjsyingw")), - new ServiceDataFlowTemplate() - .withTemplateName("qatmtdhtmdvy") - .withDirection(SdfDirection.UPLINK) - .withProtocol(Arrays.asList("kdgszywkbirr", "uzhlhkjoqrv", "qaatjinrv")) - .withRemoteIpList(Arrays.asList("upmfiibfg", "jioolvrwxk")) - .withPorts(Arrays.asList("k", "llqwjygvjayvblmh")))))); - model = BinaryData.fromObject(model).toObject(ServicePropertiesFormat.class); - Assertions.assertEquals(883712921, model.servicePrecedence()); - Assertions.assertEquals(843863757, model.serviceQosPolicy().fiveQi()); - Assertions.assertEquals(196039433, model.serviceQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.NOT_PREEMPT, model.serviceQosPolicy().preemptionCapability()); - Assertions - .assertEquals(PreemptionVulnerability.NOT_PREEMPTABLE, model.serviceQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("srp", model.serviceQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("vu", model.serviceQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("raehtwdwrft", model.pccRules().get(0).ruleName()); - Assertions.assertEquals(575939452, model.pccRules().get(0).rulePrecedence()); - Assertions.assertEquals(87341209, model.pccRules().get(0).ruleQosPolicy().fiveQi()); - Assertions - .assertEquals(685537305, model.pccRules().get(0).ruleQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.MAY_PREEMPT, model.pccRules().get(0).ruleQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.NOT_PREEMPTABLE, - model.pccRules().get(0).ruleQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("dyodnwzxltj", model.pccRules().get(0).ruleQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("vnhltiugcx", model.pccRules().get(0).ruleQosPolicy().maximumBitRate().downlink()); - Assertions - .assertEquals("yrcdlbhshfwprac", model.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().uplink()); - Assertions.assertEquals("twitykhev", model.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().downlink()); - Assertions.assertEquals(TrafficControlPermission.ENABLED, model.pccRules().get(0).trafficControl()); - Assertions.assertEquals("wxqibyq", model.pccRules().get(0).serviceDataFlowTemplates().get(0).templateName()); - Assertions - .assertEquals( - SdfDirection.BIDIRECTIONAL, model.pccRules().get(0).serviceDataFlowTemplates().get(0).direction()); - Assertions.assertEquals("owx", model.pccRules().get(0).serviceDataFlowTemplates().get(0).protocol().get(0)); - Assertions - .assertEquals( - "mdjrkvfgbvfvp", model.pccRules().get(0).serviceDataFlowTemplates().get(0).remoteIpList().get(0)); - Assertions.assertEquals("kghv", model.pccRules().get(0).serviceDataFlowTemplates().get(0).ports().get(0)); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceResourceIdTests.java deleted file mode 100644 index 94f461398baf..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServiceResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.ServiceResourceId; -import org.junit.jupiter.api.Assertions; - -public final class ServiceResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceResourceId model = - BinaryData.fromString("{\"id\":\"grttikteusqczk\"}").toObject(ServiceResourceId.class); - Assertions.assertEquals("grttikteusqczk", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceResourceId model = new ServiceResourceId().withId("grttikteusqczk"); - model = BinaryData.fromObject(model).toObject(ServiceResourceId.class); - Assertions.assertEquals("grttikteusqczk", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesCreateOrUpdateMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesCreateOrUpdateMockTests.java deleted file mode 100644 index a4a8574b05aa..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,197 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.PccRuleQosPolicy; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.QosPolicy; -import com.azure.resourcemanager.mobilenetwork.models.SdfDirection; -import com.azure.resourcemanager.mobilenetwork.models.Service; -import com.azure.resourcemanager.mobilenetwork.models.ServiceDataFlowTemplate; -import com.azure.resourcemanager.mobilenetwork.models.TrafficControlPermission; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -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 ServicesCreateOrUpdateMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"servicePrecedence\":814334749,\"serviceQosPolicy\":{\"5qi\":807598404,\"allocationAndRetentionPriorityLevel\":2008269978,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"ttjzcfyjzpt\",\"downlink\":\"rl\"}},\"pccRules\":[{\"ruleName\":\"apqinf\",\"rulePrecedence\":547512121,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"glqdhm\",\"downlink\":\"jzralc\"},\"5qi\":482749830,\"allocationAndRetentionPriorityLevel\":2002700390,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"maximumBitRate\":{\"uplink\":\"o\",\"downlink\":\"cjenkyhfqzvsqxf\"}},\"trafficControl\":\"Blocked\",\"serviceDataFlowTemplates\":[{\"templateName\":\"gcm\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]}]}]},\"location\":\"jhhhqxu\",\"tags\":{\"sjsz\":\"cacoyvivbsiz\",\"lzijiufehgmvflnw\":\"bscm\"},\"id\":\"v\",\"name\":\"kxrerlniylylyfwx\",\"type\":\"utgqztwh\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Service response = - manager - .services() - .define("ttxpnrupza") - .withRegion("ym") - .withExistingMobileNetwork("lz", "zjknyuxg") - .withServicePrecedence(2127079482) - .withPccRules( - Arrays - .asList( - new PccRuleConfiguration() - .withRuleName("tvlxhrpqh") - .withRulePrecedence(1760825319) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withFiveQi(2029728354) - .withAllocationAndRetentionPriorityLevel(1798358498) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withMaximumBitRate( - new Ambr().withUplink("fqlwxldykalsy").withDownlink("aolnjpnnbmjk")) - .withGuaranteedBitRate( - new Ambr().withUplink("couqehb").withDownlink("bcdsziryrandoyp"))) - .withTrafficControl(TrafficControlPermission.BLOCKED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("gsjjxxahmrna") - .withDirection(SdfDirection.UPLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()), - new ServiceDataFlowTemplate() - .withTemplateName("yqegx") - .withDirection(SdfDirection.BIDIRECTIONAL) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()), - new ServiceDataFlowTemplate() - .withTemplateName("vpinbmhwbj") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()))), - new PccRuleConfiguration() - .withRuleName("kgqxn") - .withRulePrecedence(651806910) - .withRuleQosPolicy( - new PccRuleQosPolicy() - .withFiveQi(1407431837) - .withAllocationAndRetentionPriorityLevel(1512617242) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withMaximumBitRate(new Ambr().withUplink("wfekaumrrqmb").withDownlink("mqkra")) - .withGuaranteedBitRate( - new Ambr().withUplink("eznjaujv").withDownlink("annggiy"))) - .withTrafficControl(TrafficControlPermission.BLOCKED) - .withServiceDataFlowTemplates( - Arrays - .asList( - new ServiceDataFlowTemplate() - .withTemplateName("wbjsidbirkf") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()), - new ServiceDataFlowTemplate() - .withTemplateName("sokdgoge") - .withDirection(SdfDirection.DOWNLINK) - .withProtocol(Arrays.asList()) - .withRemoteIpList(Arrays.asList()))))) - .withTags(mapOf("f", "guzozkyew", "o", "zhhh")) - .withServiceQosPolicy( - new QosPolicy() - .withFiveQi(462853790) - .withAllocationAndRetentionPriorityLevel(352919591) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withMaximumBitRate(new Ambr().withUplink("wyskbruffgll").withDownlink("k"))) - .create(); - - Assertions.assertEquals("jhhhqxu", response.location()); - Assertions.assertEquals("cacoyvivbsiz", response.tags().get("sjsz")); - Assertions.assertEquals(814334749, response.servicePrecedence()); - Assertions.assertEquals(807598404, response.serviceQosPolicy().fiveQi()); - Assertions.assertEquals(2008269978, response.serviceQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.NOT_PREEMPT, response.serviceQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.NOT_PREEMPTABLE, response.serviceQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("ttjzcfyjzpt", response.serviceQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("rl", response.serviceQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("apqinf", response.pccRules().get(0).ruleName()); - Assertions.assertEquals(547512121, response.pccRules().get(0).rulePrecedence()); - Assertions.assertEquals(482749830, response.pccRules().get(0).ruleQosPolicy().fiveQi()); - Assertions - .assertEquals(2002700390, response.pccRules().get(0).ruleQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.MAY_PREEMPT, response.pccRules().get(0).ruleQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.PREEMPTABLE, - response.pccRules().get(0).ruleQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("o", response.pccRules().get(0).ruleQosPolicy().maximumBitRate().uplink()); - Assertions - .assertEquals("cjenkyhfqzvsqxf", response.pccRules().get(0).ruleQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("glqdhm", response.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().uplink()); - Assertions.assertEquals("jzralc", response.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().downlink()); - Assertions.assertEquals(TrafficControlPermission.BLOCKED, response.pccRules().get(0).trafficControl()); - Assertions.assertEquals("gcm", response.pccRules().get(0).serviceDataFlowTemplates().get(0).templateName()); - Assertions - .assertEquals( - SdfDirection.DOWNLINK, response.pccRules().get(0).serviceDataFlowTemplates().get(0).direction()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesDeleteMockTests.java deleted file mode 100644 index 59a77d4991af..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 ServicesDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.services().delete("opedbwdpyqyybxub", "dnafcbqwre", "jelaqacigele", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesGetWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesGetWithResponseMockTests.java deleted file mode 100644 index ededf7990c80..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesGetWithResponseMockTests.java +++ /dev/null @@ -1,106 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.SdfDirection; -import com.azure.resourcemanager.mobilenetwork.models.Service; -import com.azure.resourcemanager.mobilenetwork.models.TrafficControlPermission; -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 ServicesGetWithResponseMockTests { - @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\":{\"provisioningState\":\"Failed\",\"servicePrecedence\":628648988,\"serviceQosPolicy\":{\"5qi\":679051477,\"allocationAndRetentionPriorityLevel\":214925420,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"e\",\"downlink\":\"chkrttzr\"}},\"pccRules\":[{\"ruleName\":\"isgykiuemvanbwz\",\"rulePrecedence\":974039641,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"rx\",\"downlink\":\"bsojk\"},\"5qi\":1069752468,\"allocationAndRetentionPriorityLevel\":1367511614,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"sprqsgnzxojpslsv\",\"downlink\":\"g\"}},\"trafficControl\":\"Enabled\",\"serviceDataFlowTemplates\":[{\"templateName\":\"fiqwoy\",\"direction\":\"Uplink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"vapcoh\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"ucqpqojxcxzrz\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"gdzbenr\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]}]},{\"ruleName\":\"cawetzqddt\",\"rulePrecedence\":1050331690,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"jhzn\",\"downlink\":\"mtuatmzwcjjncqtj\"},\"5qi\":814110880,\"allocationAndRetentionPriorityLevel\":1502507838,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"tzuuvb\",\"downlink\":\"ngrebwg\"}},\"trafficControl\":\"Blocked\",\"serviceDataFlowTemplates\":[{\"templateName\":\"tzlswvaj\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"utlxjoqzasunwqrj\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"rg\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"aohcmbuocn\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]}]},{\"ruleName\":\"ohmbpyr\",\"rulePrecedence\":1432807244,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"eblydyv\",\"downlink\":\"fkmroc\"},\"5qi\":181374467,\"allocationAndRetentionPriorityLevel\":34796750,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"maximumBitRate\":{\"uplink\":\"dlfp\",\"downlink\":\"apucygvo\"}},\"trafficControl\":\"Enabled\",\"serviceDataFlowTemplates\":[{\"templateName\":\"nssxlgh\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"egjlgvvpa\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"ksgbuxan\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"ygdhgaqipirpiwr\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]}]},{\"ruleName\":\"fulopmjnlexwhcb\",\"rulePrecedence\":237656634,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"k\",\"downlink\":\"phuuuerctato\"},\"5qi\":1416818849,\"allocationAndRetentionPriorityLevel\":1497200887,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"cyrduczkg\",\"downlink\":\"fxyfsrucvcrrpcj\"}},\"trafficControl\":\"Enabled\",\"serviceDataFlowTemplates\":[{\"templateName\":\"t\",\"direction\":\"Uplink\",\"protocol\":[],\"remoteIpList\":[]}]}]},\"location\":\"aqnrmvvfkoxmlg\",\"tags\":{\"mzvlazipbh\":\"uidvrmazlpdwwex\",\"uuzivensrpmeyyvp\":\"wvqsgny\",\"gsksrfhf\":\"patlbijp\"},\"id\":\"olmk\",\"name\":\"bnxwc\",\"type\":\"ommpvfqaw\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Service response = - manager - .services() - .getWithResponse("hdbvqvwzkjop", "beonrlkwzdq", "bxcea", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("aqnrmvvfkoxmlg", response.location()); - Assertions.assertEquals("uidvrmazlpdwwex", response.tags().get("mzvlazipbh")); - Assertions.assertEquals(628648988, response.servicePrecedence()); - Assertions.assertEquals(679051477, response.serviceQosPolicy().fiveQi()); - Assertions.assertEquals(214925420, response.serviceQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions.assertEquals(PreemptionCapability.MAY_PREEMPT, response.serviceQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.NOT_PREEMPTABLE, response.serviceQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("e", response.serviceQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("chkrttzr", response.serviceQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("isgykiuemvanbwz", response.pccRules().get(0).ruleName()); - Assertions.assertEquals(974039641, response.pccRules().get(0).rulePrecedence()); - Assertions.assertEquals(1069752468, response.pccRules().get(0).ruleQosPolicy().fiveQi()); - Assertions - .assertEquals(1367511614, response.pccRules().get(0).ruleQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.NOT_PREEMPT, response.pccRules().get(0).ruleQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.NOT_PREEMPTABLE, - response.pccRules().get(0).ruleQosPolicy().preemptionVulnerability()); - Assertions - .assertEquals("sprqsgnzxojpslsv", response.pccRules().get(0).ruleQosPolicy().maximumBitRate().uplink()); - Assertions.assertEquals("g", response.pccRules().get(0).ruleQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("rx", response.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().uplink()); - Assertions.assertEquals("bsojk", response.pccRules().get(0).ruleQosPolicy().guaranteedBitRate().downlink()); - Assertions.assertEquals(TrafficControlPermission.ENABLED, response.pccRules().get(0).trafficControl()); - Assertions.assertEquals("fiqwoy", response.pccRules().get(0).serviceDataFlowTemplates().get(0).templateName()); - Assertions - .assertEquals( - SdfDirection.UPLINK, response.pccRules().get(0).serviceDataFlowTemplates().get(0).direction()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesListByMobileNetworkMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesListByMobileNetworkMockTests.java deleted file mode 100644 index 1c692c52a81d..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesListByMobileNetworkMockTests.java +++ /dev/null @@ -1,130 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.SdfDirection; -import com.azure.resourcemanager.mobilenetwork.models.Service; -import com.azure.resourcemanager.mobilenetwork.models.TrafficControlPermission; -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 ServicesListByMobileNetworkMockTests { - @Test - public void testListByMobileNetwork() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"servicePrecedence\":2134240124,\"serviceQosPolicy\":{\"5qi\":855506019,\"allocationAndRetentionPriorityLevel\":641502467,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"maximumBitRate\":{\"uplink\":\"iqfyuttdi\",\"downlink\":\"gbpvnwswmtxkyct\"}},\"pccRules\":[{\"ruleName\":\"gzwx\",\"rulePrecedence\":237893727,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"cvogygzyvne\",\"downlink\":\"zaifghtmoqqtlff\"},\"5qi\":1354517943,\"allocationAndRetentionPriorityLevel\":1466697332,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"avfqnvhnqoewdogi\",\"downlink\":\"etesypvidbztjhqt\"}},\"trafficControl\":\"Blocked\",\"serviceDataFlowTemplates\":[{\"templateName\":\"nynkbwet\",\"direction\":\"Uplink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"uhpsprkzyaupia\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]}]},{\"ruleName\":\"xnafbw\",\"rulePrecedence\":274756384,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"htuov\",\"downlink\":\"aonurjtumg\"},\"5qi\":784380912,\"allocationAndRetentionPriorityLevel\":410392818,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"maximumBitRate\":{\"uplink\":\"lclblyjxltbsju\",\"downlink\":\"c\"}},\"trafficControl\":\"Enabled\",\"serviceDataFlowTemplates\":[{\"templateName\":\"igctmgxuupbezq\",\"direction\":\"Uplink\",\"protocol\":[],\"remoteIpList\":[]}]},{\"ruleName\":\"ydrtc\",\"rulePrecedence\":831620696,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"qkkyihztgeqmg\",\"downlink\":\"zgwldoychillcec\"},\"5qi\":635676325,\"allocationAndRetentionPriorityLevel\":1936925472,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"uhicqllizstacsjv\",\"downlink\":\"rweft\"}},\"trafficControl\":\"Blocked\",\"serviceDataFlowTemplates\":[{\"templateName\":\"jp\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"sse\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"epwamcxtcz\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"peuknijd\",\"direction\":\"Uplink\",\"protocol\":[],\"remoteIpList\":[]}]},{\"ruleName\":\"yespydjfbocyv\",\"rulePrecedence\":1551101543,\"ruleQosPolicy\":{\"guaranteedBitRate\":{\"uplink\":\"rtywi\",\"downlink\":\"dmhlakuflgbhgau\"},\"5qi\":1078455957,\"allocationAndRetentionPriorityLevel\":1587980465,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"maximumBitRate\":{\"uplink\":\"rs\",\"downlink\":\"yjq\"}},\"trafficControl\":\"Blocked\",\"serviceDataFlowTemplates\":[{\"templateName\":\"nozoeoq\",\"direction\":\"Uplink\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"jhvefgwbmqjchnt\",\"direction\":\"Bidirectional\",\"protocol\":[],\"remoteIpList\":[]},{\"templateName\":\"faymxbulpz\",\"direction\":\"Downlink\",\"protocol\":[],\"remoteIpList\":[]}]}]},\"location\":\"b\",\"tags\":{\"hxsgxj\":\"yojwyvfkmbtsu\",\"wsdrnpxqwodif\":\"mmzrrscub\",\"jogjonmc\":\"jxcjrmmuabwib\"},\"id\":\"e\",\"name\":\"oyzbamwineofvf\",\"type\":\"akpoldtvevbo\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.services().listByMobileNetwork("fgbrtt", "iac", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("b", response.iterator().next().location()); - Assertions.assertEquals("yojwyvfkmbtsu", response.iterator().next().tags().get("hxsgxj")); - Assertions.assertEquals(2134240124, response.iterator().next().servicePrecedence()); - Assertions.assertEquals(855506019, response.iterator().next().serviceQosPolicy().fiveQi()); - Assertions - .assertEquals( - 641502467, response.iterator().next().serviceQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.NOT_PREEMPT, response.iterator().next().serviceQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.PREEMPTABLE, - response.iterator().next().serviceQosPolicy().preemptionVulnerability()); - Assertions.assertEquals("iqfyuttdi", response.iterator().next().serviceQosPolicy().maximumBitRate().uplink()); - Assertions - .assertEquals("gbpvnwswmtxkyct", response.iterator().next().serviceQosPolicy().maximumBitRate().downlink()); - Assertions.assertEquals("gzwx", response.iterator().next().pccRules().get(0).ruleName()); - Assertions.assertEquals(237893727, response.iterator().next().pccRules().get(0).rulePrecedence()); - Assertions.assertEquals(1354517943, response.iterator().next().pccRules().get(0).ruleQosPolicy().fiveQi()); - Assertions - .assertEquals( - 1466697332, - response.iterator().next().pccRules().get(0).ruleQosPolicy().allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.MAY_PREEMPT, - response.iterator().next().pccRules().get(0).ruleQosPolicy().preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.NOT_PREEMPTABLE, - response.iterator().next().pccRules().get(0).ruleQosPolicy().preemptionVulnerability()); - Assertions - .assertEquals( - "avfqnvhnqoewdogi", - response.iterator().next().pccRules().get(0).ruleQosPolicy().maximumBitRate().uplink()); - Assertions - .assertEquals( - "etesypvidbztjhqt", - response.iterator().next().pccRules().get(0).ruleQosPolicy().maximumBitRate().downlink()); - Assertions - .assertEquals( - "cvogygzyvne", - response.iterator().next().pccRules().get(0).ruleQosPolicy().guaranteedBitRate().uplink()); - Assertions - .assertEquals( - "zaifghtmoqqtlff", - response.iterator().next().pccRules().get(0).ruleQosPolicy().guaranteedBitRate().downlink()); - Assertions - .assertEquals( - TrafficControlPermission.BLOCKED, response.iterator().next().pccRules().get(0).trafficControl()); - Assertions - .assertEquals( - "nynkbwet", - response.iterator().next().pccRules().get(0).serviceDataFlowTemplates().get(0).templateName()); - Assertions - .assertEquals( - SdfDirection.UPLINK, - response.iterator().next().pccRules().get(0).serviceDataFlowTemplates().get(0).direction()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimDeleteListTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimDeleteListTests.java deleted file mode 100644 index f6a979202c9d..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimDeleteListTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.SimDeleteList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SimDeleteListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SimDeleteList model = BinaryData.fromString("{\"sims\":[\"dvk\"]}").toObject(SimDeleteList.class); - Assertions.assertEquals("dvk", model.sims().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SimDeleteList model = new SimDeleteList().withSims(Arrays.asList("dvk")); - model = BinaryData.fromObject(model).toObject(SimDeleteList.class); - Assertions.assertEquals("dvk", model.sims().get(0)); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimGroupsDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimGroupsDeleteMockTests.java deleted file mode 100644 index 9a8fa289b6ee..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimGroupsDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 SimGroupsDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.simGroups().delete("dwnapf", "qwowftptnuw", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesCreateOrUpdateMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesCreateOrUpdateMockTests.java deleted file mode 100644 index b1b05cc37d85..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,184 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkResourceId; -import com.azure.resourcemanager.mobilenetwork.models.SimPolicy; -import com.azure.resourcemanager.mobilenetwork.models.SliceConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -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 SimPoliciesCreateOrUpdateMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"siteProvisioningState\":{\"oiqtamtyvskn\":\"Adding\",\"wzawnvsbcfhzagxn\":\"Adding\"},\"ueAmbr\":{\"uplink\":\"hycvdimwrzre\",\"downlink\":\"zgyufutrwp\"},\"defaultSlice\":{\"id\":\"eryekzkdhmeottaw\"},\"rfspIndex\":924161676,\"registrationTimer\":1538790173,\"sliceConfigurations\":[{\"slice\":{\"id\":\"whnhjtfv\"},\"defaultDataNetwork\":{\"id\":\"n\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"miljpnwynud\"},\"sessionAmbr\":{\"uplink\":\"llzsauz\",\"downlink\":\"jlxeehuxiqhz\"},\"allowedServices\":[]}]},{\"slice\":{\"id\":\"raymezx\"},\"defaultDataNetwork\":{\"id\":\"skihmxrfd\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"jrednwyysh\"},\"sessionAmbr\":{\"uplink\":\"uwg\",\"downlink\":\"evuafpwzyifrk\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"wltxeqipxgzdyims\"},\"sessionAmbr\":{\"uplink\":\"ayorprav\",\"downlink\":\"jogeslabnsmjkwyn\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"xa\"},\"sessionAmbr\":{\"uplink\":\"kqsykvwjtqpke\",\"downlink\":\"myltj\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"rspxklur\"},\"sessionAmbr\":{\"uplink\":\"clf\",\"downlink\":\"xa\"},\"allowedServices\":[]}]},{\"slice\":{\"id\":\"n\"},\"defaultDataNetwork\":{\"id\":\"oytzpose\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"igpxvkq\"},\"sessionAmbr\":{\"uplink\":\"aupxvpi\",\"downlink\":\"dfaifyzyzeyuube\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"ds\"},\"sessionAmbr\":{\"uplink\":\"l\",\"downlink\":\"ytoithgygvfl\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"gvdihoynkrxwetwk\"},\"sessionAmbr\":{\"uplink\":\"rcyrucpcunnu\",\"downlink\":\"dqumoenodnai\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"nhq\"},\"sessionAmbr\":{\"uplink\":\"skndnelqkaadlknw\",\"downlink\":\"oanniyopetxi\"},\"allowedServices\":[]}]}]},\"location\":\"nrlyxnuc\",\"tags\":{\"dtcjbctv\":\"hblkwqpatvbq\"},\"id\":\"vuzqymt\",\"name\":\"owog\",\"type\":\"gitsqh\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SimPolicy response = - manager - .simPolicies() - .define("qi") - .withRegion("btxjeaoqaqbzg") - .withExistingMobileNetwork("coqra", "wugyx") - .withUeAmbr(new Ambr().withUplink("xzak").withDownlink("ejkm")) - .withDefaultSlice(new SliceResourceId().withId("bizt")) - .withSliceConfigurations( - Arrays - .asList( - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("ovjufycsjmlbe")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("yeji")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("uxegthortudawlpj")) - .withSessionAmbr( - new Ambr().withUplink("elqerpp").withDownlink("cbgqnzmnhiil")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("alwcjgckbb")) - .withSessionAmbr( - new Ambr().withUplink("ccgzpraoxnyu").withDownlink("fa")) - .withAllowedServices(Arrays.asList()))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("sgftipwc")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("byubhiqdxyurnpn")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("zafccnuhiigb")) - .withSessionAmbr( - new Ambr().withUplink("lbuigv").withDownlink("vatvcrkd")) - .withAllowedServices(Arrays.asList()))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("b")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("bqxvhcsyhzlwxae")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("vurex")) - .withSessionAmbr( - new Ambr().withUplink("ndsbdw").withDownlink("aderzmw")) - .withAllowedServices(Arrays.asList()))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("t")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("pag")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("mvmmagoaqylkjz")) - .withSessionAmbr( - new Ambr().withUplink("jiuazjc").withDownlink("mxitpfinzcpd")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("tkrlgjmtbd")) - .withSessionAmbr( - new Ambr().withUplink("vcqguefzh").withDownlink("mpheqdur")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("lyujlfyoump")) - .withSessionAmbr( - new Ambr() - .withUplink("kyeclcdigpta") - .withDownlink("brzmqxucycijoclx")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("utgjcyz")) - .withSessionAmbr(new Ambr().withUplink("zjd").withDownlink("r")) - .withAllowedServices(Arrays.asList()))))) - .withTags(mapOf("v", "w", "e", "atbwbqam", "pkcvmwf", "liys", "pmywbormcq", "uxx")) - .withRfspIndex(1667946932) - .withRegistrationTimer(25286412) - .create(); - - Assertions.assertEquals("nrlyxnuc", response.location()); - Assertions.assertEquals("hblkwqpatvbq", response.tags().get("dtcjbctv")); - Assertions.assertEquals("hycvdimwrzre", response.ueAmbr().uplink()); - Assertions.assertEquals("zgyufutrwp", response.ueAmbr().downlink()); - Assertions.assertEquals("eryekzkdhmeottaw", response.defaultSlice().id()); - Assertions.assertEquals(924161676, response.rfspIndex()); - Assertions.assertEquals(1538790173, response.registrationTimer()); - Assertions.assertEquals("whnhjtfv", response.sliceConfigurations().get(0).slice().id()); - Assertions.assertEquals("n", response.sliceConfigurations().get(0).defaultDataNetwork().id()); - Assertions - .assertEquals( - "miljpnwynud", - response.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).dataNetwork().id()); - Assertions - .assertEquals( - "llzsauz", - response.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().uplink()); - Assertions - .assertEquals( - "jlxeehuxiqhz", - response.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().downlink()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesDeleteMockTests.java deleted file mode 100644 index 08f95a6cfae2..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 SimPoliciesDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.simPolicies().delete("ygzc", "yf", "x", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesGetWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesGetWithResponseMockTests.java deleted file mode 100644 index e98aa25d4574..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesGetWithResponseMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.SimPolicy; -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 SimPoliciesGetWithResponseMockTests { - @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\":{\"provisioningState\":\"Canceled\",\"siteProvisioningState\":{\"ceysfaqeg\":\"Adding\"},\"ueAmbr\":{\"uplink\":\"lwryshwddkvbxgkq\",\"downlink\":\"sybwptdaca\"},\"defaultSlice\":{\"id\":\"vvlfntymtp\"},\"rfspIndex\":1309536765,\"registrationTimer\":662572464,\"sliceConfigurations\":[{\"slice\":{\"id\":\"zerohzrsqalsxk\"},\"defaultDataNetwork\":{\"id\":\"nwqapfgsdpcvess\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"hhkuuip\"},\"sessionAmbr\":{\"uplink\":\"dqq\",\"downlink\":\"tekva\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"blhtjq\"},\"sessionAmbr\":{\"uplink\":\"qyv\",\"downlink\":\"eh\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"a\"},\"sessionAmbr\":{\"uplink\":\"mxhzzysevus\",\"downlink\":\"ivzrrryveimipsk\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"yzatvfuzkaft\"},\"sessionAmbr\":{\"uplink\":\"vvruxwi\",\"downlink\":\"syeipqd\"},\"allowedServices\":[]}]},{\"slice\":{\"id\":\"mjtgrqg\"},\"defaultDataNetwork\":{\"id\":\"gkkileplkcsmkn\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"tbbaedorvvmqf\"},\"sessionAmbr\":{\"uplink\":\"oygbdgwumgxd\",\"downlink\":\"dhp\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"bgd\"},\"sessionAmbr\":{\"uplink\":\"xjd\",\"downlink\":\"vjsaqwotm\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"wllcolsr\"},\"sessionAmbr\":{\"uplink\":\"xaptefhexcgjok\",\"downlink\":\"ljnhvlqj\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"ek\"},\"sessionAmbr\":{\"uplink\":\"eeksnbksdqhjvyk\",\"downlink\":\"xeslkhhustcpoqm\"},\"allowedServices\":[]}]},{\"slice\":{\"id\":\"vnwqjwgo\"},\"defaultDataNetwork\":{\"id\":\"nlejjjkxybwf\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"kjbztensvkzykj\"},\"sessionAmbr\":{\"uplink\":\"jknsxfwu\",\"downlink\":\"hcdpkupnqrmgj\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"bpkuwxeoio\"},\"sessionAmbr\":{\"uplink\":\"fiz\",\"downlink\":\"av\"},\"allowedServices\":[]}]}]},\"location\":\"zwfbcyaykmmfzs\",\"tags\":{\"bjazejwwviy\":\"xrzxmdewsrsxkrp\",\"suhbrnn\":\"y\",\"zycyqiqyhg\":\"jxsqwjhqkbiwetp\",\"zlex\":\"se\"},\"id\":\"sfledyn\",\"name\":\"jpziu\",\"type\":\"fbzkk\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SimPolicy response = - manager - .simPolicies() - .getWithResponse("faoytehqpuv", "mvqmtdwckygroej", "ndljdjuskbr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zwfbcyaykmmfzs", response.location()); - Assertions.assertEquals("xrzxmdewsrsxkrp", response.tags().get("bjazejwwviy")); - Assertions.assertEquals("lwryshwddkvbxgkq", response.ueAmbr().uplink()); - Assertions.assertEquals("sybwptdaca", response.ueAmbr().downlink()); - Assertions.assertEquals("vvlfntymtp", response.defaultSlice().id()); - Assertions.assertEquals(1309536765, response.rfspIndex()); - Assertions.assertEquals(662572464, response.registrationTimer()); - Assertions.assertEquals("zerohzrsqalsxk", response.sliceConfigurations().get(0).slice().id()); - Assertions.assertEquals("nwqapfgsdpcvess", response.sliceConfigurations().get(0).defaultDataNetwork().id()); - Assertions - .assertEquals( - "hhkuuip", response.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).dataNetwork().id()); - Assertions - .assertEquals( - "dqq", response.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().uplink()); - Assertions - .assertEquals( - "tekva", - response.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().downlink()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesListByMobileNetworkMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesListByMobileNetworkMockTests.java deleted file mode 100644 index 357b63172f10..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesListByMobileNetworkMockTests.java +++ /dev/null @@ -1,114 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.SimPolicy; -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 SimPoliciesListByMobileNetworkMockTests { - @Test - public void testListByMobileNetwork() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"siteProvisioningState\":{\"ylcc\":\"Deleting\"},\"ueAmbr\":{\"uplink\":\"evxrhyz\",\"downlink\":\"fwrsofpltdbmair\"},\"defaultSlice\":{\"id\":\"hvhfnracw\"},\"rfspIndex\":1723621906,\"registrationTimer\":189921644,\"sliceConfigurations\":[{\"slice\":{\"id\":\"uuj\"},\"defaultDataNetwork\":{\"id\":\"ouhdawsigrb\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"xsjybvitvqk\"},\"sessionAmbr\":{\"uplink\":\"y\",\"downlink\":\"znumtggmuwdchoz\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"nkf\"},\"sessionAmbr\":{\"uplink\":\"xlvxnoakiz\",\"downlink\":\"oaiknaqlnuwig\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"yxl\"},\"sessionAmbr\":{\"uplink\":\"kwph\",\"downlink\":\"xzcwxhmpejt\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"ke\"},\"sessionAmbr\":{\"uplink\":\"aonwivkcqhrxh\",\"downlink\":\"knlccrmmkyup\"},\"allowedServices\":[]}]},{\"slice\":{\"id\":\"jubyqjfkakfq\"},\"defaultDataNetwork\":{\"id\":\"rke\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"il\"},\"sessionAmbr\":{\"uplink\":\"udxjascowv\",\"downlink\":\"djkpdxph\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"kk\"},\"sessionAmbr\":{\"uplink\":\"nmgzvyfijdkzuqnw\",\"downlink\":\"it\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"uqoly\"},\"sessionAmbr\":{\"uplink\":\"hluqwquls\",\"downlink\":\"trjbhxykfhyq\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"zvqqugdrftbcvexr\"},\"sessionAmbr\":{\"uplink\":\"uquowtljvfwhr\",\"downlink\":\"agk\"},\"allowedServices\":[]}]}]},\"location\":\"xv\",\"tags\":{\"lmepjpf\":\"vbczsulmdg\",\"g\":\"eykgsangpszngaf\",\"ujcngo\":\"lkvec\"},\"id\":\"dyedmzrgjfo\",\"name\":\"nub\",\"type\":\"oitpkpztrgdgx\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.simPolicies().listByMobileNetwork("tnhqsycl", "selpkpbaf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xv", response.iterator().next().location()); - Assertions.assertEquals("vbczsulmdg", response.iterator().next().tags().get("lmepjpf")); - Assertions.assertEquals("evxrhyz", response.iterator().next().ueAmbr().uplink()); - Assertions.assertEquals("fwrsofpltdbmair", response.iterator().next().ueAmbr().downlink()); - Assertions.assertEquals("hvhfnracw", response.iterator().next().defaultSlice().id()); - Assertions.assertEquals(1723621906, response.iterator().next().rfspIndex()); - Assertions.assertEquals(189921644, response.iterator().next().registrationTimer()); - Assertions.assertEquals("uuj", response.iterator().next().sliceConfigurations().get(0).slice().id()); - Assertions - .assertEquals( - "ouhdawsigrb", response.iterator().next().sliceConfigurations().get(0).defaultDataNetwork().id()); - Assertions - .assertEquals( - "xsjybvitvqk", - response - .iterator() - .next() - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .dataNetwork() - .id()); - Assertions - .assertEquals( - "y", - response - .iterator() - .next() - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .sessionAmbr() - .uplink()); - Assertions - .assertEquals( - "znumtggmuwdchoz", - response - .iterator() - .next() - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .sessionAmbr() - .downlink()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyInnerTests.java deleted file mode 100644 index ad405b2a1628..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyInnerTests.java +++ /dev/null @@ -1,344 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.SimPolicyInner; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkResourceId; -import com.azure.resourcemanager.mobilenetwork.models.PduSessionType; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.ServiceResourceId; -import com.azure.resourcemanager.mobilenetwork.models.SliceConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SimPolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SimPolicyInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Unknown\",\"siteProvisioningState\":{\"bsdshmkxmaehvbbx\":\"Provisioned\",\"iplt\":\"NotApplicable\"},\"ueAmbr\":{\"uplink\":\"n\",\"downlink\":\"tbaxk\"},\"defaultSlice\":{\"id\":\"xywr\"},\"rfspIndex\":1619197472,\"registrationTimer\":479149992,\"sliceConfigurations\":[{\"slice\":{\"id\":\"yhpluodpvruudlgz\"},\"defaultDataNetwork\":{\"id\":\"bth\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"tgk\"},\"sessionAmbr\":{\"uplink\":\"stvdxeclz\",\"downlink\":\"dqbcvhzlhplod\"},\"5qi\":1140864864,\"allocationAndRetentionPriorityLevel\":1592538634,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv6\",\"additionalAllowedSessionTypes\":[\"IPv4\",\"IPv6\"],\"allowedServices\":[{\"id\":\"qjfsmlmbtxhw\"},{\"id\":\"fwsrtawcoezbrhu\"}],\"maximumNumberOfBufferedPackets\":518235624},{\"dataNetwork\":{\"id\":\"hud\"},\"sessionAmbr\":{\"uplink\":\"goo\",\"downlink\":\"kkqfqjbvle\"},\"5qi\":1730138654,\"allocationAndRetentionPriorityLevel\":1618097313,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv4\",\"additionalAllowedSessionTypes\":[\"IPv4\",\"IPv6\",\"IPv6\"],\"allowedServices\":[{\"id\":\"qqybarye\"},{\"id\":\"ayjkqa\"}],\"maximumNumberOfBufferedPackets\":2002865497}]},{\"slice\":{\"id\":\"zslesjcbher\"},\"defaultDataNetwork\":{\"id\":\"ntiew\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"cv\"},\"sessionAmbr\":{\"uplink\":\"quwrbehwag\",\"downlink\":\"hbuffkmrq\"},\"5qi\":226189444,\"allocationAndRetentionPriorityLevel\":1393141923,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv6\",\"additionalAllowedSessionTypes\":[\"IPv4\",\"IPv4\"],\"allowedServices\":[{\"id\":\"oe\"},{\"id\":\"jvewzcjznmwcp\"},{\"id\":\"guaadraufactkahz\"}],\"maximumNumberOfBufferedPackets\":1219742698}]},{\"slice\":{\"id\":\"jjziuxxpsh\"},\"defaultDataNetwork\":{\"id\":\"eekulfgslqubkwd\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"nrdsutujbazpjuoh\"},\"sessionAmbr\":{\"uplink\":\"inyflnorwmduvwp\",\"downlink\":\"lvxwmyg\"},\"5qi\":1521698279,\"allocationAndRetentionPriorityLevel\":181907688,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv4\",\"additionalAllowedSessionTypes\":[\"IPv4\",\"IPv4\"],\"allowedServices\":[{\"id\":\"jcrxgibbdaxcon\"},{\"id\":\"ozauorsukokwb\"},{\"id\":\"plhlvnuuepzlrp\"},{\"id\":\"wzsoldweyuqdunv\"}],\"maximumNumberOfBufferedPackets\":221136034}]},{\"slice\":{\"id\":\"rwrbi\"},\"defaultDataNetwork\":{\"id\":\"rk\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"lywjhh\"},\"sessionAmbr\":{\"uplink\":\"dnhxmsi\",\"downlink\":\"fomiloxgg\"},\"5qi\":524951220,\"allocationAndRetentionPriorityLevel\":75081100,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv6\",\"additionalAllowedSessionTypes\":[\"IPv4\",\"IPv4\",\"IPv6\"],\"allowedServices\":[{\"id\":\"vcyy\"},{\"id\":\"s\"},{\"id\":\"gdotcubiipuipwo\"}],\"maximumNumberOfBufferedPackets\":1120696384},{\"dataNetwork\":{\"id\":\"macjekn\"},\"sessionAmbr\":{\"uplink\":\"zshq\",\"downlink\":\"cimpevfg\"},\"5qi\":910650574,\"allocationAndRetentionPriorityLevel\":1947593422,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv4\",\"additionalAllowedSessionTypes\":[\"IPv6\",\"IPv4\",\"IPv4\"],\"allowedServices\":[{\"id\":\"wrwfscjfnyns\"},{\"id\":\"qujizdvo\"}],\"maximumNumberOfBufferedPackets\":918297012},{\"dataNetwork\":{\"id\":\"ibyowbblgyavutp\"},\"sessionAmbr\":{\"uplink\":\"hjoxo\",\"downlink\":\"smsks\"},\"5qi\":791689891,\"allocationAndRetentionPriorityLevel\":1015646968,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"defaultSessionType\":\"IPv6\",\"additionalAllowedSessionTypes\":[\"IPv6\",\"IPv4\",\"IPv4\",\"IPv6\"],\"allowedServices\":[{\"id\":\"ffgcvizqz\"},{\"id\":\"wlvwlyoupf\"},{\"id\":\"fbkjubdyhgkfmi\"}],\"maximumNumberOfBufferedPackets\":87584157}]}]},\"location\":\"wzf\",\"tags\":{\"ctxtgzukxi\":\"ttktlahbq\",\"xrxc\":\"mmqtgqqqxhr\",\"azivjlfrqttbajl\":\"juisavokqdzf\"},\"id\":\"atnwxyiopi\",\"name\":\"kqqfk\",\"type\":\"vscx\"}") - .toObject(SimPolicyInner.class); - Assertions.assertEquals("wzf", model.location()); - Assertions.assertEquals("ttktlahbq", model.tags().get("ctxtgzukxi")); - Assertions.assertEquals("n", model.ueAmbr().uplink()); - Assertions.assertEquals("tbaxk", model.ueAmbr().downlink()); - Assertions.assertEquals("xywr", model.defaultSlice().id()); - Assertions.assertEquals(1619197472, model.rfspIndex()); - Assertions.assertEquals(479149992, model.registrationTimer()); - Assertions.assertEquals("yhpluodpvruudlgz", model.sliceConfigurations().get(0).slice().id()); - Assertions.assertEquals("bth", model.sliceConfigurations().get(0).defaultDataNetwork().id()); - Assertions - .assertEquals( - "tgk", model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).dataNetwork().id()); - Assertions - .assertEquals( - "stvdxeclz", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().uplink()); - Assertions - .assertEquals( - "dqbcvhzlhplod", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().downlink()); - Assertions - .assertEquals(1140864864, model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).fiveQi()); - Assertions - .assertEquals( - 1592538634, - model - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.MAY_PREEMPT, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.NOT_PREEMPTABLE, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).preemptionVulnerability()); - Assertions - .assertEquals( - PduSessionType.IPV6, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).defaultSessionType()); - Assertions - .assertEquals( - PduSessionType.IPV4, - model - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .additionalAllowedSessionTypes() - .get(0)); - Assertions - .assertEquals( - "qjfsmlmbtxhw", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).allowedServices().get(0).id()); - Assertions - .assertEquals( - 518235624, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).maximumNumberOfBufferedPackets()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SimPolicyInner model = - new SimPolicyInner() - .withLocation("wzf") - .withTags(mapOf("ctxtgzukxi", "ttktlahbq", "xrxc", "mmqtgqqqxhr", "azivjlfrqttbajl", "juisavokqdzf")) - .withUeAmbr(new Ambr().withUplink("n").withDownlink("tbaxk")) - .withDefaultSlice(new SliceResourceId().withId("xywr")) - .withRfspIndex(1619197472) - .withRegistrationTimer(479149992) - .withSliceConfigurations( - Arrays - .asList( - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("yhpluodpvruudlgz")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("bth")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("tgk")) - .withSessionAmbr( - new Ambr().withUplink("stvdxeclz").withDownlink("dqbcvhzlhplod")) - .withFiveQi(1140864864) - .withAllocationAndRetentionPriorityLevel(1592538634) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV6) - .withAdditionalAllowedSessionTypes( - Arrays.asList(PduSessionType.IPV4, PduSessionType.IPV6)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("qjfsmlmbtxhw"), - new ServiceResourceId().withId("fwsrtawcoezbrhu"))) - .withMaximumNumberOfBufferedPackets(518235624), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("hud")) - .withSessionAmbr( - new Ambr().withUplink("goo").withDownlink("kkqfqjbvle")) - .withFiveQi(1730138654) - .withAllocationAndRetentionPriorityLevel(1618097313) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV4) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV4, - PduSessionType.IPV6, - PduSessionType.IPV6)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("qqybarye"), - new ServiceResourceId().withId("ayjkqa"))) - .withMaximumNumberOfBufferedPackets(2002865497))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("zslesjcbher")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("ntiew")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("cv")) - .withSessionAmbr( - new Ambr().withUplink("quwrbehwag").withDownlink("hbuffkmrq")) - .withFiveQi(226189444) - .withAllocationAndRetentionPriorityLevel(1393141923) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV6) - .withAdditionalAllowedSessionTypes( - Arrays.asList(PduSessionType.IPV4, PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("oe"), - new ServiceResourceId().withId("jvewzcjznmwcp"), - new ServiceResourceId().withId("guaadraufactkahz"))) - .withMaximumNumberOfBufferedPackets(1219742698))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("jjziuxxpsh")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("eekulfgslqubkwd")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("nrdsutujbazpjuoh")) - .withSessionAmbr( - new Ambr().withUplink("inyflnorwmduvwp").withDownlink("lvxwmyg")) - .withFiveQi(1521698279) - .withAllocationAndRetentionPriorityLevel(181907688) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV4) - .withAdditionalAllowedSessionTypes( - Arrays.asList(PduSessionType.IPV4, PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("jcrxgibbdaxcon"), - new ServiceResourceId().withId("ozauorsukokwb"), - new ServiceResourceId().withId("plhlvnuuepzlrp"), - new ServiceResourceId().withId("wzsoldweyuqdunv"))) - .withMaximumNumberOfBufferedPackets(221136034))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("rwrbi")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("rk")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("lywjhh")) - .withSessionAmbr( - new Ambr().withUplink("dnhxmsi").withDownlink("fomiloxgg")) - .withFiveQi(524951220) - .withAllocationAndRetentionPriorityLevel(75081100) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV6) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV4, - PduSessionType.IPV4, - PduSessionType.IPV6)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("vcyy"), - new ServiceResourceId().withId("s"), - new ServiceResourceId().withId("gdotcubiipuipwo"))) - .withMaximumNumberOfBufferedPackets(1120696384), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("macjekn")) - .withSessionAmbr(new Ambr().withUplink("zshq").withDownlink("cimpevfg")) - .withFiveQi(910650574) - .withAllocationAndRetentionPriorityLevel(1947593422) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV4) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV6, - PduSessionType.IPV4, - PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("wrwfscjfnyns"), - new ServiceResourceId().withId("qujizdvo"))) - .withMaximumNumberOfBufferedPackets(918297012), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("ibyowbblgyavutp")) - .withSessionAmbr(new Ambr().withUplink("hjoxo").withDownlink("smsks")) - .withFiveQi(791689891) - .withAllocationAndRetentionPriorityLevel(1015646968) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV6) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV6, - PduSessionType.IPV4, - PduSessionType.IPV4, - PduSessionType.IPV6)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("ffgcvizqz"), - new ServiceResourceId().withId("wlvwlyoupf"), - new ServiceResourceId().withId("fbkjubdyhgkfmi"))) - .withMaximumNumberOfBufferedPackets(87584157))))); - model = BinaryData.fromObject(model).toObject(SimPolicyInner.class); - Assertions.assertEquals("wzf", model.location()); - Assertions.assertEquals("ttktlahbq", model.tags().get("ctxtgzukxi")); - Assertions.assertEquals("n", model.ueAmbr().uplink()); - Assertions.assertEquals("tbaxk", model.ueAmbr().downlink()); - Assertions.assertEquals("xywr", model.defaultSlice().id()); - Assertions.assertEquals(1619197472, model.rfspIndex()); - Assertions.assertEquals(479149992, model.registrationTimer()); - Assertions.assertEquals("yhpluodpvruudlgz", model.sliceConfigurations().get(0).slice().id()); - Assertions.assertEquals("bth", model.sliceConfigurations().get(0).defaultDataNetwork().id()); - Assertions - .assertEquals( - "tgk", model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).dataNetwork().id()); - Assertions - .assertEquals( - "stvdxeclz", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().uplink()); - Assertions - .assertEquals( - "dqbcvhzlhplod", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().downlink()); - Assertions - .assertEquals(1140864864, model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).fiveQi()); - Assertions - .assertEquals( - 1592538634, - model - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.MAY_PREEMPT, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.NOT_PREEMPTABLE, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).preemptionVulnerability()); - Assertions - .assertEquals( - PduSessionType.IPV6, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).defaultSessionType()); - Assertions - .assertEquals( - PduSessionType.IPV4, - model - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .additionalAllowedSessionTypes() - .get(0)); - Assertions - .assertEquals( - "qjfsmlmbtxhw", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).allowedServices().get(0).id()); - Assertions - .assertEquals( - 518235624, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).maximumNumberOfBufferedPackets()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyListResultTests.java deleted file mode 100644 index 3629e817e3e5..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyListResultTests.java +++ /dev/null @@ -1,348 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.SimPolicyInner; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkResourceId; -import com.azure.resourcemanager.mobilenetwork.models.SimPolicyListResult; -import com.azure.resourcemanager.mobilenetwork.models.SliceConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SimPolicyListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SimPolicyListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"siteProvisioningState\":{\"jaffmmfblcqcuu\":\"Adding\",\"qibrtalme\":\"Failed\",\"t\":\"Failed\"},\"ueAmbr\":{\"uplink\":\"gdslqxihhrmoo\",\"downlink\":\"z\"},\"defaultSlice\":{\"id\":\"seypxiutcxapz\"},\"rfspIndex\":1318130137,\"registrationTimer\":1111738970,\"sliceConfigurations\":[{\"slice\":{\"id\":\"o\"},\"defaultDataNetwork\":{\"id\":\"e\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"oxslh\"},\"sessionAmbr\":{\"uplink\":\"nhl\",\"downlink\":\"brqnkkzjcjb\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"rgaehvvibrxjj\"},\"sessionAmbr\":{\"uplink\":\"toqbeitpkxztmoob\",\"downlink\":\"lftidgfcwqmpim\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"qxzhem\"},\"sessionAmbr\":{\"uplink\":\"yhohujswtwkozzwc\",\"downlink\":\"lkb\"},\"allowedServices\":[]}]},{\"slice\":{\"id\":\"wpfaj\"},\"defaultDataNetwork\":{\"id\":\"jwltlwtjjgu\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"alhsnvkc\"},\"sessionAmbr\":{\"uplink\":\"mxzrpoa\",\"downlink\":\"mlnwiaaomylweazu\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"cse\"},\"sessionAmbr\":{\"uplink\":\"hwwn\",\"downlink\":\"jhlfzswpchwahf\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"ousnfepgfewe\"},\"sessionAmbr\":{\"uplink\":\"wlyxgncxyk\",\"downlink\":\"hdjhlimmbcx\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"h\"},\"sessionAmbr\":{\"uplink\":\"cporxvxcjz\",\"downlink\":\"qizxfpxtgqscjavf\"},\"allowedServices\":[]}]},{\"slice\":{\"id\":\"juhdqazkmtgguwpi\"},\"defaultDataNetwork\":{\"id\":\"r\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"civmmg\"},\"sessionAmbr\":{\"uplink\":\"f\",\"downlink\":\"fiwrxgkn\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"uvyinzqodfvpgs\"},\"sessionAmbr\":{\"uplink\":\"oxgsgbpfgzdjtx\",\"downlink\":\"zflbqvg\"},\"allowedServices\":[]}]}]},\"location\":\"vl\",\"tags\":{\"vetnwsdtutn\":\"cqusr\"},\"id\":\"lduycv\",\"name\":\"zhyrmewipmve\",\"type\":\"dxukuqgsjjxundxg\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"siteProvisioningState\":{\"hzjhf\":\"Deleting\",\"hvvmuvgpmun\":\"Failed\",\"sx\":\"NotApplicable\",\"hfbuzjyihsasbhud\":\"Adding\"},\"ueAmbr\":{\"uplink\":\"pohyuemslynsqyr\",\"downlink\":\"foobrlttyms\"},\"defaultSlice\":{\"id\":\"nygq\"},\"rfspIndex\":1366289055,\"registrationTimer\":986277752,\"sliceConfigurations\":[{\"slice\":{\"id\":\"dzgtil\"},\"defaultDataNetwork\":{\"id\":\"xhnfhqly\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"jouw\"},\"sessionAmbr\":{\"uplink\":\"vk\",\"downlink\":\"oyzunbixxr\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"ikvcpwp\"},\"sessionAmbr\":{\"uplink\":\"clrcivtsox\",\"downlink\":\"rkenx\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"m\"},\"sessionAmbr\":{\"uplink\":\"yefrpmpdnqqska\",\"downlink\":\"ao\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"vmm\"},\"sessionAmbr\":{\"uplink\":\"npqfrtqlkzmeg\",\"downlink\":\"itgvkx\"},\"allowedServices\":[]}]},{\"slice\":{\"id\":\"zyqdrfegcealzx\"},\"defaultDataNetwork\":{\"id\":\"hcans\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"oyqhlwig\"},\"sessionAmbr\":{\"uplink\":\"ivbkbxgomfaj\",\"downlink\":\"wasqvdaeyyg\"},\"allowedServices\":[]}]},{\"slice\":{\"id\":\"xakjsqzhzb\"},\"defaultDataNetwork\":{\"id\":\"zkgimsid\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"sicddyvv\"},\"sessionAmbr\":{\"uplink\":\"skgfmocwahpq\",\"downlink\":\"atjeaahh\"},\"allowedServices\":[]}]},{\"slice\":{\"id\":\"jhhn\"},\"defaultDataNetwork\":{\"id\":\"kzyb\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"jid\"},\"sessionAmbr\":{\"uplink\":\"ksyxkyxvxevblbje\",\"downlink\":\"nljlageuaulx\"},\"allowedServices\":[]},{\"dataNetwork\":{\"id\":\"nsmjbnkppxynen\"},\"sessionAmbr\":{\"uplink\":\"svxeizzgwklnsr\",\"downlink\":\"ffeycx\"},\"allowedServices\":[]}]}]},\"location\":\"tpiymerteea\",\"tags\":{\"g\":\"qiekkkzddrt\",\"vrefdeesv\":\"ojbmxv\",\"s\":\"cuijpxt\",\"wsawddjibabxvi\":\"wprtu\"},\"id\":\"itvtzeexavo\",\"name\":\"tfgle\",\"type\":\"dmdqb\"}],\"nextLink\":\"ypq\"}") - .toObject(SimPolicyListResult.class); - Assertions.assertEquals("vl", model.value().get(0).location()); - Assertions.assertEquals("cqusr", model.value().get(0).tags().get("vetnwsdtutn")); - Assertions.assertEquals("gdslqxihhrmoo", model.value().get(0).ueAmbr().uplink()); - Assertions.assertEquals("z", model.value().get(0).ueAmbr().downlink()); - Assertions.assertEquals("seypxiutcxapz", model.value().get(0).defaultSlice().id()); - Assertions.assertEquals(1318130137, model.value().get(0).rfspIndex()); - Assertions.assertEquals(1111738970, model.value().get(0).registrationTimer()); - Assertions.assertEquals("o", model.value().get(0).sliceConfigurations().get(0).slice().id()); - Assertions.assertEquals("e", model.value().get(0).sliceConfigurations().get(0).defaultDataNetwork().id()); - Assertions - .assertEquals( - "oxslh", - model - .value() - .get(0) - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .dataNetwork() - .id()); - Assertions - .assertEquals( - "nhl", - model - .value() - .get(0) - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .sessionAmbr() - .uplink()); - Assertions - .assertEquals( - "brqnkkzjcjb", - model - .value() - .get(0) - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .sessionAmbr() - .downlink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SimPolicyListResult model = - new SimPolicyListResult() - .withValue( - Arrays - .asList( - new SimPolicyInner() - .withLocation("vl") - .withTags(mapOf("vetnwsdtutn", "cqusr")) - .withUeAmbr(new Ambr().withUplink("gdslqxihhrmoo").withDownlink("z")) - .withDefaultSlice(new SliceResourceId().withId("seypxiutcxapz")) - .withRfspIndex(1318130137) - .withRegistrationTimer(1111738970) - .withSliceConfigurations( - Arrays - .asList( - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("o")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("e")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("oxslh")) - .withSessionAmbr( - new Ambr() - .withUplink("nhl") - .withDownlink("brqnkkzjcjb")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("rgaehvvibrxjj")) - .withSessionAmbr( - new Ambr() - .withUplink("toqbeitpkxztmoob") - .withDownlink("lftidgfcwqmpim")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("qxzhem")) - .withSessionAmbr( - new Ambr() - .withUplink("yhohujswtwkozzwc") - .withDownlink("lkb")) - .withAllowedServices(Arrays.asList()))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("wpfaj")) - .withDefaultDataNetwork( - new DataNetworkResourceId().withId("jwltlwtjjgu")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("alhsnvkc")) - .withSessionAmbr( - new Ambr() - .withUplink("mxzrpoa") - .withDownlink("mlnwiaaomylweazu")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("cse")) - .withSessionAmbr( - new Ambr() - .withUplink("hwwn") - .withDownlink("jhlfzswpchwahf")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("ousnfepgfewe")) - .withSessionAmbr( - new Ambr() - .withUplink("wlyxgncxyk") - .withDownlink("hdjhlimmbcx")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("h")) - .withSessionAmbr( - new Ambr() - .withUplink("cporxvxcjz") - .withDownlink("qizxfpxtgqscjavf")) - .withAllowedServices(Arrays.asList()))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("juhdqazkmtgguwpi")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("r")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("civmmg")) - .withSessionAmbr( - new Ambr().withUplink("f").withDownlink("fiwrxgkn")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId() - .withId("uvyinzqodfvpgs")) - .withSessionAmbr( - new Ambr() - .withUplink("oxgsgbpfgzdjtx") - .withDownlink("zflbqvg")) - .withAllowedServices(Arrays.asList()))))), - new SimPolicyInner() - .withLocation("tpiymerteea") - .withTags( - mapOf( - "g", - "qiekkkzddrt", - "vrefdeesv", - "ojbmxv", - "s", - "cuijpxt", - "wsawddjibabxvi", - "wprtu")) - .withUeAmbr(new Ambr().withUplink("pohyuemslynsqyr").withDownlink("foobrlttyms")) - .withDefaultSlice(new SliceResourceId().withId("nygq")) - .withRfspIndex(1366289055) - .withRegistrationTimer(986277752) - .withSliceConfigurations( - Arrays - .asList( - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("dzgtil")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("xhnfhqly")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("jouw")) - .withSessionAmbr( - new Ambr() - .withUplink("vk") - .withDownlink("oyzunbixxr")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("ikvcpwp")) - .withSessionAmbr( - new Ambr() - .withUplink("clrcivtsox") - .withDownlink("rkenx")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("m")) - .withSessionAmbr( - new Ambr() - .withUplink("yefrpmpdnqqska") - .withDownlink("ao")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("vmm")) - .withSessionAmbr( - new Ambr() - .withUplink("npqfrtqlkzmeg") - .withDownlink("itgvkx")) - .withAllowedServices(Arrays.asList()))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("zyqdrfegcealzx")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("hcans")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("oyqhlwig")) - .withSessionAmbr( - new Ambr() - .withUplink("ivbkbxgomfaj") - .withDownlink("wasqvdaeyyg")) - .withAllowedServices(Arrays.asList()))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("xakjsqzhzb")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("zkgimsid")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("sicddyvv")) - .withSessionAmbr( - new Ambr() - .withUplink("skgfmocwahpq") - .withDownlink("atjeaahh")) - .withAllowedServices(Arrays.asList()))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("jhhn")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("kzyb")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId().withId("jid")) - .withSessionAmbr( - new Ambr() - .withUplink("ksyxkyxvxevblbje") - .withDownlink("nljlageuaulx")) - .withAllowedServices(Arrays.asList()), - new DataNetworkConfiguration() - .withDataNetwork( - new DataNetworkResourceId() - .withId("nsmjbnkppxynen")) - .withSessionAmbr( - new Ambr() - .withUplink("svxeizzgwklnsr") - .withDownlink("ffeycx")) - .withAllowedServices(Arrays.asList()))))))); - model = BinaryData.fromObject(model).toObject(SimPolicyListResult.class); - Assertions.assertEquals("vl", model.value().get(0).location()); - Assertions.assertEquals("cqusr", model.value().get(0).tags().get("vetnwsdtutn")); - Assertions.assertEquals("gdslqxihhrmoo", model.value().get(0).ueAmbr().uplink()); - Assertions.assertEquals("z", model.value().get(0).ueAmbr().downlink()); - Assertions.assertEquals("seypxiutcxapz", model.value().get(0).defaultSlice().id()); - Assertions.assertEquals(1318130137, model.value().get(0).rfspIndex()); - Assertions.assertEquals(1111738970, model.value().get(0).registrationTimer()); - Assertions.assertEquals("o", model.value().get(0).sliceConfigurations().get(0).slice().id()); - Assertions.assertEquals("e", model.value().get(0).sliceConfigurations().get(0).defaultDataNetwork().id()); - Assertions - .assertEquals( - "oxslh", - model - .value() - .get(0) - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .dataNetwork() - .id()); - Assertions - .assertEquals( - "nhl", - model - .value() - .get(0) - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .sessionAmbr() - .uplink()); - Assertions - .assertEquals( - "brqnkkzjcjb", - model - .value() - .get(0) - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .sessionAmbr() - .downlink()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyPropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyPropertiesFormatTests.java deleted file mode 100644 index ef9dad5da8cf..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyPropertiesFormatTests.java +++ /dev/null @@ -1,379 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.SimPolicyPropertiesFormat; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkResourceId; -import com.azure.resourcemanager.mobilenetwork.models.PduSessionType; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.ServiceResourceId; -import com.azure.resourcemanager.mobilenetwork.models.SliceConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SimPolicyPropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SimPolicyPropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Unknown\",\"siteProvisioningState\":{\"ovibrxkp\":\"Updating\",\"oaz\":\"Provisioned\"},\"ueAmbr\":{\"uplink\":\"ruocbgo\",\"downlink\":\"rb\"},\"defaultSlice\":{\"id\":\"eoybfhjxakvvjgs\"},\"rfspIndex\":36886384,\"registrationTimer\":417144058,\"sliceConfigurations\":[{\"slice\":{\"id\":\"mywwtkgkxnyed\"},\"defaultDataNetwork\":{\"id\":\"b\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"vudtjuewbcihx\"},\"sessionAmbr\":{\"uplink\":\"uwhcjyxccybv\",\"downlink\":\"ayakkudzpx\"},\"5qi\":431593989,\"allocationAndRetentionPriorityLevel\":710163355,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"defaultSessionType\":\"IPv6\",\"additionalAllowedSessionTypes\":[\"IPv6\",\"IPv6\",\"IPv4\",\"IPv4\"],\"allowedServices\":[{\"id\":\"rkdbdgiogsjkmnwq\"},{\"id\":\"nobaiyhddviacegf\"},{\"id\":\"m\"},{\"id\":\"tfpmvmemfnczdw\"}],\"maximumNumberOfBufferedPackets\":201856710},{\"dataNetwork\":{\"id\":\"alxlllchp\"},\"sessionAmbr\":{\"uplink\":\"db\",\"downlink\":\"evwrdnhfuk\"},\"5qi\":1934709471,\"allocationAndRetentionPriorityLevel\":437386763,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv4\",\"additionalAllowedSessionTypes\":[\"IPv6\",\"IPv6\"],\"allowedServices\":[{\"id\":\"ypfcvlerchpqbmf\"},{\"id\":\"jbabwidf\"}],\"maximumNumberOfBufferedPackets\":1264081959},{\"dataNetwork\":{\"id\":\"spuunnoxyhkxgq\"},\"sessionAmbr\":{\"uplink\":\"drihpfhoqcaaewda\",\"downlink\":\"mdjvlpj\"},\"5qi\":1119660278,\"allocationAndRetentionPriorityLevel\":785056478,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"defaultSessionType\":\"IPv4\",\"additionalAllowedSessionTypes\":[\"IPv6\",\"IPv6\",\"IPv6\",\"IPv4\"],\"allowedServices\":[{\"id\":\"dncj\"},{\"id\":\"xonbzoggculapz\"}],\"maximumNumberOfBufferedPackets\":350819792}]},{\"slice\":{\"id\":\"pgogtqxepny\"},\"defaultDataNetwork\":{\"id\":\"b\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"ajlyjtlvofqzhv\"},\"sessionAmbr\":{\"uplink\":\"cib\",\"downlink\":\"fmo\"},\"5qi\":1885560912,\"allocationAndRetentionPriorityLevel\":2073572107,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv4\",\"additionalAllowedSessionTypes\":[\"IPv6\",\"IPv6\",\"IPv6\",\"IPv4\"],\"allowedServices\":[{\"id\":\"zjb\"},{\"id\":\"yzsxjrkambtrne\"}],\"maximumNumberOfBufferedPackets\":1525920075},{\"dataNetwork\":{\"id\":\"nvuqeqvldspa\"},\"sessionAmbr\":{\"uplink\":\"tjb\",\"downlink\":\"kdmflvestmjlx\"},\"5qi\":1811256055,\"allocationAndRetentionPriorityLevel\":1713301534,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"defaultSessionType\":\"IPv4\",\"additionalAllowedSessionTypes\":[\"IPv6\",\"IPv6\",\"IPv6\",\"IPv6\"],\"allowedServices\":[{\"id\":\"wk\"},{\"id\":\"ziycslevufuztck\"},{\"id\":\"yhjtqedcgzu\"}],\"maximumNumberOfBufferedPackets\":1160577956}]},{\"slice\":{\"id\":\"mrqzzrrjvpgl\"},\"defaultDataNetwork\":{\"id\":\"dzgkr\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"eevt\"},\"sessionAmbr\":{\"uplink\":\"epr\",\"downlink\":\"utnwytpzdmovzvf\"},\"5qi\":1925116648,\"allocationAndRetentionPriorityLevel\":1341644400,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv6\",\"additionalAllowedSessionTypes\":[\"IPv4\"],\"allowedServices\":[{\"id\":\"glae\"},{\"id\":\"xndticokpvzmlqtm\"}],\"maximumNumberOfBufferedPackets\":763019330},{\"dataNetwork\":{\"id\":\"x\"},\"sessionAmbr\":{\"uplink\":\"bf\",\"downlink\":\"rclnpkc\"},\"5qi\":1931804941,\"allocationAndRetentionPriorityLevel\":1808660907,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv6\",\"additionalAllowedSessionTypes\":[\"IPv6\",\"IPv4\",\"IPv6\",\"IPv4\"],\"allowedServices\":[{\"id\":\"xqvkjlmxhomdyn\"},{\"id\":\"dwdigumb\"},{\"id\":\"raauzzpt\"},{\"id\":\"a\"}],\"maximumNumberOfBufferedPackets\":2034990044}]},{\"slice\":{\"id\":\"dz\"},\"defaultDataNetwork\":{\"id\":\"ezwwv\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"qyuvvfonkp\"},\"sessionAmbr\":{\"uplink\":\"hqyikvy\",\"downlink\":\"auy\"},\"5qi\":2048419194,\"allocationAndRetentionPriorityLevel\":712290061,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"defaultSessionType\":\"IPv4\",\"additionalAllowedSessionTypes\":[\"IPv4\",\"IPv4\",\"IPv6\",\"IPv4\"],\"allowedServices\":[{\"id\":\"o\"},{\"id\":\"krsgsgb\"},{\"id\":\"huzqgn\"}],\"maximumNumberOfBufferedPackets\":308026039},{\"dataNetwork\":{\"id\":\"kynscliqhzv\"},\"sessionAmbr\":{\"uplink\":\"xnkomtkubo\",\"downlink\":\"ppnvdxz\"},\"5qi\":685064266,\"allocationAndRetentionPriorityLevel\":1207165403,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv6\",\"additionalAllowedSessionTypes\":[\"IPv4\",\"IPv6\",\"IPv4\",\"IPv4\"],\"allowedServices\":[{\"id\":\"hlfkqojpy\"},{\"id\":\"vgtrdcnifmzzs\"},{\"id\":\"ymbrnysuxmpraf\"},{\"id\":\"g\"}],\"maximumNumberOfBufferedPackets\":1986449760}]}]}") - .toObject(SimPolicyPropertiesFormat.class); - Assertions.assertEquals("ruocbgo", model.ueAmbr().uplink()); - Assertions.assertEquals("rb", model.ueAmbr().downlink()); - Assertions.assertEquals("eoybfhjxakvvjgs", model.defaultSlice().id()); - Assertions.assertEquals(36886384, model.rfspIndex()); - Assertions.assertEquals(417144058, model.registrationTimer()); - Assertions.assertEquals("mywwtkgkxnyed", model.sliceConfigurations().get(0).slice().id()); - Assertions.assertEquals("b", model.sliceConfigurations().get(0).defaultDataNetwork().id()); - Assertions - .assertEquals( - "vudtjuewbcihx", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).dataNetwork().id()); - Assertions - .assertEquals( - "uwhcjyxccybv", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().uplink()); - Assertions - .assertEquals( - "ayakkudzpx", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().downlink()); - Assertions - .assertEquals(431593989, model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).fiveQi()); - Assertions - .assertEquals( - 710163355, - model - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.NOT_PREEMPT, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.PREEMPTABLE, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).preemptionVulnerability()); - Assertions - .assertEquals( - PduSessionType.IPV6, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).defaultSessionType()); - Assertions - .assertEquals( - PduSessionType.IPV6, - model - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .additionalAllowedSessionTypes() - .get(0)); - Assertions - .assertEquals( - "rkdbdgiogsjkmnwq", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).allowedServices().get(0).id()); - Assertions - .assertEquals( - 201856710, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).maximumNumberOfBufferedPackets()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SimPolicyPropertiesFormat model = - new SimPolicyPropertiesFormat() - .withUeAmbr(new Ambr().withUplink("ruocbgo").withDownlink("rb")) - .withDefaultSlice(new SliceResourceId().withId("eoybfhjxakvvjgs")) - .withRfspIndex(36886384) - .withRegistrationTimer(417144058) - .withSliceConfigurations( - Arrays - .asList( - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("mywwtkgkxnyed")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("b")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("vudtjuewbcihx")) - .withSessionAmbr( - new Ambr().withUplink("uwhcjyxccybv").withDownlink("ayakkudzpx")) - .withFiveQi(431593989) - .withAllocationAndRetentionPriorityLevel(710163355) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV6) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV6, - PduSessionType.IPV6, - PduSessionType.IPV4, - PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("rkdbdgiogsjkmnwq"), - new ServiceResourceId().withId("nobaiyhddviacegf"), - new ServiceResourceId().withId("m"), - new ServiceResourceId().withId("tfpmvmemfnczdw"))) - .withMaximumNumberOfBufferedPackets(201856710), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("alxlllchp")) - .withSessionAmbr(new Ambr().withUplink("db").withDownlink("evwrdnhfuk")) - .withFiveQi(1934709471) - .withAllocationAndRetentionPriorityLevel(437386763) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV4) - .withAdditionalAllowedSessionTypes( - Arrays.asList(PduSessionType.IPV6, PduSessionType.IPV6)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("ypfcvlerchpqbmf"), - new ServiceResourceId().withId("jbabwidf"))) - .withMaximumNumberOfBufferedPackets(1264081959), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("spuunnoxyhkxgq")) - .withSessionAmbr( - new Ambr().withUplink("drihpfhoqcaaewda").withDownlink("mdjvlpj")) - .withFiveQi(1119660278) - .withAllocationAndRetentionPriorityLevel(785056478) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV4) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV6, - PduSessionType.IPV6, - PduSessionType.IPV6, - PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("dncj"), - new ServiceResourceId().withId("xonbzoggculapz"))) - .withMaximumNumberOfBufferedPackets(350819792))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("pgogtqxepny")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("b")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("ajlyjtlvofqzhv")) - .withSessionAmbr(new Ambr().withUplink("cib").withDownlink("fmo")) - .withFiveQi(1885560912) - .withAllocationAndRetentionPriorityLevel(2073572107) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV4) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV6, - PduSessionType.IPV6, - PduSessionType.IPV6, - PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("zjb"), - new ServiceResourceId().withId("yzsxjrkambtrne"))) - .withMaximumNumberOfBufferedPackets(1525920075), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("nvuqeqvldspa")) - .withSessionAmbr( - new Ambr().withUplink("tjb").withDownlink("kdmflvestmjlx")) - .withFiveQi(1811256055) - .withAllocationAndRetentionPriorityLevel(1713301534) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV4) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV6, - PduSessionType.IPV6, - PduSessionType.IPV6, - PduSessionType.IPV6)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("wk"), - new ServiceResourceId().withId("ziycslevufuztck"), - new ServiceResourceId().withId("yhjtqedcgzu"))) - .withMaximumNumberOfBufferedPackets(1160577956))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("mrqzzrrjvpgl")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("dzgkr")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("eevt")) - .withSessionAmbr( - new Ambr().withUplink("epr").withDownlink("utnwytpzdmovzvf")) - .withFiveQi(1925116648) - .withAllocationAndRetentionPriorityLevel(1341644400) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV6) - .withAdditionalAllowedSessionTypes(Arrays.asList(PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("glae"), - new ServiceResourceId().withId("xndticokpvzmlqtm"))) - .withMaximumNumberOfBufferedPackets(763019330), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("x")) - .withSessionAmbr(new Ambr().withUplink("bf").withDownlink("rclnpkc")) - .withFiveQi(1931804941) - .withAllocationAndRetentionPriorityLevel(1808660907) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV6) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV6, - PduSessionType.IPV4, - PduSessionType.IPV6, - PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("xqvkjlmxhomdyn"), - new ServiceResourceId().withId("dwdigumb"), - new ServiceResourceId().withId("raauzzpt"), - new ServiceResourceId().withId("a"))) - .withMaximumNumberOfBufferedPackets(2034990044))), - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("dz")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("ezwwv")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("qyuvvfonkp")) - .withSessionAmbr(new Ambr().withUplink("hqyikvy").withDownlink("auy")) - .withFiveQi(2048419194) - .withAllocationAndRetentionPriorityLevel(712290061) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV4) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV4, - PduSessionType.IPV4, - PduSessionType.IPV6, - PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("o"), - new ServiceResourceId().withId("krsgsgb"), - new ServiceResourceId().withId("huzqgn"))) - .withMaximumNumberOfBufferedPackets(308026039), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("kynscliqhzv")) - .withSessionAmbr( - new Ambr().withUplink("xnkomtkubo").withDownlink("ppnvdxz")) - .withFiveQi(685064266) - .withAllocationAndRetentionPriorityLevel(1207165403) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV6) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV4, - PduSessionType.IPV6, - PduSessionType.IPV4, - PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("hlfkqojpy"), - new ServiceResourceId().withId("vgtrdcnifmzzs"), - new ServiceResourceId().withId("ymbrnysuxmpraf"), - new ServiceResourceId().withId("g"))) - .withMaximumNumberOfBufferedPackets(1986449760))))); - model = BinaryData.fromObject(model).toObject(SimPolicyPropertiesFormat.class); - Assertions.assertEquals("ruocbgo", model.ueAmbr().uplink()); - Assertions.assertEquals("rb", model.ueAmbr().downlink()); - Assertions.assertEquals("eoybfhjxakvvjgs", model.defaultSlice().id()); - Assertions.assertEquals(36886384, model.rfspIndex()); - Assertions.assertEquals(417144058, model.registrationTimer()); - Assertions.assertEquals("mywwtkgkxnyed", model.sliceConfigurations().get(0).slice().id()); - Assertions.assertEquals("b", model.sliceConfigurations().get(0).defaultDataNetwork().id()); - Assertions - .assertEquals( - "vudtjuewbcihx", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).dataNetwork().id()); - Assertions - .assertEquals( - "uwhcjyxccybv", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().uplink()); - Assertions - .assertEquals( - "ayakkudzpx", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).sessionAmbr().downlink()); - Assertions - .assertEquals(431593989, model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).fiveQi()); - Assertions - .assertEquals( - 710163355, - model - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.NOT_PREEMPT, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.PREEMPTABLE, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).preemptionVulnerability()); - Assertions - .assertEquals( - PduSessionType.IPV6, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).defaultSessionType()); - Assertions - .assertEquals( - PduSessionType.IPV6, - model - .sliceConfigurations() - .get(0) - .dataNetworkConfigurations() - .get(0) - .additionalAllowedSessionTypes() - .get(0)); - Assertions - .assertEquals( - "rkdbdgiogsjkmnwq", - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).allowedServices().get(0).id()); - Assertions - .assertEquals( - 201856710, - model.sliceConfigurations().get(0).dataNetworkConfigurations().get(0).maximumNumberOfBufferedPackets()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyResourceIdTests.java deleted file mode 100644 index df10c660dfe9..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimPolicyResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.SimPolicyResourceId; -import org.junit.jupiter.api.Assertions; - -public final class SimPolicyResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SimPolicyResourceId model = BinaryData.fromString("{\"id\":\"hej\"}").toObject(SimPolicyResourceId.class); - Assertions.assertEquals("hej", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SimPolicyResourceId model = new SimPolicyResourceId().withId("hej"); - model = BinaryData.fromObject(model).toObject(SimPolicyResourceId.class); - Assertions.assertEquals("hej", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimStaticIpPropertiesStaticIpTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimStaticIpPropertiesStaticIpTests.java deleted file mode 100644 index 96ba4fb67fca..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimStaticIpPropertiesStaticIpTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.SimStaticIpPropertiesStaticIp; -import org.junit.jupiter.api.Assertions; - -public final class SimStaticIpPropertiesStaticIpTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SimStaticIpPropertiesStaticIp model = - BinaryData.fromString("{\"ipv4Address\":\"umrtwnawjsl\"}").toObject(SimStaticIpPropertiesStaticIp.class); - Assertions.assertEquals("umrtwnawjsl", model.ipv4Address()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SimStaticIpPropertiesStaticIp model = new SimStaticIpPropertiesStaticIp().withIpv4Address("umrtwnawjsl"); - model = BinaryData.fromObject(model).toObject(SimStaticIpPropertiesStaticIp.class); - Assertions.assertEquals("umrtwnawjsl", model.ipv4Address()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimStaticIpPropertiesTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimStaticIpPropertiesTests.java deleted file mode 100644 index 7af1169fc088..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimStaticIpPropertiesTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetworkResourceId; -import com.azure.resourcemanager.mobilenetwork.models.SimStaticIpProperties; -import com.azure.resourcemanager.mobilenetwork.models.SimStaticIpPropertiesStaticIp; -import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; -import org.junit.jupiter.api.Assertions; - -public final class SimStaticIpPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SimStaticIpProperties model = - BinaryData - .fromString( - "{\"attachedDataNetwork\":{\"id\":\"w\"},\"slice\":{\"id\":\"nfqn\"},\"staticIp\":{\"ipv4Address\":\"psxjvf\"}}") - .toObject(SimStaticIpProperties.class); - Assertions.assertEquals("w", model.attachedDataNetwork().id()); - Assertions.assertEquals("nfqn", model.slice().id()); - Assertions.assertEquals("psxjvf", model.staticIp().ipv4Address()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SimStaticIpProperties model = - new SimStaticIpProperties() - .withAttachedDataNetwork(new AttachedDataNetworkResourceId().withId("w")) - .withSlice(new SliceResourceId().withId("nfqn")) - .withStaticIp(new SimStaticIpPropertiesStaticIp().withIpv4Address("psxjvf")); - model = BinaryData.fromObject(model).toObject(SimStaticIpProperties.class); - Assertions.assertEquals("w", model.attachedDataNetwork().id()); - Assertions.assertEquals("nfqn", model.slice().id()); - Assertions.assertEquals("psxjvf", model.staticIp().ipv4Address()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimsBulkDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimsBulkDeleteMockTests.java deleted file mode 100644 index 05f21593cfa5..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimsBulkDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.AsyncOperationStatus; -import com.azure.resourcemanager.mobilenetwork.models.SimDeleteList; -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 SimsBulkDeleteMockTests { - @Test - public void testBulkDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"xra\",\"name\":\"uqd\",\"status\":\"rxmrgchbapx\",\"resourceId\":\"y\",\"startTime\":\"2021-02-28T15:19:21Z\",\"endTime\":\"2021-07-26T21:09:16Z\",\"percentComplete\":35.908896510494316,\"properties\":\"datascgdu\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AsyncOperationStatus response = - manager - .sims() - .bulkDelete( - "vodrrslblxydkxr", - "vvbxiwkgfbqljnq", - new SimDeleteList().withSims(Arrays.asList("ychocokulehu", "qlrqffaweyurk", "hy")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xra", response.id()); - Assertions.assertEquals("uqd", response.name()); - Assertions.assertEquals("rxmrgchbapx", response.status()); - Assertions.assertEquals("y", response.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-28T15:19:21Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-26T21:09:16Z"), response.endTime()); - Assertions.assertEquals(35.908896510494316D, response.percentComplete()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimsDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimsDeleteMockTests.java deleted file mode 100644 index 7c2136e388e9..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SimsDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 SimsDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.sims().delete("hmupgxyjtcdxabbu", "ftabenbbklqp", "zucafeddww", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteDeletePacketCoreTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteDeletePacketCoreTests.java deleted file mode 100644 index 25eb823eca80..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteDeletePacketCoreTests.java +++ /dev/null @@ -1,27 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneResourceId; -import com.azure.resourcemanager.mobilenetwork.models.SiteDeletePacketCore; -import org.junit.jupiter.api.Assertions; - -public final class SiteDeletePacketCoreTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SiteDeletePacketCore model = - BinaryData.fromString("{\"packetCore\":{\"id\":\"oqaqhvseufuq\"}}").toObject(SiteDeletePacketCore.class); - Assertions.assertEquals("oqaqhvseufuq", model.packetCore().id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SiteDeletePacketCore model = - new SiteDeletePacketCore().withPacketCore(new PacketCoreControlPlaneResourceId().withId("oqaqhvseufuq")); - model = BinaryData.fromObject(model).toObject(SiteDeletePacketCore.class); - Assertions.assertEquals("oqaqhvseufuq", model.packetCore().id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteInnerTests.java deleted file mode 100644 index 24f650e5202c..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteInnerTests.java +++ /dev/null @@ -1,48 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.SiteInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SiteInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SiteInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Unknown\",\"networkFunctions\":[{\"id\":\"b\"},{\"id\":\"hhxud\"},{\"id\":\"vodhtn\"}]},\"location\":\"rudhzmmesckdl\",\"tags\":{\"dfgsftufqobrj\":\"zrcxfailcfxwmdbo\",\"cc\":\"nac\",\"kizvytn\":\"knh\",\"aaeranokqgukk\":\"zvulj\"},\"id\":\"qnvb\",\"name\":\"oylaxxul\",\"type\":\"disdosfjbjsvgj\"}") - .toObject(SiteInner.class); - Assertions.assertEquals("rudhzmmesckdl", model.location()); - Assertions.assertEquals("zrcxfailcfxwmdbo", model.tags().get("dfgsftufqobrj")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SiteInner model = - new SiteInner() - .withLocation("rudhzmmesckdl") - .withTags( - mapOf( - "dfgsftufqobrj", "zrcxfailcfxwmdbo", "cc", "nac", "kizvytn", "knh", "aaeranokqgukk", "zvulj")); - model = BinaryData.fromObject(model).toObject(SiteInner.class); - Assertions.assertEquals("rudhzmmesckdl", model.location()); - Assertions.assertEquals("zrcxfailcfxwmdbo", model.tags().get("dfgsftufqobrj")); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteListResultTests.java deleted file mode 100644 index ad8827d29dab..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteListResultTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.SiteInner; -import com.azure.resourcemanager.mobilenetwork.models.SiteListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SiteListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SiteListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"networkFunctions\":[{\"id\":\"dhttzaefedxihchr\"},{\"id\":\"k\"},{\"id\":\"rjdqnsdfzp\"},{\"id\":\"tg\"}]},\"location\":\"lkdghr\",\"tags\":{\"bwnhhtql\":\"utlwxezwzhok\",\"pifhpfeoajvgcxtx\":\"ehgpp\",\"smkss\":\"csheafidltugsr\",\"iftxfkf\":\"h\"},\"id\":\"egprhptil\",\"name\":\"ucb\",\"type\":\"qtgdqohmcwsl\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"networkFunctions\":[{\"id\":\"wbralllibphbqzm\"}]},\"location\":\"aka\",\"tags\":{\"lhjlmuoyxprimr\":\"kjpdnjzhajo\",\"eislstvasylwx\":\"opteecj\",\"eoohguufuzboyj\":\"zaum\"},\"id\":\"thwtzol\",\"name\":\"a\",\"type\":\"mwmdxmebwjscjpa\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"networkFunctions\":[{\"id\":\"f\"}]},\"location\":\"nmwmqtibx\",\"tags\":{\"dija\":\"ddtvqctt\",\"sieekpndzaapm\":\"ukm\"},\"id\":\"dqmeqwigpibudq\",\"name\":\"yxeb\",\"type\":\"ybpmzznrtffyaq\"}],\"nextLink\":\"mhh\"}") - .toObject(SiteListResult.class); - Assertions.assertEquals("lkdghr", model.value().get(0).location()); - Assertions.assertEquals("utlwxezwzhok", model.value().get(0).tags().get("bwnhhtql")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SiteListResult model = - new SiteListResult() - .withValue( - Arrays - .asList( - new SiteInner() - .withLocation("lkdghr") - .withTags( - mapOf( - "bwnhhtql", - "utlwxezwzhok", - "pifhpfeoajvgcxtx", - "ehgpp", - "smkss", - "csheafidltugsr", - "iftxfkf", - "h")), - new SiteInner() - .withLocation("aka") - .withTags( - mapOf( - "lhjlmuoyxprimr", - "kjpdnjzhajo", - "eislstvasylwx", - "opteecj", - "eoohguufuzboyj", - "zaum")), - new SiteInner() - .withLocation("nmwmqtibx") - .withTags(mapOf("dija", "ddtvqctt", "sieekpndzaapm", "ukm")))); - model = BinaryData.fromObject(model).toObject(SiteListResult.class); - Assertions.assertEquals("lkdghr", model.value().get(0).location()); - Assertions.assertEquals("utlwxezwzhok", model.value().get(0).tags().get("bwnhhtql")); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitePropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitePropertiesFormatTests.java deleted file mode 100644 index a405d309c0e4..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitePropertiesFormatTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.SitePropertiesFormat; - -public final class SitePropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SitePropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Unknown\",\"networkFunctions\":[{\"id\":\"ycy\"},{\"id\":\"c\"},{\"id\":\"gc\"},{\"id\":\"nfnw\"}]}") - .toObject(SitePropertiesFormat.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SitePropertiesFormat model = new SitePropertiesFormat(); - model = BinaryData.fromObject(model).toObject(SitePropertiesFormat.class); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteResourceIdTests.java deleted file mode 100644 index 6393adc1c082..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SiteResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.SiteResourceId; -import org.junit.jupiter.api.Assertions; - -public final class SiteResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SiteResourceId model = BinaryData.fromString("{\"id\":\"a\"}").toObject(SiteResourceId.class); - Assertions.assertEquals("a", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SiteResourceId model = new SiteResourceId().withId("a"); - model = BinaryData.fromObject(model).toObject(SiteResourceId.class); - Assertions.assertEquals("a", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesCreateOrUpdateMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesCreateOrUpdateMockTests.java deleted file mode 100644 index 6a4a434c8190..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,87 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.Site; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -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 SitesCreateOrUpdateMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"networkFunctions\":[{\"id\":\"eqvdsm\"},{\"id\":\"lixqcah\"}]},\"location\":\"xalybxawoijpo\",\"tags\":{\"kwjdjodqhy\":\"lxp\",\"mehllizhceu\":\"incnr\",\"ibngqladyw\":\"oqodkadpp\",\"ds\":\"xwhydtluvv\"},\"id\":\"zsn\",\"name\":\"yemlowuowhlxln\",\"type\":\"y\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Site response = - manager - .sites() - .define("gukvlbpkt") - .withRegion("igijiitnspxlz") - .withExistingMobileNetwork("w", "iytxt") - .withTags(mapOf("jwaiuf", "ygr", "aybfu", "n")) - .create(); - - Assertions.assertEquals("xalybxawoijpo", response.location()); - Assertions.assertEquals("lxp", response.tags().get("kwjdjodqhy")); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesDeleteMockTests.java deleted file mode 100644 index 14714a72d396..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 SitesDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.sites().delete("vbrzcdb", "nfzndscxmxeat", "db", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesDeletePacketCoreMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesDeletePacketCoreMockTests.java deleted file mode 100644 index f3e5b24137f6..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesDeletePacketCoreMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneResourceId; -import com.azure.resourcemanager.mobilenetwork.models.SiteDeletePacketCore; -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 SitesDeletePacketCoreMockTests { - @Test - public void testDeletePacketCore() 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .sites() - .deletePacketCore( - "lidftujwjj", - "fwbeqrkuorh", - "ssruqnmdvhazcvj", - new SiteDeletePacketCore().withPacketCore(new PacketCoreControlPlaneResourceId().withId("iqswbqer")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesGetWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesGetWithResponseMockTests.java deleted file mode 100644 index 13af34e2b308..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesGetWithResponseMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.Site; -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 SitesGetWithResponseMockTests { - @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\":{\"provisioningState\":\"Unknown\",\"networkFunctions\":[{\"id\":\"xxqcwgaxf\"}]},\"location\":\"aknokzwjjzrl\",\"tags\":{\"zyyfy\":\"l\",\"jivyqlkjuv\":\"pqsixymmp\",\"zdbpqv\":\"mbmslzoyov\",\"kcvtl\":\"befgvmxn\"},\"id\":\"bse\",\"name\":\"kvcuartrhunl\",\"type\":\"iryky\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Site response = - manager - .sites() - .getWithResponse("wnrdjyibqbnaom", "jrmkuhmaxljalf", "hcjmo", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("aknokzwjjzrl", response.location()); - Assertions.assertEquals("l", response.tags().get("zyyfy")); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesListByMobileNetworkMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesListByMobileNetworkMockTests.java deleted file mode 100644 index 06377e814bb3..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SitesListByMobileNetworkMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.Site; -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 SitesListByMobileNetworkMockTests { - @Test - public void testListByMobileNetwork() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"networkFunctions\":[{\"id\":\"eonqlnfwmy\"},{\"id\":\"vqdbpbhfck\"},{\"id\":\"ezcrcssbzhddubb\"}]},\"location\":\"fblhkalehp\",\"tags\":{\"gqgdminictteajoh\":\"wugiqjti\",\"tp\":\"ygspnbonhpczykm\",\"mqyjgy\":\"wxqcsehchkhufmpq\"},\"id\":\"zulo\",\"name\":\"saeuzanhsfnhsenw\",\"type\":\"hpzfngqj\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.sites().listByMobileNetwork("ndzfqivjreuyk", "bmnwa", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fblhkalehp", response.iterator().next().location()); - Assertions.assertEquals("wugiqjti", response.iterator().next().tags().get("gqgdminictteajoh")); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceConfigurationTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceConfigurationTests.java deleted file mode 100644 index 9bc362b7df1a..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceConfigurationTests.java +++ /dev/null @@ -1,139 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.Ambr; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.DataNetworkResourceId; -import com.azure.resourcemanager.mobilenetwork.models.PduSessionType; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; -import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; -import com.azure.resourcemanager.mobilenetwork.models.ServiceResourceId; -import com.azure.resourcemanager.mobilenetwork.models.SliceConfiguration; -import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SliceConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SliceConfiguration model = - BinaryData - .fromString( - "{\"slice\":{\"id\":\"ocxvdfffwafqr\"},\"defaultDataNetwork\":{\"id\":\"udaspavehh\"},\"dataNetworkConfigurations\":[{\"dataNetwork\":{\"id\":\"kbunzoz\"},\"sessionAmbr\":{\"uplink\":\"dhcxgkmoy\",\"downlink\":\"cdyuibhmfdnbzyd\"},\"5qi\":1872796730,\"allocationAndRetentionPriorityLevel\":1709322147,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"defaultSessionType\":\"IPv4\",\"additionalAllowedSessionTypes\":[\"IPv6\",\"IPv6\"],\"allowedServices\":[{\"id\":\"gorf\"},{\"id\":\"ukiscvwmzhw\"},{\"id\":\"lefaxvxilcbtgn\"}],\"maximumNumberOfBufferedPackets\":2012963266},{\"dataNetwork\":{\"id\":\"eyqxtjjfzql\"},\"sessionAmbr\":{\"uplink\":\"hycav\",\"downlink\":\"dggxdbeesmi\"},\"5qi\":1356434972,\"allocationAndRetentionPriorityLevel\":420094918,\"preemptionCapability\":\"NotPreempt\",\"preemptionVulnerability\":\"Preemptable\",\"defaultSessionType\":\"IPv6\",\"additionalAllowedSessionTypes\":[\"IPv4\",\"IPv4\",\"IPv6\",\"IPv4\"],\"allowedServices\":[{\"id\":\"qfby\"},{\"id\":\"yr\"},{\"id\":\"giagtcojo\"},{\"id\":\"qwogfnzjvus\"}],\"maximumNumberOfBufferedPackets\":359002746},{\"dataNetwork\":{\"id\":\"dmozu\"},\"sessionAmbr\":{\"uplink\":\"ylfsbtk\",\"downlink\":\"dp\"},\"5qi\":737232948,\"allocationAndRetentionPriorityLevel\":1774852320,\"preemptionCapability\":\"MayPreempt\",\"preemptionVulnerability\":\"NotPreemptable\",\"defaultSessionType\":\"IPv4\",\"additionalAllowedSessionTypes\":[\"IPv6\"],\"allowedServices\":[{\"id\":\"cto\"},{\"id\":\"cmisofie\"},{\"id\":\"pe\"}],\"maximumNumberOfBufferedPackets\":419692653}]}") - .toObject(SliceConfiguration.class); - Assertions.assertEquals("ocxvdfffwafqr", model.slice().id()); - Assertions.assertEquals("udaspavehh", model.defaultDataNetwork().id()); - Assertions.assertEquals("kbunzoz", model.dataNetworkConfigurations().get(0).dataNetwork().id()); - Assertions.assertEquals("dhcxgkmoy", model.dataNetworkConfigurations().get(0).sessionAmbr().uplink()); - Assertions.assertEquals("cdyuibhmfdnbzyd", model.dataNetworkConfigurations().get(0).sessionAmbr().downlink()); - Assertions.assertEquals(1872796730, model.dataNetworkConfigurations().get(0).fiveQi()); - Assertions - .assertEquals(1709322147, model.dataNetworkConfigurations().get(0).allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.NOT_PREEMPT, model.dataNetworkConfigurations().get(0).preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.PREEMPTABLE, - model.dataNetworkConfigurations().get(0).preemptionVulnerability()); - Assertions.assertEquals(PduSessionType.IPV4, model.dataNetworkConfigurations().get(0).defaultSessionType()); - Assertions - .assertEquals( - PduSessionType.IPV6, model.dataNetworkConfigurations().get(0).additionalAllowedSessionTypes().get(0)); - Assertions.assertEquals("gorf", model.dataNetworkConfigurations().get(0).allowedServices().get(0).id()); - Assertions.assertEquals(2012963266, model.dataNetworkConfigurations().get(0).maximumNumberOfBufferedPackets()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SliceConfiguration model = - new SliceConfiguration() - .withSlice(new SliceResourceId().withId("ocxvdfffwafqr")) - .withDefaultDataNetwork(new DataNetworkResourceId().withId("udaspavehh")) - .withDataNetworkConfigurations( - Arrays - .asList( - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("kbunzoz")) - .withSessionAmbr(new Ambr().withUplink("dhcxgkmoy").withDownlink("cdyuibhmfdnbzyd")) - .withFiveQi(1872796730) - .withAllocationAndRetentionPriorityLevel(1709322147) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV4) - .withAdditionalAllowedSessionTypes( - Arrays.asList(PduSessionType.IPV6, PduSessionType.IPV6)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("gorf"), - new ServiceResourceId().withId("ukiscvwmzhw"), - new ServiceResourceId().withId("lefaxvxilcbtgn"))) - .withMaximumNumberOfBufferedPackets(2012963266), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("eyqxtjjfzql")) - .withSessionAmbr(new Ambr().withUplink("hycav").withDownlink("dggxdbeesmi")) - .withFiveQi(1356434972) - .withAllocationAndRetentionPriorityLevel(420094918) - .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV6) - .withAdditionalAllowedSessionTypes( - Arrays - .asList( - PduSessionType.IPV4, - PduSessionType.IPV4, - PduSessionType.IPV6, - PduSessionType.IPV4)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("qfby"), - new ServiceResourceId().withId("yr"), - new ServiceResourceId().withId("giagtcojo"), - new ServiceResourceId().withId("qwogfnzjvus"))) - .withMaximumNumberOfBufferedPackets(359002746), - new DataNetworkConfiguration() - .withDataNetwork(new DataNetworkResourceId().withId("dmozu")) - .withSessionAmbr(new Ambr().withUplink("ylfsbtk").withDownlink("dp")) - .withFiveQi(737232948) - .withAllocationAndRetentionPriorityLevel(1774852320) - .withPreemptionCapability(PreemptionCapability.MAY_PREEMPT) - .withPreemptionVulnerability(PreemptionVulnerability.NOT_PREEMPTABLE) - .withDefaultSessionType(PduSessionType.IPV4) - .withAdditionalAllowedSessionTypes(Arrays.asList(PduSessionType.IPV6)) - .withAllowedServices( - Arrays - .asList( - new ServiceResourceId().withId("cto"), - new ServiceResourceId().withId("cmisofie"), - new ServiceResourceId().withId("pe"))) - .withMaximumNumberOfBufferedPackets(419692653))); - model = BinaryData.fromObject(model).toObject(SliceConfiguration.class); - Assertions.assertEquals("ocxvdfffwafqr", model.slice().id()); - Assertions.assertEquals("udaspavehh", model.defaultDataNetwork().id()); - Assertions.assertEquals("kbunzoz", model.dataNetworkConfigurations().get(0).dataNetwork().id()); - Assertions.assertEquals("dhcxgkmoy", model.dataNetworkConfigurations().get(0).sessionAmbr().uplink()); - Assertions.assertEquals("cdyuibhmfdnbzyd", model.dataNetworkConfigurations().get(0).sessionAmbr().downlink()); - Assertions.assertEquals(1872796730, model.dataNetworkConfigurations().get(0).fiveQi()); - Assertions - .assertEquals(1709322147, model.dataNetworkConfigurations().get(0).allocationAndRetentionPriorityLevel()); - Assertions - .assertEquals( - PreemptionCapability.NOT_PREEMPT, model.dataNetworkConfigurations().get(0).preemptionCapability()); - Assertions - .assertEquals( - PreemptionVulnerability.PREEMPTABLE, - model.dataNetworkConfigurations().get(0).preemptionVulnerability()); - Assertions.assertEquals(PduSessionType.IPV4, model.dataNetworkConfigurations().get(0).defaultSessionType()); - Assertions - .assertEquals( - PduSessionType.IPV6, model.dataNetworkConfigurations().get(0).additionalAllowedSessionTypes().get(0)); - Assertions.assertEquals("gorf", model.dataNetworkConfigurations().get(0).allowedServices().get(0).id()); - Assertions.assertEquals(2012963266, model.dataNetworkConfigurations().get(0).maximumNumberOfBufferedPackets()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceInnerTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceInnerTests.java deleted file mode 100644 index 7d19c147e2ac..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceInnerTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.SliceInner; -import com.azure.resourcemanager.mobilenetwork.models.Snssai; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SliceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SliceInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"snssai\":{\"sst\":2043816183,\"sd\":\"rddga\"},\"description\":\"uhiosrsju\"},\"location\":\"fcdis\",\"tags\":{\"rxzbujr\":\"nxzhcze\",\"nlnzonzlrpi\":\"rhqvwrevkh\"},\"id\":\"yw\",\"name\":\"cvjtszcofiz\",\"type\":\"htd\"}") - .toObject(SliceInner.class); - Assertions.assertEquals("fcdis", model.location()); - Assertions.assertEquals("nxzhcze", model.tags().get("rxzbujr")); - Assertions.assertEquals(2043816183, model.snssai().sst()); - Assertions.assertEquals("rddga", model.snssai().sd()); - Assertions.assertEquals("uhiosrsju", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SliceInner model = - new SliceInner() - .withLocation("fcdis") - .withTags(mapOf("rxzbujr", "nxzhcze", "nlnzonzlrpi", "rhqvwrevkh")) - .withSnssai(new Snssai().withSst(2043816183).withSd("rddga")) - .withDescription("uhiosrsju"); - model = BinaryData.fromObject(model).toObject(SliceInner.class); - Assertions.assertEquals("fcdis", model.location()); - Assertions.assertEquals("nxzhcze", model.tags().get("rxzbujr")); - Assertions.assertEquals(2043816183, model.snssai().sst()); - Assertions.assertEquals("rddga", model.snssai().sd()); - Assertions.assertEquals("uhiosrsju", model.description()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceListResultTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceListResultTests.java deleted file mode 100644 index 391a819416f6..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceListResultTests.java +++ /dev/null @@ -1,96 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.SliceInner; -import com.azure.resourcemanager.mobilenetwork.models.SliceListResult; -import com.azure.resourcemanager.mobilenetwork.models.Snssai; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SliceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SliceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"snssai\":{\"sst\":1098245078,\"sd\":\"lvidizozs\"},\"description\":\"ccxjm\"},\"location\":\"fdgnwncypuuwwlt\",\"tags\":{\"zzhmkd\":\"jctzenkei\",\"gsrboldforobw\":\"svflyhbxcudch\",\"hfovvacqpbtu\":\"lvizb\"},\"id\":\"dxe\",\"name\":\"zab\",\"type\":\"elawumu\"},{\"properties\":{\"provisioningState\":\"Failed\",\"snssai\":{\"sst\":46527363,\"sd\":\"wrrwoycqucw\"},\"description\":\"ahnomdrkywu\"},\"location\":\"svfuurutlwexxwl\",\"tags\":{\"q\":\"iexzsrzpge\",\"wwpgdakchzyvlixq\":\"yb\",\"bn\":\"rkcxkj\",\"swqrntvlwijp\":\"mysu\"},\"id\":\"ttexoqqpwcyyufmh\",\"name\":\"uncuw\",\"type\":\"qspkcdqzhlctd\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"snssai\":{\"sst\":302400307,\"sd\":\"dyfpchrqbnj\"},\"description\":\"cgegydcwbo\"},\"location\":\"umvq\",\"tags\":{\"jtlo\":\"ihrraiouaub\",\"iflrzpasccbiu\":\"xfuojrn\",\"ufdvruz\":\"mzdlyjdfqwmkyo\",\"hpc\":\"lzo\"},\"id\":\"fnmdxotn\",\"name\":\"fdgugeyzi\",\"type\":\"grkyuizabsnmfpph\"}],\"nextLink\":\"eevy\"}") - .toObject(SliceListResult.class); - Assertions.assertEquals("fdgnwncypuuwwlt", model.value().get(0).location()); - Assertions.assertEquals("jctzenkei", model.value().get(0).tags().get("zzhmkd")); - Assertions.assertEquals(1098245078, model.value().get(0).snssai().sst()); - Assertions.assertEquals("lvidizozs", model.value().get(0).snssai().sd()); - Assertions.assertEquals("ccxjm", model.value().get(0).description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SliceListResult model = - new SliceListResult() - .withValue( - Arrays - .asList( - new SliceInner() - .withLocation("fdgnwncypuuwwlt") - .withTags( - mapOf( - "zzhmkd", - "jctzenkei", - "gsrboldforobw", - "svflyhbxcudch", - "hfovvacqpbtu", - "lvizb")) - .withSnssai(new Snssai().withSst(1098245078).withSd("lvidizozs")) - .withDescription("ccxjm"), - new SliceInner() - .withLocation("svfuurutlwexxwl") - .withTags( - mapOf( - "q", - "iexzsrzpge", - "wwpgdakchzyvlixq", - "yb", - "bn", - "rkcxkj", - "swqrntvlwijp", - "mysu")) - .withSnssai(new Snssai().withSst(46527363).withSd("wrrwoycqucw")) - .withDescription("ahnomdrkywu"), - new SliceInner() - .withLocation("umvq") - .withTags( - mapOf( - "jtlo", - "ihrraiouaub", - "iflrzpasccbiu", - "xfuojrn", - "ufdvruz", - "mzdlyjdfqwmkyo", - "hpc", - "lzo")) - .withSnssai(new Snssai().withSst(302400307).withSd("dyfpchrqbnj")) - .withDescription("cgegydcwbo"))); - model = BinaryData.fromObject(model).toObject(SliceListResult.class); - Assertions.assertEquals("fdgnwncypuuwwlt", model.value().get(0).location()); - Assertions.assertEquals("jctzenkei", model.value().get(0).tags().get("zzhmkd")); - Assertions.assertEquals(1098245078, model.value().get(0).snssai().sst()); - Assertions.assertEquals("lvidizozs", model.value().get(0).snssai().sd()); - Assertions.assertEquals("ccxjm", model.value().get(0).description()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicePropertiesFormatTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicePropertiesFormatTests.java deleted file mode 100644 index 9f7261c6cfe9..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicePropertiesFormatTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.fluent.models.SlicePropertiesFormat; -import com.azure.resourcemanager.mobilenetwork.models.Snssai; -import org.junit.jupiter.api.Assertions; - -public final class SlicePropertiesFormatTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SlicePropertiesFormat model = - BinaryData - .fromString( - "{\"provisioningState\":\"Accepted\",\"snssai\":{\"sst\":673531978,\"sd\":\"vreljea\"},\"description\":\"rvzmlovuana\"}") - .toObject(SlicePropertiesFormat.class); - Assertions.assertEquals(673531978, model.snssai().sst()); - Assertions.assertEquals("vreljea", model.snssai().sd()); - Assertions.assertEquals("rvzmlovuana", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SlicePropertiesFormat model = - new SlicePropertiesFormat() - .withSnssai(new Snssai().withSst(673531978).withSd("vreljea")) - .withDescription("rvzmlovuana"); - model = BinaryData.fromObject(model).toObject(SlicePropertiesFormat.class); - Assertions.assertEquals(673531978, model.snssai().sst()); - Assertions.assertEquals("vreljea", model.snssai().sd()); - Assertions.assertEquals("rvzmlovuana", model.description()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceResourceIdTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceResourceIdTests.java deleted file mode 100644 index c26f9f98c49c..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SliceResourceIdTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; -import org.junit.jupiter.api.Assertions; - -public final class SliceResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SliceResourceId model = BinaryData.fromString("{\"id\":\"vydfceacvlhvygdy\"}").toObject(SliceResourceId.class); - Assertions.assertEquals("vydfceacvlhvygdy", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SliceResourceId model = new SliceResourceId().withId("vydfceacvlhvygdy"); - model = BinaryData.fromObject(model).toObject(SliceResourceId.class); - Assertions.assertEquals("vydfceacvlhvygdy", model.id()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesCreateOrUpdateMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesCreateOrUpdateMockTests.java deleted file mode 100644 index 29037e4758ea..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,93 +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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.Slice; -import com.azure.resourcemanager.mobilenetwork.models.Snssai; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -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 SlicesCreateOrUpdateMockTests { - @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\":{\"provisioningState\":\"Succeeded\",\"snssai\":{\"sst\":772892522,\"sd\":\"mbjwcolbmxlb\"},\"description\":\"tpc\"},\"location\":\"hprzrvxhmtfho\",\"tags\":{\"isn\":\"zcmjhngxnoqrxt\",\"hepfwwtjfdoes\":\"evhdlmydid\",\"dbckyo\":\"xhmw\"},\"id\":\"kxkxhnegk\",\"name\":\"jzrbhtmeplv\",\"type\":\"kaobrl\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Slice response = - manager - .slices() - .define("y") - .withRegion("zvdhctmmkosz") - .withExistingMobileNetwork("f", "kzxuiz") - .withSnssai(new Snssai().withSst(905530117).withSd("peti")) - .withTags(mapOf("qkio", "lnsntrpc", "fmhklbnld", "kb", "hez", "vcb")) - .withDescription("xqiubxdukecpx") - .create(); - - Assertions.assertEquals("hprzrvxhmtfho", response.location()); - Assertions.assertEquals("zcmjhngxnoqrxt", response.tags().get("isn")); - Assertions.assertEquals(772892522, response.snssai().sst()); - Assertions.assertEquals("mbjwcolbmxlb", response.snssai().sd()); - Assertions.assertEquals("tpc", response.description()); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesDeleteMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesDeleteMockTests.java deleted file mode 100644 index 6643047234ce..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesDeleteMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -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 SlicesDeleteMockTests { - @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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.slices().delete("mouvbl", "mo", "zkltrfowtdvrfmv", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesGetWithResponseMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesGetWithResponseMockTests.java deleted file mode 100644 index 5e3b1f377956..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesGetWithResponseMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.Slice; -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 SlicesGetWithResponseMockTests { - @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\":{\"provisioningState\":\"Failed\",\"snssai\":{\"sst\":836172134,\"sd\":\"qzdkfn\"},\"description\":\"ixh\"},\"location\":\"ratqxmbjro\",\"tags\":{\"l\":\"znv\",\"on\":\"jrhuzgf\"},\"id\":\"tpusllywp\",\"name\":\"tiotzb\",\"type\":\"d\"}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Slice response = - manager - .slices() - .getWithResponse("ih", "vjdrqcrjidhftuk", "hdxlw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ratqxmbjro", response.location()); - Assertions.assertEquals("znv", response.tags().get("l")); - Assertions.assertEquals(836172134, response.snssai().sst()); - Assertions.assertEquals("qzdkfn", response.snssai().sd()); - Assertions.assertEquals("ixh", response.description()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesListByMobileNetworkMockTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesListByMobileNetworkMockTests.java deleted file mode 100644 index cf958ecdd800..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesListByMobileNetworkMockTests.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.mobilenetwork.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.mobilenetwork.MobileNetworkManager; -import com.azure.resourcemanager.mobilenetwork.models.Slice; -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 SlicesListByMobileNetworkMockTests { - @Test - public void testListByMobileNetwork() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"snssai\":{\"sst\":1681361815,\"sd\":\"uygdjboqgr\"},\"description\":\"qjkqevadrmmwi\"},\"location\":\"wvcmj\",\"tags\":{\"zugamxzkrrcoiis\":\"iidisczskoswoqiq\"},\"id\":\"amnppcce\",\"name\":\"u\",\"type\":\"tdsbezax\"}]}"; - - 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); - })); - - MobileNetworkManager manager = - MobileNetworkManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.slices().listByMobileNetwork("ollgry", "qiuasigrows", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wvcmj", response.iterator().next().location()); - Assertions.assertEquals("iidisczskoswoqiq", response.iterator().next().tags().get("zugamxzkrrcoiis")); - Assertions.assertEquals(1681361815, response.iterator().next().snssai().sst()); - Assertions.assertEquals("uygdjboqgr", response.iterator().next().snssai().sd()); - Assertions.assertEquals("qjkqevadrmmwi", response.iterator().next().description()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SnssaiTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SnssaiTests.java deleted file mode 100644 index 5a0dbbec5b17..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/SnssaiTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.Snssai; -import org.junit.jupiter.api.Assertions; - -public final class SnssaiTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Snssai model = BinaryData.fromString("{\"sst\":1372249565,\"sd\":\"xlpm\"}").toObject(Snssai.class); - Assertions.assertEquals(1372249565, model.sst()); - Assertions.assertEquals("xlpm", model.sd()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Snssai model = new Snssai().withSst(1372249565).withSd("xlpm"); - model = BinaryData.fromObject(model).toObject(Snssai.class); - Assertions.assertEquals(1372249565, model.sst()); - Assertions.assertEquals("xlpm", model.sd()); - } -} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/TagsObjectTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/TagsObjectTests.java deleted file mode 100644 index e0db40764a32..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/TagsObjectTests.java +++ /dev/null @@ -1,43 +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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.TagsObject; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagsObjectTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagsObject model = - BinaryData - .fromString( - "{\"tags\":{\"jnchgej\":\"vnipjox\",\"huxinpmqnj\":\"podmailzydehojwy\",\"vcputegj\":\"qwixjspro\"}}") - .toObject(TagsObject.class); - Assertions.assertEquals("vnipjox", model.tags().get("jnchgej")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagsObject model = - new TagsObject() - .withTags(mapOf("jnchgej", "vnipjox", "huxinpmqnj", "podmailzydehojwy", "vcputegj", "qwixjspro")); - model = BinaryData.fromObject(model).toObject(TagsObject.class); - Assertions.assertEquals("vnipjox", model.tags().get("jnchgej")); - } - - @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/UserAssignedIdentityTests.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 2c80825cd654..000000000000 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/test/java/com/azure/resourcemanager/mobilenetwork/generated/UserAssignedIdentityTests.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.mobilenetwork.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.mobilenetwork.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"84e5cd6e-f6e8-4563-aaa6-4990ca767ee8\",\"clientId\":\"f0c0ceb1-a9c3-4d11-80ce-075c5717a1e8\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -}