diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md index 118be18ebce9..7151c54361ab 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2023-09-27) + +- Azure Resource Manager Managed Network Fabric client library for Java. This package contains Microsoft Azure SDK for Managed Network Fabric Management SDK. Self service experience for Azure Network Fabric API. Package tag package-2023-06-15. 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/README.md b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/README.md index 4950a70cc520..67cfe8482483 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/README.md +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-managednetworkfabric - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,73 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +```java +acl = managedNetworkFabricManager + .accessControlLists() + .define(aclName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withConfigurationType(ConfigurationType.FILE) + .withMatchConfigurations( + Collections.singletonList( + new AccessControlListMatchConfiguration() + .withMatchConfigurationName(matchName) + .withSequenceNumber(123L) + .withIpAddressType(IpAddressType.IPV4) + .withMatchConditions( + Collections.singletonList( + new AccessControlListMatchCondition() + .withProtocolTypes(Collections.singletonList("TCP")) + .withVlanMatchCondition( + new VlanMatchCondition() + .withVlans(Collections.singletonList("20-30")) + .withInnerVlans(Collections.singletonList("30")) + .withVlanGroupNames(Collections.singletonList(vlgName))) + .withIpCondition( + new IpMatchCondition() + .withType(SourceDestinationType.SOURCE_IP) + .withPrefixType(PrefixType.PREFIX) + .withIpPrefixValues(Collections.singletonList("10.20.20.20/12")) + .withIpGroupNames(Collections.singletonList(ipgName))) + .withEtherTypes(Collections.singletonList("0x1")) + .withFragments(Collections.singletonList("0xff00-0xffff")) + .withIpLengths(Collections.singletonList("4094-9214")) + .withTtlValues(Collections.singletonList("23")) + .withDscpMarkings(Collections.singletonList("32")) + .withPortCondition( + new AccessControlListPortCondition() + .withPortType(PortType.SOURCE_PORT) + .withLayer4Protocol(Layer4Protocol.TCP) + .withPorts(Collections.singletonList("1-20")) + .withPortGroupNames(Collections.singletonList(pgName)) + .withFlags(Collections.singletonList("established"))))) + .withActions( + Collections.singletonList( + new AccessControlListAction() + .withType(AclActionType.COUNT) + .withCounterName(counterName))))) + .withDynamicMatchConfigurations( + Collections.singletonList( + new CommonDynamicMatchConfiguration() + .withIpGroups( + Collections.singletonList( + new IpGroupProperties() + .withName(ipgName) + .withIpAddressType(IpAddressType.IPV4) + .withIpPrefixes(Collections.singletonList("10.20.3.1/20")))) + .withVlanGroups( + Collections.singletonList( + new VlanGroupProperties() + .withName(vlgName) + .withVlans(Collections.singletonList("20-30")))) + .withPortGroups( + Collections.singletonList( + new PortGroupProperties() + .withName(pgName) + .withPorts(Collections.singletonList("100-200")))))) + .withAnnotation("annotation") + .create(); +``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md) diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md index 520f8f150401..c665691e840e 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md @@ -246,6 +246,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMa import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; @@ -281,6 +282,7 @@ public final class AccessControlListsCreateSamples { .withTags(mapOf("keyID", "fakeTokenPlaceholder")) .withConfigurationType(ConfigurationType.FILE) .withAclsUrl("https://ACL-Storage-URL") + .withDefaultAction(CommunityActionTypes.PERMIT) .withMatchConfigurations( Arrays .asList( @@ -349,6 +351,7 @@ public final class AccessControlListsCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -474,6 +477,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMa import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; @@ -512,6 +516,7 @@ public final class AccessControlListsUpdateSamples { .withAnnotation("annotation") .withConfigurationType(ConfigurationType.FILE) .withAclsUrl("https://microsoft.com/a") + .withDefaultAction(CommunityActionTypes.PERMIT) .withMatchConfigurations( Arrays .asList( @@ -579,6 +584,7 @@ public final class AccessControlListsUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1311,6 +1317,7 @@ public final class InternetGatewayRulesCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1439,6 +1446,7 @@ public final class InternetGatewayRulesUpdateSamples { resource.update().withTags(mapOf("key3311", "fakeTokenPlaceholder")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1486,6 +1494,7 @@ public final class InternetGatewaysCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1614,6 +1623,7 @@ public final class InternetGatewaysUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1667,6 +1677,7 @@ public final class IpCommunitiesCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1841,6 +1852,7 @@ public final class IpExtendedCommunitiesCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1980,6 +1992,7 @@ public final class IpExtendedCommunitiesUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2034,6 +2047,7 @@ public final class IpPrefixesCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2173,6 +2187,7 @@ public final class IpPrefixesUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2240,6 +2255,7 @@ public final class L2IsolationDomainsCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2367,6 +2383,7 @@ public final class L2IsolationDomainsUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2507,6 +2524,7 @@ public final class L3IsolationDomainsCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2656,6 +2674,7 @@ public final class L3IsolationDomainsUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2766,6 +2785,7 @@ public final class NeighborGroupsCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2909,6 +2929,7 @@ public final class NeighborGroupsUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2993,6 +3014,7 @@ public final class NetworkDevicesCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -3170,6 +3192,7 @@ public final class NetworkDevicesUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -3588,12 +3611,14 @@ public final class NetworkFabricsCreateSamples { .withSecondaryIpv4Prefix("10.0.0.15/30") .withSecondaryIpv6Prefix("2FFE:FFFF:0:CD30::ac/126")))) .withTags(mapOf("keyID", "fakeTokenPlaceholder")) + .withFabricVersion("1.x.x") .withRackCount(4) .withIpv6Prefix("3FFE:FFFF:0:CD40::/59") .withAnnotation("annotation") .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -3877,6 +3902,7 @@ public final class NetworkFabricsUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -3953,7 +3979,8 @@ public final class NetworkFabricsUpdateWorkloadManagementBfdConfigurationSamples ### NetworkFabrics_Upgrade ```java -import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersion; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricUpgradeAction; +import com.azure.resourcemanager.managednetworkfabric.models.UpgradeNetworkFabricProperties; /** Samples for NetworkFabrics Upgrade. */ public final class NetworkFabricsUpgradeSamples { @@ -3972,7 +3999,7 @@ public final class NetworkFabricsUpgradeSamples { .upgrade( "example-rg", "example-fabric", - new UpdateVersion().withVersion("version1"), + new UpgradeNetworkFabricProperties().withVersion("3.x.x").withAction(NetworkFabricUpgradeAction.START), com.azure.core.util.Context.NONE); } } @@ -4183,6 +4210,7 @@ public final class NetworkPacketBrokersCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4309,6 +4337,7 @@ public final class NetworkPacketBrokersUpdateSamples { resource.update().withTags(mapOf("key8772", "fakeTokenPlaceholder")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4354,6 +4383,7 @@ public final class NetworkRacksCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4476,6 +4506,7 @@ public final class NetworkRacksUpdateSamples { resource.update().withTags(mapOf("keyID", "fakeTokenPlaceholder")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4607,6 +4638,7 @@ public final class NetworkTapRulesCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4838,6 +4870,7 @@ public final class NetworkTapRulesUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4957,6 +4990,7 @@ public final class NetworkTapsCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -5127,6 +5161,7 @@ public final class NetworkTapsUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -5514,6 +5549,7 @@ public final class RoutePoliciesCommitConfigurationSamples { import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; @@ -5546,6 +5582,7 @@ public final class RoutePoliciesCreateSamples { "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric") .withTags(mapOf("keyID", "fakeTokenPlaceholder")) .withAddressFamilyType(AddressFamilyType.IPV4) + .withDefaultAction(CommunityActionTypes.DENY) .withStatements( Arrays .asList( @@ -5613,6 +5650,7 @@ public final class RoutePoliciesCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -5713,6 +5751,7 @@ public final class RoutePoliciesListByResourceGroupSamples { ```java import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; @@ -5745,6 +5784,7 @@ public final class RoutePoliciesUpdateSamples { resource .update() .withTags(mapOf("keyID", "fakeTokenPlaceholder")) + .withDefaultAction(CommunityActionTypes.DENY) .withStatements( Arrays .asList( @@ -5811,6 +5851,7 @@ public final class RoutePoliciesUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml index 7f5a89359cd2..c54d438c26cf 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml @@ -45,6 +45,7 @@ UTF-8 0 0 + true diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/ManagedNetworkFabricManager.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/ManagedNetworkFabricManager.java index 3f5ed5eeab39..473f159064b5 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/ManagedNetworkFabricManager.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/ManagedNetworkFabricManager.java @@ -295,7 +295,7 @@ public ManagedNetworkFabricManager authenticate(TokenCredential credential, Azur .append("-") .append("com.azure.resourcemanager.managednetworkfabric") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -643,8 +643,10 @@ public RoutePolicies routePolicies() { } /** - * @return Wrapped service client AzureNetworkFabricManagementServiceApi providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets wrapped service client AzureNetworkFabricManagementServiceApi providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client AzureNetworkFabricManagementServiceApi. */ public AzureNetworkFabricManagementServiceApi serviceClient() { return this.clientObject; diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricsClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricsClient.java index dd3c229eac2c..ae6d3a8cfe6a 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricsClient.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricsClient.java @@ -17,7 +17,7 @@ import com.azure.resourcemanager.managednetworkfabric.fluent.models.ValidateConfigurationResponseInner; import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPatch; import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersion; +import com.azure.resourcemanager.managednetworkfabric.models.UpgradeNetworkFabricProperties; import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationProperties; /** An instance of this class provides access to all the operations defined in NetworkFabricsClient. */ @@ -452,7 +452,7 @@ CommonPostActionResponseForDeviceUpdateInner deprovision( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CommonPostActionResponseForStateUpdateInner> - beginUpgrade(String resourceGroupName, String networkFabricName, UpdateVersion body); + beginUpgrade(String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body); /** * Implements the operation to the underlying resources. @@ -470,7 +470,8 @@ CommonPostActionResponseForDeviceUpdateInner deprovision( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CommonPostActionResponseForStateUpdateInner> - beginUpgrade(String resourceGroupName, String networkFabricName, UpdateVersion body, Context context); + beginUpgrade( + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body, Context context); /** * Implements the operation to the underlying resources. @@ -487,7 +488,7 @@ CommonPostActionResponseForDeviceUpdateInner deprovision( */ @ServiceMethod(returns = ReturnType.SINGLE) CommonPostActionResponseForStateUpdateInner upgrade( - String resourceGroupName, String networkFabricName, UpdateVersion body); + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body); /** * Implements the operation to the underlying resources. @@ -505,7 +506,7 @@ CommonPostActionResponseForStateUpdateInner upgrade( */ @ServiceMethod(returns = ReturnType.SINGLE) CommonPostActionResponseForStateUpdateInner upgrade( - String resourceGroupName, String networkFabricName, UpdateVersion body, Context context); + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body, Context context); /** * Implements the operation to the underlying resources. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListInner.java index d2a2770e1e8c..585c2ccb170e 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListInner.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListInner.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration; import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationState; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; @@ -152,6 +153,31 @@ public AccessControlListInner withAclsUrl(String aclsUrl) { return this; } + /** + * Get the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @return the defaultAction value. + */ + public CommunityActionTypes defaultAction() { + return this.innerProperties() == null ? null : this.innerProperties().defaultAction(); + } + + /** + * Set the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @param defaultAction the defaultAction value to set. + * @return the AccessControlListInner object itself. + */ + public AccessControlListInner withDefaultAction(CommunityActionTypes defaultAction) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessControlListProperties(); + } + this.innerProperties().withDefaultAction(defaultAction); + return this; + } + /** * Get the matchConfigurations property: List of match configurations. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListPatchProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListPatchProperties.java index 5134fef3adab..945de3316b3d 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListPatchProperties.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListPatchProperties.java @@ -8,6 +8,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration; import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatchableProperties; import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -59,6 +60,13 @@ public AccessControlListPatchProperties withAclsUrl(String aclsUrl) { return this; } + /** {@inheritDoc} */ + @Override + public AccessControlListPatchProperties withDefaultAction(CommunityActionTypes defaultAction) { + super.withDefaultAction(defaultAction); + return this; + } + /** {@inheritDoc} */ @Override public AccessControlListPatchProperties withMatchConfigurations( diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListProperties.java index fb01165acbaf..e9468c433dda 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListProperties.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListProperties.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationState; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; @@ -55,6 +56,12 @@ public final class AccessControlListProperties extends AnnotationResource { @JsonProperty(value = "aclsUrl") private String aclsUrl; + /* + * Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + */ + @JsonProperty(value = "defaultAction") + private CommunityActionTypes defaultAction; + /* * List of match configurations. */ @@ -147,6 +154,28 @@ public AccessControlListProperties withAclsUrl(String aclsUrl) { return this; } + /** + * Get the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @return the defaultAction value. + */ + public CommunityActionTypes defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @param defaultAction the defaultAction value to set. + * @return the AccessControlListProperties object itself. + */ + public AccessControlListProperties withDefaultAction(CommunityActionTypes defaultAction) { + this.defaultAction = defaultAction; + return this; + } + /** * Get the matchConfigurations property: List of match configurations. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkInner.java index 8f6015414de8..182e19a554a5 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkInner.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationState; @@ -26,6 +27,12 @@ public final class ExternalNetworkInner extends ProxyResource { @JsonProperty(value = "properties", required = true) private ExternalNetworkProperties innerProperties = new ExternalNetworkProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** Creates an instance of ExternalNetworkInner class. */ public ExternalNetworkInner() { } @@ -39,6 +46,15 @@ private ExternalNetworkProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the networkToNetworkInterconnectId property: Gets the networkToNetworkInterconnectId of the resource. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuInner.java index a963ce016de0..68912b223be8 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuInner.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.managednetworkfabric.models.DeviceInterfaceProperties; import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; @@ -23,6 +24,12 @@ public final class NetworkDeviceSkuInner extends ProxyResource { @JsonProperty(value = "properties", required = true) private NetworkDeviceSkuProperties innerProperties = new NetworkDeviceSkuProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** Creates an instance of NetworkDeviceSkuInner class. */ public NetworkDeviceSkuInner() { } @@ -36,6 +43,15 @@ private NetworkDeviceSkuProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the model property: Model of the network device. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricInner.java index a8399abd8363..70099c1fbed6 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricInner.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricInner.java @@ -104,6 +104,20 @@ public String fabricVersion() { return this.innerProperties() == null ? null : this.innerProperties().fabricVersion(); } + /** + * Set the fabricVersion property: The version of Network Fabric. + * + * @param fabricVersion the fabricVersion value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withFabricVersion(String fabricVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withFabricVersion(fabricVersion); + return this; + } + /** * Get the routerIds property: Array of router IDs. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricProperties.java index 74be32174bec..7f9953e9390e 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricProperties.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricProperties.java @@ -29,7 +29,7 @@ public final class NetworkFabricProperties extends AnnotationResource { /* * The version of Network Fabric. */ - @JsonProperty(value = "fabricVersion", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "fabricVersion") private String fabricVersion; /* @@ -161,6 +161,17 @@ public String fabricVersion() { return this.fabricVersion; } + /** + * Set the fabricVersion property: The version of Network Fabric. + * + * @param fabricVersion the fabricVersion value to set. + * @return the NetworkFabricProperties object itself. + */ + public NetworkFabricProperties withFabricVersion(String fabricVersion) { + this.fabricVersion = fabricVersion; + return this; + } + /** * Get the routerIds property: Array of router IDs. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuInner.java index b0655d0104a8..7357e7544fb7 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuInner.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.managednetworkfabric.models.FabricSkuType; import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; @@ -21,6 +22,12 @@ public final class NetworkFabricSkuInner extends ProxyResource { @JsonProperty(value = "properties", required = true) private NetworkFabricSkuProperties innerProperties = new NetworkFabricSkuProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** Creates an instance of NetworkFabricSkuInner class. */ public NetworkFabricSkuInner() { } @@ -34,6 +41,15 @@ private NetworkFabricSkuProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: Type of Network Fabric SKU. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceInner.java index e0b4cc6bfdfe..7501e32037a8 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceInner.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; import com.azure.resourcemanager.managednetworkfabric.models.InterfaceType; @@ -21,6 +22,12 @@ public final class NetworkInterfaceInner extends ProxyResource { @JsonProperty(value = "properties", required = true) private NetworkInterfaceProperties innerProperties = new NetworkInterfaceProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** Creates an instance of NetworkInterfaceInner class. */ public NetworkInterfaceInner() { } @@ -34,6 +41,15 @@ private NetworkInterfaceProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the physicalIdentifier property: Physical Identifier of the network interface. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectInner.java index 9abda2dc8df5..4a8947c98957 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectInner.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; @@ -29,6 +30,12 @@ public final class NetworkToNetworkInterconnectInner extends ProxyResource { @JsonProperty(value = "properties", required = true) private NetworkToNetworkInterconnectProperties innerProperties = new NetworkToNetworkInterconnectProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** Creates an instance of NetworkToNetworkInterconnectInner class. */ public NetworkToNetworkInterconnectInner() { } @@ -42,6 +49,15 @@ private NetworkToNetworkInterconnectProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the nniType property: Type of NNI used. Example: CE | NPB. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyInner.java index 0ad3a01775ba..13feaa8d875f 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyInner.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyInner.java @@ -10,6 +10,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationState; import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; @@ -143,6 +144,31 @@ public AdministrativeState administrativeState() { return this.innerProperties() == null ? null : this.innerProperties().administrativeState(); } + /** + * Get the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @return the defaultAction value. + */ + public CommunityActionTypes defaultAction() { + return this.innerProperties() == null ? null : this.innerProperties().defaultAction(); + } + + /** + * Set the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @param defaultAction the defaultAction value to set. + * @return the RoutePolicyInner object itself. + */ + public RoutePolicyInner withDefaultAction(CommunityActionTypes defaultAction) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePolicyProperties(); + } + this.innerProperties().withDefaultAction(defaultAction); + return this; + } + /** * Get the statements property: Route Policy statements. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyPatchableProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyPatchableProperties.java index 773450a4f577..66da9257b1dd 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyPatchableProperties.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyPatchableProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.managednetworkfabric.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -12,6 +13,12 @@ /** Route Policy patchable properties. */ @Fluent public class RoutePolicyPatchableProperties { + /* + * Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + */ + @JsonProperty(value = "defaultAction") + private CommunityActionTypes defaultAction; + /* * Route Policy statements. */ @@ -22,6 +29,28 @@ public class RoutePolicyPatchableProperties { public RoutePolicyPatchableProperties() { } + /** + * Get the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @return the defaultAction value. + */ + public CommunityActionTypes defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @param defaultAction the defaultAction value to set. + * @return the RoutePolicyPatchableProperties object itself. + */ + public RoutePolicyPatchableProperties withDefaultAction(CommunityActionTypes defaultAction) { + this.defaultAction = defaultAction; + return this; + } + /** * Get the statements property: Route Policy statements. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyProperties.java index 339ca047e599..9f97ab835421 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyProperties.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyProperties.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationState; import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; @@ -48,6 +49,12 @@ public final class RoutePolicyProperties extends AnnotationResource { @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) private AdministrativeState administrativeState; + /* + * Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + */ + @JsonProperty(value = "defaultAction") + private CommunityActionTypes defaultAction; + /* * Route Policy statements. */ @@ -127,6 +134,28 @@ public AdministrativeState administrativeState() { return this.administrativeState; } + /** + * Get the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @return the defaultAction value. + */ + public CommunityActionTypes defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @param defaultAction the defaultAction value to set. + * @return the RoutePolicyProperties object itself. + */ + public RoutePolicyProperties withDefaultAction(CommunityActionTypes defaultAction) { + this.defaultAction = defaultAction; + return this; + } + /** * Get the statements property: Route Policy statements. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListImpl.java index aac334c475eb..d0169798c9d7 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListImpl.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListImpl.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationState; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; @@ -83,6 +84,10 @@ public String aclsUrl() { return this.innerModel().aclsUrl(); } + public CommunityActionTypes defaultAction() { + return this.innerModel().defaultAction(); + } + public List matchConfigurations() { List inner = this.innerModel().matchConfigurations(); if (inner != null) { @@ -284,6 +289,16 @@ public AccessControlListImpl withAclsUrl(String aclsUrl) { } } + public AccessControlListImpl withDefaultAction(CommunityActionTypes defaultAction) { + if (isInCreateMode()) { + this.innerModel().withDefaultAction(defaultAction); + return this; + } else { + this.updateBody.withDefaultAction(defaultAction); + return this; + } + } + public AccessControlListImpl withMatchConfigurations( List matchConfigurations) { if (isInCreateMode()) { diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiBuilder.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiBuilder.java index 0abbd8fab6ef..54d9d8cf20fd 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiBuilder.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiBuilder.java @@ -137,7 +137,7 @@ public AzureNetworkFabricManagementServiceApiImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworkImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworkImpl.java index d5417622f420..27c72b375a6d 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworkImpl.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworkImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.managednetworkfabric.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkInner; import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; @@ -37,6 +38,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String networkToNetworkInterconnectId() { return this.innerModel().networkToNetworkInterconnectId(); } diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkuImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkuImpl.java index 451a0045bde0..8b5180c4ea0a 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkuImpl.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkuImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.managednetworkfabric.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner; import com.azure.resourcemanager.managednetworkfabric.models.DeviceInterfaceProperties; import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; @@ -37,6 +38,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String model() { return this.innerModel().model(); } diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricImpl.java index db62db6ae830..7fc4bd8671a6 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricImpl.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricImpl.java @@ -20,7 +20,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerConfiguration; import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersion; +import com.azure.resourcemanager.managednetworkfabric.models.UpgradeNetworkFabricProperties; import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationProperties; import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationResponse; import java.util.Collections; @@ -277,11 +277,11 @@ public CommonPostActionResponseForDeviceUpdate deprovision(Context context) { return serviceManager.networkFabrics().deprovision(resourceGroupName, networkFabricName, context); } - public CommonPostActionResponseForStateUpdate upgrade(UpdateVersion body) { + public CommonPostActionResponseForStateUpdate upgrade(UpgradeNetworkFabricProperties body) { return serviceManager.networkFabrics().upgrade(resourceGroupName, networkFabricName, body); } - public CommonPostActionResponseForStateUpdate upgrade(UpdateVersion body, Context context) { + public CommonPostActionResponseForStateUpdate upgrade(UpgradeNetworkFabricProperties body, Context context) { return serviceManager.networkFabrics().upgrade(resourceGroupName, networkFabricName, body, context); } @@ -408,6 +408,11 @@ public NetworkFabricImpl withTags(Map tags) { } } + public NetworkFabricImpl withFabricVersion(String fabricVersion) { + this.innerModel().withFabricVersion(fabricVersion); + return this; + } + public NetworkFabricImpl withRackCount(Integer rackCount) { if (isInCreateMode()) { this.innerModel().withRackCount(rackCount); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkuImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkuImpl.java index 830ed1848f09..794b3d3e51c0 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkuImpl.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkuImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.managednetworkfabric.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner; import com.azure.resourcemanager.managednetworkfabric.models.FabricSkuType; import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricSku; @@ -35,6 +36,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public FabricSkuType typePropertiesType() { return this.innerModel().typePropertiesType(); } diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsClientImpl.java index c3c6d7ac6e68..fa784e3045ce 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsClientImpl.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsClientImpl.java @@ -41,7 +41,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPatch; import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricsListResult; import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersion; +import com.azure.resourcemanager.managednetworkfabric.models.UpgradeNetworkFabricProperties; import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationProperties; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -194,7 +194,7 @@ Mono>> upgrade( @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("networkFabricName") String networkFabricName, - @BodyParam("application/json") UpdateVersion body, + @BodyParam("application/json") UpgradeNetworkFabricProperties body, @HeaderParam("Accept") String accept, Context context); @@ -2181,7 +2181,7 @@ public CommonPostActionResponseForDeviceUpdateInner deprovision( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> upgradeWithResponseAsync( - String resourceGroupName, String networkFabricName, UpdateVersion body) { + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2241,7 +2241,7 @@ private Mono>> upgradeWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> upgradeWithResponseAsync( - String resourceGroupName, String networkFabricName, UpdateVersion body, Context context) { + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2297,7 +2297,7 @@ private Mono>> upgradeWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux< PollResult, CommonPostActionResponseForStateUpdateInner> - beginUpgradeAsync(String resourceGroupName, String networkFabricName, UpdateVersion body) { + beginUpgradeAsync(String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body) { Mono>> mono = upgradeWithResponseAsync(resourceGroupName, networkFabricName, body); return this .client @@ -2326,7 +2326,8 @@ private Mono>> upgradeWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux< PollResult, CommonPostActionResponseForStateUpdateInner> - beginUpgradeAsync(String resourceGroupName, String networkFabricName, UpdateVersion body, Context context) { + beginUpgradeAsync( + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body, Context context) { context = this.client.mergeContext(context); Mono>> mono = upgradeWithResponseAsync(resourceGroupName, networkFabricName, body, context); @@ -2356,7 +2357,7 @@ private Mono>> upgradeWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller< PollResult, CommonPostActionResponseForStateUpdateInner> - beginUpgrade(String resourceGroupName, String networkFabricName, UpdateVersion body) { + beginUpgrade(String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body) { return this.beginUpgradeAsync(resourceGroupName, networkFabricName, body).getSyncPoller(); } @@ -2377,7 +2378,8 @@ private Mono>> upgradeWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller< PollResult, CommonPostActionResponseForStateUpdateInner> - beginUpgrade(String resourceGroupName, String networkFabricName, UpdateVersion body, Context context) { + beginUpgrade( + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body, Context context) { return this.beginUpgradeAsync(resourceGroupName, networkFabricName, body, context).getSyncPoller(); } @@ -2396,7 +2398,7 @@ private Mono>> upgradeWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono upgradeAsync( - String resourceGroupName, String networkFabricName, UpdateVersion body) { + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body) { return beginUpgradeAsync(resourceGroupName, networkFabricName, body) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -2418,7 +2420,7 @@ private Mono upgradeAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono upgradeAsync( - String resourceGroupName, String networkFabricName, UpdateVersion body, Context context) { + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body, Context context) { return beginUpgradeAsync(resourceGroupName, networkFabricName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -2439,7 +2441,7 @@ private Mono upgradeAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public CommonPostActionResponseForStateUpdateInner upgrade( - String resourceGroupName, String networkFabricName, UpdateVersion body) { + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body) { return upgradeAsync(resourceGroupName, networkFabricName, body).block(); } @@ -2459,7 +2461,7 @@ public CommonPostActionResponseForStateUpdateInner upgrade( */ @ServiceMethod(returns = ReturnType.SINGLE) public CommonPostActionResponseForStateUpdateInner upgrade( - String resourceGroupName, String networkFabricName, UpdateVersion body, Context context) { + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body, Context context) { return upgradeAsync(resourceGroupName, networkFabricName, body, context).block(); } diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsImpl.java index 1033d2701239..dcc1ac0412f5 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsImpl.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsImpl.java @@ -19,7 +19,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabric; import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabrics; import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersion; +import com.azure.resourcemanager.managednetworkfabric.models.UpgradeNetworkFabricProperties; import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationProperties; import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationResponse; @@ -132,7 +132,7 @@ public CommonPostActionResponseForDeviceUpdate deprovision( } public CommonPostActionResponseForStateUpdate upgrade( - String resourceGroupName, String networkFabricName, UpdateVersion body) { + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body) { CommonPostActionResponseForStateUpdateInner inner = this.serviceClient().upgrade(resourceGroupName, networkFabricName, body); if (inner != null) { @@ -143,7 +143,7 @@ public CommonPostActionResponseForStateUpdate upgrade( } public CommonPostActionResponseForStateUpdate upgrade( - String resourceGroupName, String networkFabricName, UpdateVersion body, Context context) { + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body, Context context) { CommonPostActionResponseForStateUpdateInner inner = this.serviceClient().upgrade(resourceGroupName, networkFabricName, body, context); if (inner != null) { diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfaceImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfaceImpl.java index dcab47dc920f..94cc501e7387 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfaceImpl.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfaceImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.managednetworkfabric.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner; import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; @@ -32,6 +33,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String physicalIdentifier() { return this.innerModel().physicalIdentifier(); } diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectImpl.java index ea6dfa453553..bc9e117a717d 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectImpl.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.managednetworkfabric.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner; import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; @@ -43,6 +44,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public NniType nniType() { return this.innerModel().nniType(); } diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePolicyImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePolicyImpl.java index af56783c4006..7b6a944e443e 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePolicyImpl.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePolicyImpl.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate; import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationState; import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; @@ -77,6 +78,10 @@ public AdministrativeState administrativeState() { return this.innerModel().administrativeState(); } + public CommunityActionTypes defaultAction() { + return this.innerModel().defaultAction(); + } + public List statements() { List inner = this.innerModel().statements(); if (inner != null) { @@ -255,6 +260,16 @@ public RoutePolicyImpl withAddressFamilyType(AddressFamilyType addressFamilyType return this; } + public RoutePolicyImpl withDefaultAction(CommunityActionTypes defaultAction) { + if (isInCreateMode()) { + this.innerModel().withDefaultAction(defaultAction); + return this; + } else { + this.updateBody.withDefaultAction(defaultAction); + return this; + } + } + public RoutePolicyImpl withStatements(List statements) { if (isInCreateMode()) { this.innerModel().withStatements(statements); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlList.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlList.java index be93d7f5b566..271f6d665a5e 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlList.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlList.java @@ -98,6 +98,14 @@ public interface AccessControlList { */ String aclsUrl(); + /** + * Gets the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @return the defaultAction value. + */ + CommunityActionTypes defaultAction(); + /** * Gets the matchConfigurations property: List of match configurations. * @@ -199,6 +207,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithConfigurationType, DefinitionStages.WithAclsUrl, + DefinitionStages.WithDefaultAction, DefinitionStages.WithMatchConfigurations, DefinitionStages.WithDynamicMatchConfigurations, DefinitionStages.WithAnnotation { @@ -251,6 +260,19 @@ interface WithAclsUrl { WithCreate withAclsUrl(String aclsUrl); } + /** The stage of the AccessControlList definition allowing to specify defaultAction. */ + interface WithDefaultAction { + /** + * Specifies the defaultAction property: Default action that needs to be applied when no condition is + * matched. Example: Permit | Deny.. + * + * @param defaultAction Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * @return the next definition stage. + */ + WithCreate withDefaultAction(CommunityActionTypes defaultAction); + } + /** The stage of the AccessControlList definition allowing to specify matchConfigurations. */ interface WithMatchConfigurations { /** @@ -298,6 +320,7 @@ interface Update UpdateStages.WithAnnotation, UpdateStages.WithConfigurationType, UpdateStages.WithAclsUrl, + UpdateStages.WithDefaultAction, UpdateStages.WithMatchConfigurations, UpdateStages.WithDynamicMatchConfigurations { /** @@ -362,6 +385,19 @@ interface WithAclsUrl { Update withAclsUrl(String aclsUrl); } + /** The stage of the AccessControlList update allowing to specify defaultAction. */ + interface WithDefaultAction { + /** + * Specifies the defaultAction property: Default action that needs to be applied when no condition is + * matched. Example: Permit | Deny.. + * + * @param defaultAction Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * @return the next definition stage. + */ + Update withDefaultAction(CommunityActionTypes defaultAction); + } + /** The stage of the AccessControlList update allowing to specify matchConfigurations. */ interface WithMatchConfigurations { /** diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListMatchCondition.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListMatchCondition.java index 5fafb49cf319..285f158ad4f1 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListMatchCondition.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListMatchCondition.java @@ -12,31 +12,31 @@ @Fluent public final class AccessControlListMatchCondition extends CommonMatchConditions { /* - * List of ether type values that needs to be matched. + * List of ether type values that need to be matched. */ @JsonProperty(value = "etherTypes") private List etherTypes; /* - * List of IP fragment packets that needs to be matched. + * List of IP fragment packets that need to be matched. */ @JsonProperty(value = "fragments") private List fragments; /* - * List of IP Lengths that needs to be matched. + * List of IP Lengths that need to be matched. */ @JsonProperty(value = "ipLengths") private List ipLengths; /* - * List of TTL [Time To Live] values that needs to be matched. + * List of TTL [Time To Live] values that need to be matched. */ @JsonProperty(value = "ttlValues") private List ttlValues; /* - * List of DSCP Markings that needs to be matched. + * List of DSCP Markings that need to be matched. */ @JsonProperty(value = "dscpMarkings") private List dscpMarkings; @@ -52,7 +52,7 @@ public AccessControlListMatchCondition() { } /** - * Get the etherTypes property: List of ether type values that needs to be matched. + * Get the etherTypes property: List of ether type values that need to be matched. * * @return the etherTypes value. */ @@ -61,7 +61,7 @@ public List etherTypes() { } /** - * Set the etherTypes property: List of ether type values that needs to be matched. + * Set the etherTypes property: List of ether type values that need to be matched. * * @param etherTypes the etherTypes value to set. * @return the AccessControlListMatchCondition object itself. @@ -72,7 +72,7 @@ public AccessControlListMatchCondition withEtherTypes(List etherTypes) { } /** - * Get the fragments property: List of IP fragment packets that needs to be matched. + * Get the fragments property: List of IP fragment packets that need to be matched. * * @return the fragments value. */ @@ -81,7 +81,7 @@ public List fragments() { } /** - * Set the fragments property: List of IP fragment packets that needs to be matched. + * Set the fragments property: List of IP fragment packets that need to be matched. * * @param fragments the fragments value to set. * @return the AccessControlListMatchCondition object itself. @@ -92,7 +92,7 @@ public AccessControlListMatchCondition withFragments(List fragments) { } /** - * Get the ipLengths property: List of IP Lengths that needs to be matched. + * Get the ipLengths property: List of IP Lengths that need to be matched. * * @return the ipLengths value. */ @@ -101,7 +101,7 @@ public List ipLengths() { } /** - * Set the ipLengths property: List of IP Lengths that needs to be matched. + * Set the ipLengths property: List of IP Lengths that need to be matched. * * @param ipLengths the ipLengths value to set. * @return the AccessControlListMatchCondition object itself. @@ -112,7 +112,7 @@ public AccessControlListMatchCondition withIpLengths(List ipLengths) { } /** - * Get the ttlValues property: List of TTL [Time To Live] values that needs to be matched. + * Get the ttlValues property: List of TTL [Time To Live] values that need to be matched. * * @return the ttlValues value. */ @@ -121,7 +121,7 @@ public List ttlValues() { } /** - * Set the ttlValues property: List of TTL [Time To Live] values that needs to be matched. + * Set the ttlValues property: List of TTL [Time To Live] values that need to be matched. * * @param ttlValues the ttlValues value to set. * @return the AccessControlListMatchCondition object itself. @@ -132,7 +132,7 @@ public AccessControlListMatchCondition withTtlValues(List ttlValues) { } /** - * Get the dscpMarkings property: List of DSCP Markings that needs to be matched. + * Get the dscpMarkings property: List of DSCP Markings that need to be matched. * * @return the dscpMarkings value. */ @@ -141,7 +141,7 @@ public List dscpMarkings() { } /** - * Set the dscpMarkings property: List of DSCP Markings that needs to be matched. + * Set the dscpMarkings property: List of DSCP Markings that need to be matched. * * @param dscpMarkings the dscpMarkings value to set. * @return the AccessControlListMatchCondition object itself. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatch.java index 9e42af759095..c40f0726a1a5 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatch.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatch.java @@ -108,6 +108,31 @@ public AccessControlListPatch withAclsUrl(String aclsUrl) { return this; } + /** + * Get the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @return the defaultAction value. + */ + public CommunityActionTypes defaultAction() { + return this.innerProperties() == null ? null : this.innerProperties().defaultAction(); + } + + /** + * Set the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @param defaultAction the defaultAction value to set. + * @return the AccessControlListPatch object itself. + */ + public AccessControlListPatch withDefaultAction(CommunityActionTypes defaultAction) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessControlListPatchProperties(); + } + this.innerProperties().withDefaultAction(defaultAction); + return this; + } + /** * Get the matchConfigurations property: List of match configurations. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatchableProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatchableProperties.java index 1f3f0e76f119..b1d5c2bb7222 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatchableProperties.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatchableProperties.java @@ -23,6 +23,12 @@ public class AccessControlListPatchableProperties { @JsonProperty(value = "aclsUrl") private String aclsUrl; + /* + * Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + */ + @JsonProperty(value = "defaultAction") + private CommunityActionTypes defaultAction; + /* * List of match configurations. */ @@ -79,6 +85,28 @@ public AccessControlListPatchableProperties withAclsUrl(String aclsUrl) { return this; } + /** + * Get the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @return the defaultAction value. + */ + public CommunityActionTypes defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @param defaultAction the defaultAction value to set. + * @return the AccessControlListPatchableProperties object itself. + */ + public AccessControlListPatchableProperties withDefaultAction(CommunityActionTypes defaultAction) { + this.defaultAction = defaultAction; + return this; + } + /** * Get the matchConfigurations property: List of match configurations. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPortCondition.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPortCondition.java index f191a40090fb..47fe87a114fd 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPortCondition.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPortCondition.java @@ -12,7 +12,8 @@ @Fluent public final class AccessControlListPortCondition extends PortCondition { /* - * List of protocol flags that needs to be matched. + * List of protocol flags that need to be matched. Example: established | initial | . List of + * eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, not-rst, not-syn, not-urg, psh, rst, syn, urg */ @JsonProperty(value = "flags") private List flags; @@ -22,7 +23,9 @@ public AccessControlListPortCondition() { } /** - * Get the flags property: List of protocol flags that needs to be matched. + * Get the flags property: List of protocol flags that need to be matched. Example: established | initial | + * <List-of-TCP-flags>. List of eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, not-rst, not-syn, + * not-urg, psh, rst, syn, urg. * * @return the flags value. */ @@ -31,7 +34,9 @@ public List flags() { } /** - * Set the flags property: List of protocol flags that needs to be matched. + * Set the flags property: List of protocol flags that need to be matched. Example: established | initial | + * <List-of-TCP-flags>. List of eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, not-rst, not-syn, + * not-urg, psh, rst, syn, urg. * * @param flags the flags value to set. * @return the AccessControlListPortCondition object itself. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/CommonDynamicMatchConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/CommonDynamicMatchConfiguration.java index ae5b966ad5d7..0061580e2558 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/CommonDynamicMatchConfiguration.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/CommonDynamicMatchConfiguration.java @@ -24,7 +24,7 @@ public final class CommonDynamicMatchConfiguration { private List vlanGroups; /* - * List of the port group. + * List of the port groups. */ @JsonProperty(value = "portGroups") private List portGroups; @@ -74,7 +74,7 @@ public CommonDynamicMatchConfiguration withVlanGroups(List } /** - * Get the portGroups property: List of the port group. + * Get the portGroups property: List of the port groups. * * @return the portGroups value. */ @@ -83,7 +83,7 @@ public List portGroups() { } /** - * Set the portGroups property: List of the port group. + * Set the portGroups property: List of the port groups. * * @param portGroups the portGroups value to set. * @return the CommonDynamicMatchConfiguration object itself. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConfigurationState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConfigurationState.java index f2f3d7fd3cad..6e675d004918 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConfigurationState.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConfigurationState.java @@ -40,6 +40,12 @@ public final class ConfigurationState extends ExpandableStringEnum { /** Static value None for EncapsulationType. */ public static final EncapsulationType NONE = fromString("None"); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetwork.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetwork.java index 63230492b1b4..846b71e216dc 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetwork.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetwork.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.managednetworkfabric.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkInner; @@ -30,6 +31,13 @@ public interface ExternalNetwork { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the networkToNetworkInterconnectId property: Gets the networkToNetworkInterconnectId of the resource. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpMatchCondition.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpMatchCondition.java index 62e570856d54..76885fb6b28c 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpMatchCondition.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpMatchCondition.java @@ -12,19 +12,19 @@ @Fluent public final class IpMatchCondition { /* - * IP Address type. + * IP Address type that needs to be matched. */ @JsonProperty(value = "type") private SourceDestinationType type; /* - * IP Prefix Type. + * IP Prefix Type that needs to be matched. */ @JsonProperty(value = "prefixType") private PrefixType prefixType; /* - * The list of IP Prefixes. + * The list of IP Prefixes that need to be matched. */ @JsonProperty(value = "ipPrefixValues") private List ipPrefixValues; @@ -40,7 +40,7 @@ public IpMatchCondition() { } /** - * Get the type property: IP Address type. + * Get the type property: IP Address type that needs to be matched. * * @return the type value. */ @@ -49,7 +49,7 @@ public SourceDestinationType type() { } /** - * Set the type property: IP Address type. + * Set the type property: IP Address type that needs to be matched. * * @param type the type value to set. * @return the IpMatchCondition object itself. @@ -60,7 +60,7 @@ public IpMatchCondition withType(SourceDestinationType type) { } /** - * Get the prefixType property: IP Prefix Type. + * Get the prefixType property: IP Prefix Type that needs to be matched. * * @return the prefixType value. */ @@ -69,7 +69,7 @@ public PrefixType prefixType() { } /** - * Set the prefixType property: IP Prefix Type. + * Set the prefixType property: IP Prefix Type that needs to be matched. * * @param prefixType the prefixType value to set. * @return the IpMatchCondition object itself. @@ -80,7 +80,7 @@ public IpMatchCondition withPrefixType(PrefixType prefixType) { } /** - * Get the ipPrefixValues property: The list of IP Prefixes. + * Get the ipPrefixValues property: The list of IP Prefixes that need to be matched. * * @return the ipPrefixValues value. */ @@ -89,7 +89,7 @@ public List ipPrefixValues() { } /** - * Set the ipPrefixValues property: The list of IP Prefixes. + * Set the ipPrefixValues property: The list of IP Prefixes that need to be matched. * * @param ipPrefixValues the ipPrefixValues value to set. * @return the IpMatchCondition object itself. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSku.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSku.java index 4ffad6252ac5..129fc35fc95b 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSku.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSku.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.managednetworkfabric.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner; import java.util.List; @@ -30,6 +31,13 @@ public interface NetworkDeviceSku { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the model property: Model of the network device. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabric.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabric.java index 22a6dd528212..f2cbd1566fd7 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabric.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabric.java @@ -361,6 +361,7 @@ WithCreate withManagementNetworkConfiguration( */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithFabricVersion, DefinitionStages.WithRackCount, DefinitionStages.WithIpv6Prefix, DefinitionStages.WithAnnotation { @@ -391,6 +392,17 @@ interface WithTags { WithCreate withTags(Map tags); } + /** The stage of the NetworkFabric definition allowing to specify fabricVersion. */ + interface WithFabricVersion { + /** + * Specifies the fabricVersion property: The version of Network Fabric.. + * + * @param fabricVersion The version of Network Fabric. + * @return the next definition stage. + */ + WithCreate withFabricVersion(String fabricVersion); + } + /** The stage of the NetworkFabric definition allowing to specify rackCount. */ interface WithRackCount { /** @@ -640,7 +652,7 @@ interface WithAnnotation { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return common response for the state updates. */ - CommonPostActionResponseForStateUpdate upgrade(UpdateVersion body); + CommonPostActionResponseForStateUpdate upgrade(UpgradeNetworkFabricProperties body); /** * Implements the operation to the underlying resources. @@ -654,7 +666,7 @@ interface WithAnnotation { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return common response for the state updates. */ - CommonPostActionResponseForStateUpdate upgrade(UpdateVersion body, Context context); + CommonPostActionResponseForStateUpdate upgrade(UpgradeNetworkFabricProperties body, Context context); /** * Implements the operation to the underlying resources. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSku.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSku.java index ac6f8a5ed4f0..22e2a2f3b017 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSku.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSku.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.managednetworkfabric.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner; import java.util.List; @@ -30,6 +31,13 @@ public interface NetworkFabricSku { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the typePropertiesType property: Type of Network Fabric SKU. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricUpgradeAction.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricUpgradeAction.java new file mode 100644 index 000000000000..d1090e9aa39d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricUpgradeAction.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Action to be performed while upgrading the fabric. */ +public final class NetworkFabricUpgradeAction extends ExpandableStringEnum { + /** Static value Start for NetworkFabricUpgradeAction. */ + public static final NetworkFabricUpgradeAction START = fromString("Start"); + + /** Static value Complete for NetworkFabricUpgradeAction. */ + public static final NetworkFabricUpgradeAction COMPLETE = fromString("Complete"); + + /** + * Creates a new instance of NetworkFabricUpgradeAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkFabricUpgradeAction() { + } + + /** + * Creates or finds a NetworkFabricUpgradeAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkFabricUpgradeAction. + */ + @JsonCreator + public static NetworkFabricUpgradeAction fromString(String name) { + return fromString(name, NetworkFabricUpgradeAction.class); + } + + /** + * Gets known NetworkFabricUpgradeAction values. + * + * @return known NetworkFabricUpgradeAction values. + */ + public static Collection values() { + return values(NetworkFabricUpgradeAction.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabrics.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabrics.java index d939da9bd40b..0e2445bf95fc 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabrics.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabrics.java @@ -192,7 +192,7 @@ CommonPostActionResponseForDeviceUpdate deprovision( * @return common response for the state updates. */ CommonPostActionResponseForStateUpdate upgrade( - String resourceGroupName, String networkFabricName, UpdateVersion body); + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body); /** * Implements the operation to the underlying resources. @@ -209,7 +209,7 @@ CommonPostActionResponseForStateUpdate upgrade( * @return common response for the state updates. */ CommonPostActionResponseForStateUpdate upgrade( - String resourceGroupName, String networkFabricName, UpdateVersion body, Context context); + String resourceGroupName, String networkFabricName, UpgradeNetworkFabricProperties body, Context context); /** * Implements the operation to the underlying resources. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterface.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterface.java index a4f7c3ef4a22..809f4080bb92 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterface.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterface.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.managednetworkfabric.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner; @@ -30,6 +31,13 @@ public interface NetworkInterface { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the physicalIdentifier property: Physical Identifier of the network interface. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkTapRuleMatchCondition.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkTapRuleMatchCondition.java index f1937a3e294b..5b9304674840 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkTapRuleMatchCondition.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkTapRuleMatchCondition.java @@ -12,7 +12,7 @@ @Fluent public final class NetworkTapRuleMatchCondition extends CommonMatchConditions { /* - * Encapsulation Type. + * Encapsulation Type that needs to be matched. */ @JsonProperty(value = "encapsulationType") private EncapsulationType encapsulationType; @@ -28,7 +28,7 @@ public NetworkTapRuleMatchCondition() { } /** - * Get the encapsulationType property: Encapsulation Type. + * Get the encapsulationType property: Encapsulation Type that needs to be matched. * * @return the encapsulationType value. */ @@ -37,7 +37,7 @@ public EncapsulationType encapsulationType() { } /** - * Set the encapsulationType property: Encapsulation Type. + * Set the encapsulationType property: Encapsulation Type that needs to be matched. * * @param encapsulationType the encapsulationType value to set. * @return the NetworkTapRuleMatchCondition object itself. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnect.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnect.java index 65f9fef3eda3..ac0cdb89d067 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnect.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnect.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.managednetworkfabric.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner; @@ -30,6 +31,13 @@ public interface NetworkToNetworkInterconnect { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the nniType property: Type of NNI used. Example: CE | NPB. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectPatch.java index 0acb14e7b1c1..33eda5b77d02 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectPatch.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectPatch.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectPatchableProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -18,6 +19,12 @@ public final class NetworkToNetworkInterconnectPatch extends ProxyResource { @JsonProperty(value = "properties") private NetworkToNetworkInterconnectPatchableProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** Creates an instance of NetworkToNetworkInterconnectPatch class. */ public NetworkToNetworkInterconnectPatch() { } @@ -31,6 +38,15 @@ private NetworkToNetworkInterconnectPatchableProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the layer2Configuration property: Common properties for Layer2Configuration. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PortCondition.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PortCondition.java index 505816574941..a06d3c9d0c0f 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PortCondition.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PortCondition.java @@ -31,7 +31,7 @@ public class PortCondition { private List ports; /* - * List of the port Group Names that to be matched. + * List of the port Group Names that need to be matched. */ @JsonProperty(value = "portGroupNames") private List portGroupNames; @@ -101,7 +101,7 @@ public PortCondition withPorts(List ports) { } /** - * Get the portGroupNames property: List of the port Group Names that to be matched. + * Get the portGroupNames property: List of the port Group Names that need to be matched. * * @return the portGroupNames value. */ @@ -110,7 +110,7 @@ public List portGroupNames() { } /** - * Set the portGroupNames property: List of the port Group Names that to be matched. + * Set the portGroupNames property: List of the port Group Names that need to be matched. * * @param portGroupNames the portGroupNames value to set. * @return the PortCondition object itself. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PortGroupProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PortGroupProperties.java index aed7266de1c1..038fef8c2d56 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PortGroupProperties.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PortGroupProperties.java @@ -18,7 +18,7 @@ public final class PortGroupProperties { private String name; /* - * List of the ports that needs to be matched. + * List of the ports that need to be matched. */ @JsonProperty(value = "ports") private List ports; @@ -48,7 +48,7 @@ public PortGroupProperties withName(String name) { } /** - * Get the ports property: List of the ports that needs to be matched. + * Get the ports property: List of the ports that need to be matched. * * @return the ports value. */ @@ -57,7 +57,7 @@ public List ports() { } /** - * Set the ports property: List of the ports that needs to be matched. + * Set the ports property: List of the ports that need to be matched. * * @param ports the ports value to set. * @return the PortGroupProperties object itself. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PrefixType.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PrefixType.java index 8c954b818a86..cc204aa8b153 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PrefixType.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PrefixType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** IP Prefix Type. */ +/** IP Prefix Type that needs to be matched. */ public final class PrefixType extends ExpandableStringEnum { /** Static value Prefix for PrefixType. */ public static final PrefixType PREFIX = fromString("Prefix"); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicy.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicy.java index 0e0d810bdc76..7e9687271bd5 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicy.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicy.java @@ -91,6 +91,14 @@ public interface RoutePolicy { */ AdministrativeState administrativeState(); + /** + * Gets the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @return the defaultAction value. + */ + CommunityActionTypes defaultAction(); + /** * Gets the statements property: Route Policy statements. * @@ -196,6 +204,7 @@ interface WithNetworkFabricId { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithAddressFamilyType, + DefinitionStages.WithDefaultAction, DefinitionStages.WithStatements, DefinitionStages.WithAnnotation { /** @@ -238,6 +247,19 @@ interface WithAddressFamilyType { WithCreate withAddressFamilyType(AddressFamilyType addressFamilyType); } + /** The stage of the RoutePolicy definition allowing to specify defaultAction. */ + interface WithDefaultAction { + /** + * Specifies the defaultAction property: Default action that needs to be applied when no condition is + * matched. Example: Permit | Deny.. + * + * @param defaultAction Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * @return the next definition stage. + */ + WithCreate withDefaultAction(CommunityActionTypes defaultAction); + } + /** The stage of the RoutePolicy definition allowing to specify statements. */ interface WithStatements { /** @@ -269,7 +291,7 @@ interface WithAnnotation { RoutePolicy.Update update(); /** The template for RoutePolicy update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithStatements { + interface Update extends UpdateStages.WithTags, UpdateStages.WithDefaultAction, UpdateStages.WithStatements { /** * Executes the update request. * @@ -299,6 +321,19 @@ interface WithTags { Update withTags(Map tags); } + /** The stage of the RoutePolicy update allowing to specify defaultAction. */ + interface WithDefaultAction { + /** + * Specifies the defaultAction property: Default action that needs to be applied when no condition is + * matched. Example: Permit | Deny.. + * + * @param defaultAction Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * @return the next definition stage. + */ + Update withDefaultAction(CommunityActionTypes defaultAction); + } + /** The stage of the RoutePolicy update allowing to specify statements. */ interface WithStatements { /** diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPatch.java index bfe3c6b0a3a6..867955e69a94 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPatch.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPatch.java @@ -39,6 +39,31 @@ public RoutePolicyPatch withTags(Map tags) { return this; } + /** + * Get the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @return the defaultAction value. + */ + public CommunityActionTypes defaultAction() { + return this.innerProperties() == null ? null : this.innerProperties().defaultAction(); + } + + /** + * Set the defaultAction property: Default action that needs to be applied when no condition is matched. Example: + * Permit | Deny. + * + * @param defaultAction the defaultAction value to set. + * @return the RoutePolicyPatch object itself. + */ + public RoutePolicyPatch withDefaultAction(CommunityActionTypes defaultAction) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePolicyPatchableProperties(); + } + this.innerProperties().withDefaultAction(defaultAction); + return this; + } + /** * Get the statements property: Route Policy statements. * diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SourceDestinationType.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SourceDestinationType.java index 38033d46862f..6636e4010c3f 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SourceDestinationType.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SourceDestinationType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** IP Address type. */ +/** IP Address type that needs to be matched. */ public final class SourceDestinationType extends ExpandableStringEnum { /** Static value SourceIP for SourceDestinationType. */ public static final SourceDestinationType SOURCE_IP = fromString("SourceIP"); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateVersion.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateVersion.java index 087649ad71d0..ac7a202b8636 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateVersion.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateVersion.java @@ -9,7 +9,7 @@ /** Update version properties. */ @Fluent -public final class UpdateVersion { +public class UpdateVersion { /* * Specify the version. */ diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpgradeNetworkFabricProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpgradeNetworkFabricProperties.java new file mode 100644 index 000000000000..3daaf3743c07 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpgradeNetworkFabricProperties.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UpgradeNetworkFabricProperties model. */ +@Fluent +public final class UpgradeNetworkFabricProperties extends UpdateVersion { + /* + * Action to be performed while upgrading the fabric. + */ + @JsonProperty(value = "action") + private NetworkFabricUpgradeAction action; + + /** Creates an instance of UpgradeNetworkFabricProperties class. */ + public UpgradeNetworkFabricProperties() { + } + + /** + * Get the action property: Action to be performed while upgrading the fabric. + * + * @return the action value. + */ + public NetworkFabricUpgradeAction action() { + return this.action; + } + + /** + * Set the action property: Action to be performed while upgrading the fabric. + * + * @param action the action value to set. + * @return the UpgradeNetworkFabricProperties object itself. + */ + public UpgradeNetworkFabricProperties withAction(NetworkFabricUpgradeAction action) { + this.action = action; + return this; + } + + /** {@inheritDoc} */ + @Override + public UpgradeNetworkFabricProperties withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/VlanMatchCondition.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/VlanMatchCondition.java index 55300c8ec647..4cd8b5120190 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/VlanMatchCondition.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/VlanMatchCondition.java @@ -8,23 +8,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The vlan match conditions that needs to be matched. */ +/** The vlan match conditions that need to be matched. */ @Fluent public final class VlanMatchCondition { /* - * List of vlans that needs to be matched. + * List of vlans that need to be matched. */ @JsonProperty(value = "vlans") private List vlans; /* - * List of inner vlans that needs to be matched. + * List of inner vlans that need to be matched. */ @JsonProperty(value = "innerVlans") private List innerVlans; /* - * List of vlan group names that to be matched. + * List of vlan group names that need to be matched. */ @JsonProperty(value = "vlanGroupNames") private List vlanGroupNames; @@ -34,7 +34,7 @@ public VlanMatchCondition() { } /** - * Get the vlans property: List of vlans that needs to be matched. + * Get the vlans property: List of vlans that need to be matched. * * @return the vlans value. */ @@ -43,7 +43,7 @@ public List vlans() { } /** - * Set the vlans property: List of vlans that needs to be matched. + * Set the vlans property: List of vlans that need to be matched. * * @param vlans the vlans value to set. * @return the VlanMatchCondition object itself. @@ -54,7 +54,7 @@ public VlanMatchCondition withVlans(List vlans) { } /** - * Get the innerVlans property: List of inner vlans that needs to be matched. + * Get the innerVlans property: List of inner vlans that need to be matched. * * @return the innerVlans value. */ @@ -63,7 +63,7 @@ public List innerVlans() { } /** - * Set the innerVlans property: List of inner vlans that needs to be matched. + * Set the innerVlans property: List of inner vlans that need to be matched. * * @param innerVlans the innerVlans value to set. * @return the VlanMatchCondition object itself. @@ -74,7 +74,7 @@ public VlanMatchCondition withInnerVlans(List innerVlans) { } /** - * Get the vlanGroupNames property: List of vlan group names that to be matched. + * Get the vlanGroupNames property: List of vlan group names that need to be matched. * * @return the vlanGroupNames value. */ @@ -83,7 +83,7 @@ public List vlanGroupNames() { } /** - * Set the vlanGroupNames property: List of vlan group names that to be matched. + * Set the vlanGroupNames property: List of vlan group names that need to be matched. * * @param vlanGroupNames the vlanGroupNames value to set. * @return the VlanMatchCondition object itself. diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateSamples.java index 240a54f5d7f5..49087b957648 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateSamples.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; @@ -45,6 +46,7 @@ public static void accessControlListsCreateMaximumSetGen( .withTags(mapOf("keyID", "fakeTokenPlaceholder")) .withConfigurationType(ConfigurationType.FILE) .withAclsUrl("https://ACL-Storage-URL") + .withDefaultAction(CommunityActionTypes.PERMIT) .withMatchConfigurations( Arrays .asList( @@ -113,6 +115,7 @@ public static void accessControlListsCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateSamples.java index 6aa279181050..becdda9acaa5 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateSamples.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; @@ -49,6 +50,7 @@ public static void accessControlListsUpdateMaximumSetGen( .withAnnotation("annotation") .withConfigurationType(ConfigurationType.FILE) .withAclsUrl("https://microsoft.com/a") + .withDefaultAction(CommunityActionTypes.PERMIT) .withMatchConfigurations( Arrays .asList( @@ -116,6 +118,7 @@ public static void accessControlListsUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesCreateSamples.java index 9bb53cbef108..b2ad22e0b79a 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesCreateSamples.java @@ -34,6 +34,7 @@ public static void internetGatewayRulesCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesUpdateSamples.java index 8244418ac20d..cf855783692f 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesUpdateSamples.java @@ -29,6 +29,7 @@ public static void internetGatewayRulesUpdateMaximumSetGen( resource.update().withTags(mapOf("key3311", "fakeTokenPlaceholder")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysCreateSamples.java index e99ff242cfb1..27b71ff38599 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysCreateSamples.java @@ -35,6 +35,7 @@ public static void internetGatewaysCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysUpdateSamples.java index 21d8b616808a..2346fb12044b 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysUpdateSamples.java @@ -34,6 +34,7 @@ public static void internetGatewaysUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesCreateSamples.java index ec7fdded54b3..46ca3ef2ed36 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesCreateSamples.java @@ -41,6 +41,7 @@ public static void ipCommunitiesCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesCreateSamples.java index 29f5c807c807..331958bf14e7 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesCreateSamples.java @@ -39,6 +39,7 @@ public static void ipExtendedCommunitiesCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesUpdateSamples.java index 7a99dad469d3..7abcb31cd16b 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesUpdateSamples.java @@ -42,6 +42,7 @@ public static void ipExtendedCommunitiesUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesCreateSamples.java index 30ccbfe6f975..ce623080d5cd 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesCreateSamples.java @@ -42,6 +42,7 @@ public static void ipPrefixesCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesUpdateSamples.java index 2283ad99e99d..7572926cf665 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesUpdateSamples.java @@ -45,6 +45,7 @@ public static void ipPrefixesUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateSamples.java index e50861f3d629..3d59359a2095 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateSamples.java @@ -33,6 +33,7 @@ public static void l2IsolationDomainsCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateSamples.java index a16e99aa4504..360a879f5bf4 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateSamples.java @@ -33,6 +33,7 @@ public static void l2IsolationDomainsUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateSamples.java index b9f0c9940cad..e5ea00fa9e81 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateSamples.java @@ -54,6 +54,7 @@ public static void l3IsolationDomainsCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateSamples.java index 28cc688514f1..b8ffd0e05840 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateSamples.java @@ -55,6 +55,7 @@ public static void l3IsolationDomainsUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsCreateSamples.java index d1122ced0bb5..72c9fad3c30f 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsCreateSamples.java @@ -46,6 +46,7 @@ public static void neighborGroupsCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsUpdateSamples.java index 4f7626bbb530..bcc998f98da4 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsUpdateSamples.java @@ -49,6 +49,7 @@ public static void neighborGroupsUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateSamples.java index 8dc7479da3eb..e1d0b3ca658e 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateSamples.java @@ -32,6 +32,7 @@ public static void networkDevicesCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateSamples.java index 9ac541deb1b9..032ce9e6d388 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateSamples.java @@ -34,6 +34,7 @@ public static void networkDevicesUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCreateSamples.java index 49b9788c3708..74038ee7c86e 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCreateSamples.java @@ -103,12 +103,14 @@ public static void networkFabricsCreateMaximumSetGen( .withSecondaryIpv4Prefix("10.0.0.15/30") .withSecondaryIpv6Prefix("2FFE:FFFF:0:CD30::ac/126")))) .withTags(mapOf("keyID", "fakeTokenPlaceholder")) + .withFabricVersion("1.x.x") .withRackCount(4) .withIpv6Prefix("3FFE:FFFF:0:CD40::/59") .withAnnotation("annotation") .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateSamples.java index 9acdf6994db3..4d3f938b737b 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateSamples.java @@ -109,6 +109,7 @@ public static void networkFabricsUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpgradeSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpgradeSamples.java index a9e17ab15bae..5de284bf6fdb 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpgradeSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpgradeSamples.java @@ -4,7 +4,8 @@ package com.azure.resourcemanager.managednetworkfabric.generated; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersion; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricUpgradeAction; +import com.azure.resourcemanager.managednetworkfabric.models.UpgradeNetworkFabricProperties; /** Samples for NetworkFabrics Upgrade. */ public final class NetworkFabricsUpgradeSamples { @@ -23,7 +24,7 @@ public static void networkFabricsUpgradeMaximumSetGen( .upgrade( "example-rg", "example-fabric", - new UpdateVersion().withVersion("version1"), + new UpgradeNetworkFabricProperties().withVersion("3.x.x").withAction(NetworkFabricUpgradeAction.START), com.azure.core.util.Context.NONE); } } diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersCreateSamples.java index e9aa8e2818b6..061b4373bbd4 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersCreateSamples.java @@ -30,6 +30,7 @@ public static void networkPacketBrokersCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersUpdateSamples.java index e8ed7f39cdad..342947bdcb22 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersUpdateSamples.java @@ -29,6 +29,7 @@ public static void networkPacketBrokersUpdateMaximumSetGen( resource.update().withTags(mapOf("key8772", "fakeTokenPlaceholder")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateSamples.java index b069e71fb8c4..57d3986ca164 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateSamples.java @@ -33,6 +33,7 @@ public static void networkRacksCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksUpdateSamples.java index 6e900e7ff681..c51c2df8f8cc 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksUpdateSamples.java @@ -28,6 +28,7 @@ public static void networkRacksUpdateMaximumSetGen( resource.update().withTags(mapOf("keyID", "fakeTokenPlaceholder")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesCreateSamples.java index 9b452a9e5fdf..9d8c1e79fdcd 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesCreateSamples.java @@ -119,6 +119,7 @@ public static void networkTapRulesCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesUpdateSamples.java index 66c0f0760397..e8e8e36cd213 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesUpdateSamples.java @@ -117,6 +117,7 @@ public static void networkTapRulesUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsCreateSamples.java index 587c5a0d327a..3bb43be7b531 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsCreateSamples.java @@ -55,6 +55,7 @@ public static void networkTapsCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsUpdateSamples.java index a5a419d0fa47..505a65c8614f 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsUpdateSamples.java @@ -56,6 +56,7 @@ public static void networkTapsUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateSamples.java index e0ff60d5df86..bcee8d1ea0fe 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateSamples.java @@ -7,6 +7,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; @@ -39,6 +40,7 @@ public static void routePoliciesCreateMaximumSetGen( "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric") .withTags(mapOf("keyID", "fakeTokenPlaceholder")) .withAddressFamilyType(AddressFamilyType.IPV4) + .withDefaultAction(CommunityActionTypes.DENY) .withStatements( Arrays .asList( @@ -106,6 +108,7 @@ public static void routePoliciesCreateMaximumSetGen( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateSamples.java index 850623a32394..c54fe9ff3746 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateSamples.java +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateSamples.java @@ -6,6 +6,7 @@ import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; @@ -38,6 +39,7 @@ public static void routePoliciesUpdateMaximumSetGen( resource .update() .withTags(mapOf("keyID", "fakeTokenPlaceholder")) + .withDefaultAction(CommunityActionTypes.DENY) .withStatements( Arrays .asList( @@ -104,6 +106,7 @@ public static void routePoliciesUpdateMaximumSetGen( .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListActionTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListActionTests.java deleted file mode 100644 index 3a03561c018c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListActionTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListAction; -import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; -import org.junit.jupiter.api.Assertions; - -public final class AccessControlListActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccessControlListAction model = - BinaryData - .fromString("{\"type\":\"Drop\",\"counterName\":\"winhehfqpo\"}") - .toObject(AccessControlListAction.class); - Assertions.assertEquals(AclActionType.DROP, model.type()); - Assertions.assertEquals("winhehfqpo", model.counterName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessControlListAction model = - new AccessControlListAction().withType(AclActionType.DROP).withCounterName("winhehfqpo"); - model = BinaryData.fromObject(model).toObject(AccessControlListAction.class); - Assertions.assertEquals(AclActionType.DROP, model.type()); - Assertions.assertEquals("winhehfqpo", model.counterName()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListInnerTests.java deleted file mode 100644 index fab364e97a75..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListInnerTests.java +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListInner; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListAction; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AccessControlListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccessControlListInner model = - BinaryData - .fromString( - "{\"properties\":{\"lastSyncedTime\":\"2021-03-24T17:54:20Z\",\"configurationState\":\"Failed\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"MAT\",\"configurationType\":\"Inline\",\"aclsUrl\":\"bczmeh\",\"matchConfigurations\":[{\"matchConfigurationName\":\"pbsphrupidgs\",\"sequenceNumber\":5720978843418888179,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"cmsxaobhdxbm\"],\"fragments\":[\"oqjzehtbmufpowno\"],\"ipLengths\":[\"wlrxyb\",\"soqijg\"],\"ttlValues\":[\"bpazlobcufpdzn\",\"btcqq\",\"nq\",\"lhqgnufooojy\"],\"dscpMarkings\":[\"sqe\",\"aagdfmg\",\"zlhjxrifkwmrvkt\",\"izntocipao\"],\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"qucmpo\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"ogknygjofjdd\",\"qs\",\"deupewnwrei\",\"jzyflu\"],\"fragments\":[\"hmofc\"],\"ipLengths\":[\"my\"],\"ttlValues\":[\"dtmlxhekuksjt\",\"ukcdmparcryuanzw\",\"xzdxtayrlhmwh\"],\"dscpMarkings\":[\"rqobmtuk\",\"nryrtihf\",\"tijbpzvgnwzsymgl\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"zk\",\"hdbihan\",\"fhfcb\",\"y\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Count\",\"counterName\":\"hab\"}]},{\"matchConfigurationName\":\"pikxwczbyscnpqxu\",\"sequenceNumber\":3437469293095173263,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"br\"],\"fragments\":[\"dumjgrtfwvuk\"],\"ipLengths\":[\"udccsnhsjc\",\"yejhk\",\"yhtnapczwlokjye\"],\"ttlValues\":[\"vnipjox\",\"jnchgej\",\"podmailzydehojwy\"],\"dscpMarkings\":[\"xinpmqnjaq\",\"ixjsprozvcputeg\",\"vwmf\"],\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"mdvpjhulsu\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Count\",\"counterName\":\"rwfndiod\"},{\"type\":\"Log\",\"counterName\":\"w\"},{\"type\":\"Drop\",\"counterName\":\"vwryoqpso\"}]},{\"matchConfigurationName\":\"ctazakljlahbcryf\",\"sequenceNumber\":5965878792837381583,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"paojakhmsbzjh\",\"rzevdphlxaol\",\"hqtrgqjbpf\"],\"fragments\":[\"inzgvfcj\"],\"ipLengths\":[\"oxxjtfelluwf\",\"it\"],\"ttlValues\":[\"eqfpj\",\"jlxofpdvhpfxxyp\",\"ninmayhuyb\"],\"dscpMarkings\":[\"odepoogin\",\"vamih\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"rxzxtheo\",\"usivye\",\"cciqihnhungbwjz\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"xgispemvtzfkufu\"],\"fragments\":[\"ofx\",\"eofjaeqjh\"],\"ipLengths\":[\"asvm\"],\"ttlValues\":[\"qulngsntnbybkzgc\"],\"dscpMarkings\":[\"clxxwrljdo\",\"skcqvkocrcjd\"],\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"xbnjbiksq\",\"gls\",\"ainqpjwnzlljfm\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"vmgxsab\",\"yqduujit\",\"jczdzevndh\",\"rwpdappdsbdkvwrw\"],\"fragments\":[\"usnhutje\",\"tmrldhugjzzdatq\"],\"ipLengths\":[\"cdgea\"],\"ttlValues\":[\"phut\",\"cndvkaozwyiftyhx\",\"urokft\"],\"dscpMarkings\":[\"lniwpwcukjfkgiaw\",\"klryplwck\",\"asy\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"hsgcbacphejkot\",\"nqgoulzndli\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"gfgibm\"],\"fragments\":[\"akeqs\",\"xybz\"],\"ipLengths\":[\"dqytbciqfouflmm\"],\"ttlValues\":[\"smodmgloug\"],\"dscpMarkings\":[\"wtmutduq\",\"ta\",\"spwgcuertumkdosv\",\"whbmd\"],\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"ddgmb\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Count\",\"counterName\":\"tq\"},{\"type\":\"Count\",\"counterName\":\"fpfpsalgbquxigj\"},{\"type\":\"Log\",\"counterName\":\"jaoyfhrtx\"}]},{\"matchConfigurationName\":\"n\",\"sequenceNumber\":5477626889722442552,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"etherTypes\":[\"juvf\"],\"fragments\":[\"rlyxwjkcprbnw\",\"xgjvtbv\",\"ysszdnrujqguh\"],\"ipLengths\":[\"uqfprwzw\",\"nguitnwuizgazxu\"],\"ttlValues\":[\"uckyf\",\"hr\"],\"dscpMarkings\":[\"fvzwdzuhty\",\"wisdkft\",\"wxmnteiwao\"],\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"jcmmxdcufufsrp\",\"mzidnsezcxtb\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"c\"],\"fragments\":[\"ewmdw\",\"jeiachboosfl\",\"ro\",\"fqpte\"],\"ipLengths\":[\"zvypyqrimzinp\",\"swjdkirso\",\"dqxhcrmnohjtckwh\",\"soifiyipjxsqw\"],\"ttlValues\":[\"jbznorc\"],\"dscpMarkings\":[\"snb\"],\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"nmoc\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"urzafb\",\"jjgpb\",\"oq\"],\"fragments\":[\"klj\",\"vbqid\"],\"ipLengths\":[\"jzyulpk\",\"dj\"],\"ttlValues\":[\"khbzhfepgzg\",\"e\"],\"dscpMarkings\":[\"ocxscpaierhhbcs\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"a\",\"tjaodxobnb\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Drop\",\"counterName\":\"ajionpimexgstxg\"},{\"type\":\"Log\",\"counterName\":\"gmaajrm\"},{\"type\":\"Count\",\"counterName\":\"zrlovmclwhijcoej\"}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{\"name\":\"s\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"kbfkg\",\"kdkexxp\",\"ofmx\"]},{\"name\":\"c\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"dtocj\",\"xhvpmoue\",\"hd\"]},{\"name\":\"i\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"nxqbzvddn\",\"wndeicbtwnp\",\"aoqvuh\",\"hcffcyddglmjthjq\"]}],\"vlanGroups\":[{\"name\":\"eicxmqciwqvhkhi\",\"vlans\":[\"gdtopbobjogh\",\"e\",\"u\"]},{\"name\":\"a\",\"vlans\":[\"z\",\"yvvtpgvdfgio\"]}],\"portGroups\":[{\"name\":\"utqxlngx\",\"ports\":[\"gug\",\"xkrxdqmi\",\"tthzrvqd\",\"abhjybi\"]},{\"name\":\"h\",\"ports\":[\"bowsk\",\"nyktzlcuiy\",\"gqywgndrv\"]},{\"name\":\"hzgpphrcgyncocpe\",\"ports\":[\"m\",\"coofsxlzev\"]},{\"name\":\"m\",\"ports\":[\"abcypmivk\",\"lzu\"]}]},{\"ipGroups\":[{\"name\":\"wnfnbacf\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"bxetqgtzxdpn\",\"bqqwxrj\",\"eallnwsubisnj\"]}],\"vlanGroups\":[{\"name\":\"ngnzscxaqwoochc\",\"vlans\":[\"qvpkvlrxnjeaseip\",\"eo\",\"lokeyy\"]}],\"portGroups\":[{\"name\":\"bdlwtgrhpdjpj\",\"ports\":[\"sxazjpq\",\"e\",\"ualhbxxhejj\",\"zvdudgwdslfhotwm\"]}]},{\"ipGroups\":[{\"name\":\"wlbjnpgacftade\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"yfsoppu\",\"uesnzwdejbavo\",\"xzdmohctb\",\"vudwx\"]},{\"name\":\"dnvowg\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"wdkcglhsl\",\"zj\",\"yggdtjixh\"]},{\"name\":\"uofqwe\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"n\",\"vfyexfw\",\"ybcibvyvdcsit\",\"nnaamdectehfiqsc\"]}],\"vlanGroups\":[{\"name\":\"vhezrkgqhcj\",\"vlans\":[\"o\",\"gm\",\"qsl\",\"yyvxyqjpkcattpn\"]},{\"name\":\"cr\",\"vlans\":[\"sqpjhvmdajvn\",\"sounqecanoaeu\",\"fhyhltrpmopjmcma\",\"u\"]},{\"name\":\"thfuiuaodsfcpkvx\",\"vlans\":[\"uozmyzydagfua\",\"bezy\",\"uokktwhrdxwz\"]}],\"portGroups\":[{\"name\":\"mbsureximo\",\"ports\":[\"cfsf\"]}]},{\"ipGroups\":[{\"name\":\"ddystkiiuxhqy\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"rq\",\"b\",\"oczvy\",\"fqrvkdvjsllrmvvd\"]},{\"name\":\"atkpnp\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"bczw\",\"ruwiqzbqjvsov\",\"yokacspkw\"]}],\"vlanGroups\":[{\"name\":\"obpxjmflbvvn\",\"vlans\":[\"kcciwwzjuqkhr\",\"ajiwkuo\",\"oskg\"]},{\"name\":\"auu\",\"vlans\":[\"mvxi\",\"duugidyjr\"]},{\"name\":\"byao\",\"vlans\":[\"xc\"]},{\"name\":\"npc\",\"vlans\":[\"cohslkev\",\"eggzfb\",\"hfmvfaxkffe\"]}],\"portGroups\":[{\"name\":\"lvmezyvshxmzsbbz\",\"ports\":[\"igrxwburvjxxjn\"]}]}],\"annotation\":\"ydptkoen\"},\"location\":\"uknvudwti\",\"tags\":{\"azyxoegukg\":\"ldngkpoci\",\"mrbpizcdrqj\":\"npiucgygevqznty\",\"yhxdeoejzicwi\":\"dpydn\"},\"id\":\"sjttgzfbish\",\"name\":\"bkh\",\"type\":\"jdeyeamdpha\"}") - .toObject(AccessControlListInner.class); - Assertions.assertEquals("uknvudwti", model.location()); - Assertions.assertEquals("ldngkpoci", model.tags().get("azyxoegukg")); - Assertions.assertEquals(ConfigurationType.INLINE, model.configurationType()); - Assertions.assertEquals("bczmeh", model.aclsUrl()); - Assertions.assertEquals("pbsphrupidgs", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(5720978843418888179L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals("qucmpo", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "cmsxaobhdxbm", model.matchConfigurations().get(0).matchConditions().get(0).etherTypes().get(0)); - Assertions - .assertEquals( - "oqjzehtbmufpowno", model.matchConfigurations().get(0).matchConditions().get(0).fragments().get(0)); - Assertions - .assertEquals("wlrxyb", model.matchConfigurations().get(0).matchConditions().get(0).ipLengths().get(0)); - Assertions - .assertEquals( - "bpazlobcufpdzn", model.matchConfigurations().get(0).matchConditions().get(0).ttlValues().get(0)); - Assertions - .assertEquals("sqe", model.matchConfigurations().get(0).matchConditions().get(0).dscpMarkings().get(0)); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions.assertEquals(AclActionType.COUNT, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("hab", model.matchConfigurations().get(0).actions().get(0).counterName()); - Assertions.assertEquals("s", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV4, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals("kbfkg", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions - .assertEquals("eicxmqciwqvhkhi", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("gdtopbobjogh", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("utqxlngx", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("gug", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - Assertions.assertEquals("ydptkoen", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessControlListInner model = - new AccessControlListInner() - .withLocation("uknvudwti") - .withTags(mapOf("azyxoegukg", "ldngkpoci", "mrbpizcdrqj", "npiucgygevqznty", "yhxdeoejzicwi", "dpydn")) - .withConfigurationType(ConfigurationType.INLINE) - .withAclsUrl("bczmeh") - .withMatchConfigurations( - Arrays - .asList( - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("pbsphrupidgs") - .withSequenceNumber(5720978843418888179L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("qucmpo")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("cmsxaobhdxbm")) - .withFragments(Arrays.asList("oqjzehtbmufpowno")) - .withIpLengths(Arrays.asList("wlrxyb", "soqijg")) - .withTtlValues( - Arrays.asList("bpazlobcufpdzn", "btcqq", "nq", "lhqgnufooojy")) - .withDscpMarkings( - Arrays.asList("sqe", "aagdfmg", "zlhjxrifkwmrvkt", "izntocipao")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.TCP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("zk", "hdbihan", "fhfcb", "y")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes( - Arrays.asList("ogknygjofjdd", "qs", "deupewnwrei", "jzyflu")) - .withFragments(Arrays.asList("hmofc")) - .withIpLengths(Arrays.asList("my")) - .withTtlValues( - Arrays.asList("dtmlxhekuksjt", "ukcdmparcryuanzw", "xzdxtayrlhmwh")) - .withDscpMarkings( - Arrays.asList("rqobmtuk", "nryrtihf", "tijbpzvgnwzsymgl")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("hab"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("pikxwczbyscnpqxu") - .withSequenceNumber(3437469293095173263L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("mdvpjhulsu")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("br")) - .withFragments(Arrays.asList("dumjgrtfwvuk")) - .withIpLengths(Arrays.asList("udccsnhsjc", "yejhk", "yhtnapczwlokjye")) - .withTtlValues(Arrays.asList("vnipjox", "jnchgej", "podmailzydehojwy")) - .withDscpMarkings( - Arrays.asList("xinpmqnjaq", "ixjsprozvcputeg", "vwmf")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.TCP)))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("rwfndiod"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("w"), - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("vwryoqpso"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("ctazakljlahbcryf") - .withSequenceNumber(5965878792837381583L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes( - Arrays.asList("rxzxtheo", "usivye", "cciqihnhungbwjz")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes( - Arrays.asList("paojakhmsbzjh", "rzevdphlxaol", "hqtrgqjbpf")) - .withFragments(Arrays.asList("inzgvfcj")) - .withIpLengths(Arrays.asList("oxxjtfelluwf", "it")) - .withTtlValues(Arrays.asList("eqfpj", "jlxofpdvhpfxxyp", "ninmayhuyb")) - .withDscpMarkings(Arrays.asList("odepoogin", "vamih")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("xbnjbiksq", "gls", "ainqpjwnzlljfm")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("xgispemvtzfkufu")) - .withFragments(Arrays.asList("ofx", "eofjaeqjh")) - .withIpLengths(Arrays.asList("asvm")) - .withTtlValues(Arrays.asList("qulngsntnbybkzgc")) - .withDscpMarkings(Arrays.asList("clxxwrljdo", "skcqvkocrcjd")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.TCP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("hsgcbacphejkot", "nqgoulzndli")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes( - Arrays - .asList( - "vmgxsab", "yqduujit", "jczdzevndh", "rwpdappdsbdkvwrw")) - .withFragments(Arrays.asList("usnhutje", "tmrldhugjzzdatq")) - .withIpLengths(Arrays.asList("cdgea")) - .withTtlValues(Arrays.asList("phut", "cndvkaozwyiftyhx", "urokft")) - .withDscpMarkings(Arrays.asList("lniwpwcukjfkgiaw", "klryplwck", "asy")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("ddgmb")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("gfgibm")) - .withFragments(Arrays.asList("akeqs", "xybz")) - .withIpLengths(Arrays.asList("dqytbciqfouflmm")) - .withTtlValues(Arrays.asList("smodmgloug")) - .withDscpMarkings( - Arrays.asList("wtmutduq", "ta", "spwgcuertumkdosv", "whbmd")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.TCP)))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("tq"), - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("fpfpsalgbquxigj"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("jaoyfhrtx"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("n") - .withSequenceNumber(5477626889722442552L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("jcmmxdcufufsrp", "mzidnsezcxtb")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("juvf")) - .withFragments( - Arrays.asList("rlyxwjkcprbnw", "xgjvtbv", "ysszdnrujqguh")) - .withIpLengths(Arrays.asList("uqfprwzw", "nguitnwuizgazxu")) - .withTtlValues(Arrays.asList("uckyf", "hr")) - .withDscpMarkings(Arrays.asList("fvzwdzuhty", "wisdkft", "wxmnteiwao")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.TCP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("nmoc")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("c")) - .withFragments(Arrays.asList("ewmdw", "jeiachboosfl", "ro", "fqpte")) - .withIpLengths( - Arrays - .asList( - "zvypyqrimzinp", - "swjdkirso", - "dqxhcrmnohjtckwh", - "soifiyipjxsqw")) - .withTtlValues(Arrays.asList("jbznorc")) - .withDscpMarkings(Arrays.asList("snb")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.TCP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("a", "tjaodxobnb")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("urzafb", "jjgpb", "oq")) - .withFragments(Arrays.asList("klj", "vbqid")) - .withIpLengths(Arrays.asList("jzyulpk", "dj")) - .withTtlValues(Arrays.asList("khbzhfepgzg", "e")) - .withDscpMarkings(Arrays.asList("ocxscpaierhhbcs")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("ajionpimexgstxg"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("gmaajrm"), - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("zrlovmclwhijcoej"))))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("s") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("kbfkg", "kdkexxp", "ofmx")), - new IpGroupProperties() - .withName("c") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("dtocj", "xhvpmoue", "hd")), - new IpGroupProperties() - .withName("i") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays - .asList( - "nxqbzvddn", "wndeicbtwnp", "aoqvuh", "hcffcyddglmjthjq")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("eicxmqciwqvhkhi") - .withVlans(Arrays.asList("gdtopbobjogh", "e", "u")), - new VlanGroupProperties() - .withName("a") - .withVlans(Arrays.asList("z", "yvvtpgvdfgio")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("utqxlngx") - .withPorts(Arrays.asList("gug", "xkrxdqmi", "tthzrvqd", "abhjybi")), - new PortGroupProperties() - .withName("h") - .withPorts(Arrays.asList("bowsk", "nyktzlcuiy", "gqywgndrv")), - new PortGroupProperties() - .withName("hzgpphrcgyncocpe") - .withPorts(Arrays.asList("m", "coofsxlzev")), - new PortGroupProperties() - .withName("m") - .withPorts(Arrays.asList("abcypmivk", "lzu")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("wnfnbacf") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays.asList("bxetqgtzxdpn", "bqqwxrj", "eallnwsubisnj")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("ngnzscxaqwoochc") - .withVlans(Arrays.asList("qvpkvlrxnjeaseip", "eo", "lokeyy")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("bdlwtgrhpdjpj") - .withPorts( - Arrays.asList("sxazjpq", "e", "ualhbxxhejj", "zvdudgwdslfhotwm")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("wlbjnpgacftade") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays.asList("yfsoppu", "uesnzwdejbavo", "xzdmohctb", "vudwx")), - new IpGroupProperties() - .withName("dnvowg") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("wdkcglhsl", "zj", "yggdtjixh")), - new IpGroupProperties() - .withName("uofqwe") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays - .asList("n", "vfyexfw", "ybcibvyvdcsit", "nnaamdectehfiqsc")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("vhezrkgqhcj") - .withVlans(Arrays.asList("o", "gm", "qsl", "yyvxyqjpkcattpn")), - new VlanGroupProperties() - .withName("cr") - .withVlans( - Arrays - .asList( - "sqpjhvmdajvn", "sounqecanoaeu", "fhyhltrpmopjmcma", "u")), - new VlanGroupProperties() - .withName("thfuiuaodsfcpkvx") - .withVlans(Arrays.asList("uozmyzydagfua", "bezy", "uokktwhrdxwz")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("mbsureximo") - .withPorts(Arrays.asList("cfsf")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("ddystkiiuxhqy") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("rq", "b", "oczvy", "fqrvkdvjsllrmvvd")), - new IpGroupProperties() - .withName("atkpnp") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("bczw", "ruwiqzbqjvsov", "yokacspkw")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("obpxjmflbvvn") - .withVlans(Arrays.asList("kcciwwzjuqkhr", "ajiwkuo", "oskg")), - new VlanGroupProperties() - .withName("auu") - .withVlans(Arrays.asList("mvxi", "duugidyjr")), - new VlanGroupProperties().withName("byao").withVlans(Arrays.asList("xc")), - new VlanGroupProperties() - .withName("npc") - .withVlans(Arrays.asList("cohslkev", "eggzfb", "hfmvfaxkffe")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("lvmezyvshxmzsbbz") - .withPorts(Arrays.asList("igrxwburvjxxjn")))))) - .withAnnotation("ydptkoen"); - model = BinaryData.fromObject(model).toObject(AccessControlListInner.class); - Assertions.assertEquals("uknvudwti", model.location()); - Assertions.assertEquals("ldngkpoci", model.tags().get("azyxoegukg")); - Assertions.assertEquals(ConfigurationType.INLINE, model.configurationType()); - Assertions.assertEquals("bczmeh", model.aclsUrl()); - Assertions.assertEquals("pbsphrupidgs", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(5720978843418888179L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals("qucmpo", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "cmsxaobhdxbm", model.matchConfigurations().get(0).matchConditions().get(0).etherTypes().get(0)); - Assertions - .assertEquals( - "oqjzehtbmufpowno", model.matchConfigurations().get(0).matchConditions().get(0).fragments().get(0)); - Assertions - .assertEquals("wlrxyb", model.matchConfigurations().get(0).matchConditions().get(0).ipLengths().get(0)); - Assertions - .assertEquals( - "bpazlobcufpdzn", model.matchConfigurations().get(0).matchConditions().get(0).ttlValues().get(0)); - Assertions - .assertEquals("sqe", model.matchConfigurations().get(0).matchConditions().get(0).dscpMarkings().get(0)); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions.assertEquals(AclActionType.COUNT, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("hab", model.matchConfigurations().get(0).actions().get(0).counterName()); - Assertions.assertEquals("s", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV4, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals("kbfkg", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions - .assertEquals("eicxmqciwqvhkhi", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("gdtopbobjogh", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("utqxlngx", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("gug", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - Assertions.assertEquals("ydptkoen", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListMatchConditionTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListMatchConditionTests.java deleted file mode 100644 index b8f2f8084f9b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListMatchConditionTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AccessControlListMatchConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccessControlListMatchCondition model = - BinaryData - .fromString( - "{\"etherTypes\":[\"pmdtz\"],\"fragments\":[\"tfvnz\",\"yj\"],\"ipLengths\":[\"p\",\"opv\",\"bdb\"],\"ttlValues\":[\"qqihedsvqwthmk\",\"ibcysihsgqc\",\"dhohsdtmcdzsuf\"],\"dscpMarkings\":[\"dxbzlmcmuap\",\"vhdbevwqqxey\"],\"portCondition\":{\"flags\":[\"qzinkfkbg\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"eqocljmygvk\",\"qkjjeokbz\"],\"portGroupNames\":[\"zrxcczurt\",\"e\",\"pqxbkwvzgnzvdf\",\"zdix\"]},\"protocolTypes\":[\"pnodawopqhe\"],\"vlanMatchCondition\":{\"vlans\":[\"mcgsbostzelnd\"],\"innerVlans\":[\"utmzlbiojlvfhrbb\",\"neqvcwwyyurmo\"],\"vlanGroupNames\":[\"prprsnmokay\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"pbzpcpiljhahz\"],\"ipGroupNames\":[\"h\",\"dbn\",\"ieholewjwi\"]}}") - .toObject(AccessControlListMatchCondition.class); - Assertions.assertEquals("pnodawopqhe", model.protocolTypes().get(0)); - Assertions.assertEquals("mcgsbostzelnd", model.vlanMatchCondition().vlans().get(0)); - Assertions.assertEquals("utmzlbiojlvfhrbb", model.vlanMatchCondition().innerVlans().get(0)); - Assertions.assertEquals("prprsnmokay", model.vlanMatchCondition().vlanGroupNames().get(0)); - Assertions.assertEquals(SourceDestinationType.SOURCE_IP, model.ipCondition().type()); - Assertions.assertEquals(PrefixType.PREFIX, model.ipCondition().prefixType()); - Assertions.assertEquals("pbzpcpiljhahz", model.ipCondition().ipPrefixValues().get(0)); - Assertions.assertEquals("h", model.ipCondition().ipGroupNames().get(0)); - Assertions.assertEquals("pmdtz", model.etherTypes().get(0)); - Assertions.assertEquals("tfvnz", model.fragments().get(0)); - Assertions.assertEquals("p", model.ipLengths().get(0)); - Assertions.assertEquals("qqihedsvqwthmk", model.ttlValues().get(0)); - Assertions.assertEquals("dxbzlmcmuap", model.dscpMarkings().get(0)); - Assertions.assertEquals(PortType.SOURCE_PORT, model.portCondition().portType()); - Assertions.assertEquals(Layer4Protocol.UDP, model.portCondition().layer4Protocol()); - Assertions.assertEquals("eqocljmygvk", model.portCondition().ports().get(0)); - Assertions.assertEquals("zrxcczurt", model.portCondition().portGroupNames().get(0)); - Assertions.assertEquals("qzinkfkbg", model.portCondition().flags().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessControlListMatchCondition model = - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("pnodawopqhe")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("mcgsbostzelnd")) - .withInnerVlans(Arrays.asList("utmzlbiojlvfhrbb", "neqvcwwyyurmo")) - .withVlanGroupNames(Arrays.asList("prprsnmokay"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("pbzpcpiljhahz")) - .withIpGroupNames(Arrays.asList("h", "dbn", "ieholewjwi"))) - .withEtherTypes(Arrays.asList("pmdtz")) - .withFragments(Arrays.asList("tfvnz", "yj")) - .withIpLengths(Arrays.asList("p", "opv", "bdb")) - .withTtlValues(Arrays.asList("qqihedsvqwthmk", "ibcysihsgqc", "dhohsdtmcdzsuf")) - .withDscpMarkings(Arrays.asList("dxbzlmcmuap", "vhdbevwqqxey")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("eqocljmygvk", "qkjjeokbz")) - .withPortGroupNames(Arrays.asList("zrxcczurt", "e", "pqxbkwvzgnzvdf", "zdix")) - .withFlags(Arrays.asList("qzinkfkbg"))); - model = BinaryData.fromObject(model).toObject(AccessControlListMatchCondition.class); - Assertions.assertEquals("pnodawopqhe", model.protocolTypes().get(0)); - Assertions.assertEquals("mcgsbostzelnd", model.vlanMatchCondition().vlans().get(0)); - Assertions.assertEquals("utmzlbiojlvfhrbb", model.vlanMatchCondition().innerVlans().get(0)); - Assertions.assertEquals("prprsnmokay", model.vlanMatchCondition().vlanGroupNames().get(0)); - Assertions.assertEquals(SourceDestinationType.SOURCE_IP, model.ipCondition().type()); - Assertions.assertEquals(PrefixType.PREFIX, model.ipCondition().prefixType()); - Assertions.assertEquals("pbzpcpiljhahz", model.ipCondition().ipPrefixValues().get(0)); - Assertions.assertEquals("h", model.ipCondition().ipGroupNames().get(0)); - Assertions.assertEquals("pmdtz", model.etherTypes().get(0)); - Assertions.assertEquals("tfvnz", model.fragments().get(0)); - Assertions.assertEquals("p", model.ipLengths().get(0)); - Assertions.assertEquals("qqihedsvqwthmk", model.ttlValues().get(0)); - Assertions.assertEquals("dxbzlmcmuap", model.dscpMarkings().get(0)); - Assertions.assertEquals(PortType.SOURCE_PORT, model.portCondition().portType()); - Assertions.assertEquals(Layer4Protocol.UDP, model.portCondition().layer4Protocol()); - Assertions.assertEquals("eqocljmygvk", model.portCondition().ports().get(0)); - Assertions.assertEquals("zrxcczurt", model.portCondition().portGroupNames().get(0)); - Assertions.assertEquals("qzinkfkbg", model.portCondition().flags().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListMatchConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListMatchConfigurationTests.java deleted file mode 100644 index 4ef984eecae1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListMatchConfigurationTests.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListAction; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AccessControlListMatchConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccessControlListMatchConfiguration model = - BinaryData - .fromString( - "{\"matchConfigurationName\":\"eranokqgukkjqnv\",\"sequenceNumber\":8939885428846863813,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"cdisd\",\"sfjbjsvg\"],\"fragments\":[\"hryvy\",\"ytdc\",\"xgccknfnw\"],\"ipLengths\":[\"mvpdvjdhttzaef\",\"dxihc\",\"rphkmcrjdqnsdfz\"],\"ttlValues\":[\"tg\",\"ylkdghrje\",\"utlwxezwzhok\"],\"dscpMarkings\":[\"nhhtql\",\"ehgpp\",\"pifhpfeoajvgcxtx\",\"csheafidltugsr\"],\"portCondition\":{\"flags\":[\"ssjhoiftxfkf\",\"egprhptil\",\"ucb\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"ohmcwsld\"],\"portGroupNames\":[\"etpwbralll\",\"bphbqzmizakakank\"]},\"protocolTypes\":[\"n\",\"zhajoylhjlmuo\"],\"vlanMatchCondition\":{\"vlans\":[\"imrsopteecjmei\",\"ls\"],\"innerVlans\":[\"sylwxdzaumweooh\",\"uufuz\"],\"vlanGroupNames\":[\"jathwtzo\",\"b\",\"emwmdxmebwjs\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"eabfqxnm\",\"mqt\",\"bxyijddtvq\",\"ttadijae\"],\"ipGroupNames\":[\"rsiee\",\"pndzaapmudqmeq\"]}},{\"etherTypes\":[\"pibudqwyxebeybpm\"],\"fragments\":[\"rtffyaqitmh\",\"eioqaqhvse\",\"fuqyrxpdlcgqlsi\"],\"ipLengths\":[\"qfrddgam\",\"uhiosrsju\",\"vfcdisyirn\"],\"ttlValues\":[\"czexrxzbujrtrhqv\"],\"dscpMarkings\":[\"vk\"],\"portCondition\":{\"flags\":[\"nzonzl\",\"piqywnc\",\"jtszcof\",\"zehtdhgb\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"jeamurv\",\"mlovuanashcxl\"],\"portGroupNames\":[\"erbdk\",\"lvidizozs\",\"bccxjmonfdgn\",\"n\"]},\"protocolTypes\":[\"uuwwltv\"],\"vlanMatchCondition\":{\"vlans\":[\"tzenk\",\"if\",\"zhmkdasvflyh\",\"xcudchxgsr\"],\"innerVlans\":[\"d\",\"or\",\"bwjl\"],\"vlanGroupNames\":[\"bfhfovvacqp\",\"tuodxeszabbelaw\",\"muaslzkw\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"cwyhahno\",\"drkywuhps\",\"fuurutlwexx\"],\"ipGroupNames\":[\"lniexz\",\"rzpgep\",\"tybbwwpgda\"]}},{\"etherTypes\":[\"zyvli\",\"q\",\"rkcxkj\",\"bn\"],\"fragments\":[\"suxswqrntvlwijp\"],\"ipLengths\":[\"exoqqpwcyyufm\",\"runcuwmqspkcd\",\"zhlctddunqndyfpc\"],\"ttlValues\":[\"bnjj\"],\"dscpMarkings\":[\"egy\",\"cw\",\"oxjumvqqo\",\"ihrraiouaub\"],\"portCondition\":{\"flags\":[\"oq\",\"fuojrngif\",\"rzpasccbiuimzdly\",\"dfqwmkyoq\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"zslzojhp\",\"tfnmdx\",\"tngfdgugeyzihgr\",\"yui\"],\"portGroupNames\":[\"snmfpphojeevy\",\"yhsgz\"]},\"protocolTypes\":[\"bgomfgbegl\",\"gleohi\",\"etnluankrrfx\"],\"vlanMatchCondition\":{\"vlans\":[\"tijv\",\"cvbmqzb\",\"q\"],\"innerVlans\":[\"jrnwxacev\"],\"vlanGroupNames\":[\"kuyxoafg\",\"oqltfae\",\"linmfgv\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"ypoq\",\"yhlqhykprlpyznu\",\"iq\",\"smexiitdf\"],\"ipGroupNames\":[\"yasiibmiy\",\"nnust\",\"nlj\",\"nmgixh\"]}}],\"actions\":[{\"type\":\"Log\",\"counterName\":\"foudor\"},{\"type\":\"Log\",\"counterName\":\"yprotwyp\"},{\"type\":\"Count\",\"counterName\":\"bxhugcmjkavlgorb\"}]}") - .toObject(AccessControlListMatchConfiguration.class); - Assertions.assertEquals("eranokqgukkjqnv", model.matchConfigurationName()); - Assertions.assertEquals(8939885428846863813L, model.sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.ipAddressType()); - Assertions.assertEquals("n", model.matchConditions().get(0).protocolTypes().get(0)); - Assertions.assertEquals("imrsopteecjmei", model.matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals("sylwxdzaumweooh", model.matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals("jathwtzo", model.matchConditions().get(0).vlanMatchCondition().vlanGroupNames().get(0)); - Assertions - .assertEquals(SourceDestinationType.DESTINATION_IP, model.matchConditions().get(0).ipCondition().type()); - Assertions.assertEquals(PrefixType.LONGEST_PREFIX, model.matchConditions().get(0).ipCondition().prefixType()); - Assertions.assertEquals("eabfqxnm", model.matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions.assertEquals("rsiee", model.matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions.assertEquals("cdisd", model.matchConditions().get(0).etherTypes().get(0)); - Assertions.assertEquals("hryvy", model.matchConditions().get(0).fragments().get(0)); - Assertions.assertEquals("mvpdvjdhttzaef", model.matchConditions().get(0).ipLengths().get(0)); - Assertions.assertEquals("tg", model.matchConditions().get(0).ttlValues().get(0)); - Assertions.assertEquals("nhhtql", model.matchConditions().get(0).dscpMarkings().get(0)); - Assertions.assertEquals(PortType.DESTINATION_PORT, model.matchConditions().get(0).portCondition().portType()); - Assertions.assertEquals(Layer4Protocol.TCP, model.matchConditions().get(0).portCondition().layer4Protocol()); - Assertions.assertEquals("ohmcwsld", model.matchConditions().get(0).portCondition().ports().get(0)); - Assertions.assertEquals("etpwbralll", model.matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions.assertEquals("ssjhoiftxfkf", model.matchConditions().get(0).portCondition().flags().get(0)); - Assertions.assertEquals(AclActionType.LOG, model.actions().get(0).type()); - Assertions.assertEquals("foudor", model.actions().get(0).counterName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessControlListMatchConfiguration model = - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("eranokqgukkjqnv") - .withSequenceNumber(8939885428846863813L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("n", "zhajoylhjlmuo")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("imrsopteecjmei", "ls")) - .withInnerVlans(Arrays.asList("sylwxdzaumweooh", "uufuz")) - .withVlanGroupNames(Arrays.asList("jathwtzo", "b", "emwmdxmebwjs"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("eabfqxnm", "mqt", "bxyijddtvq", "ttadijae")) - .withIpGroupNames(Arrays.asList("rsiee", "pndzaapmudqmeq"))) - .withEtherTypes(Arrays.asList("cdisd", "sfjbjsvg")) - .withFragments(Arrays.asList("hryvy", "ytdc", "xgccknfnw")) - .withIpLengths(Arrays.asList("mvpdvjdhttzaef", "dxihc", "rphkmcrjdqnsdfz")) - .withTtlValues(Arrays.asList("tg", "ylkdghrje", "utlwxezwzhok")) - .withDscpMarkings( - Arrays.asList("nhhtql", "ehgpp", "pifhpfeoajvgcxtx", "csheafidltugsr")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("ohmcwsld")) - .withPortGroupNames(Arrays.asList("etpwbralll", "bphbqzmizakakank")) - .withFlags(Arrays.asList("ssjhoiftxfkf", "egprhptil", "ucb"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("uuwwltv")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("tzenk", "if", "zhmkdasvflyh", "xcudchxgsr")) - .withInnerVlans(Arrays.asList("d", "or", "bwjl")) - .withVlanGroupNames( - Arrays.asList("bfhfovvacqp", "tuodxeszabbelaw", "muaslzkw"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("cwyhahno", "drkywuhps", "fuurutlwexx")) - .withIpGroupNames(Arrays.asList("lniexz", "rzpgep", "tybbwwpgda"))) - .withEtherTypes(Arrays.asList("pibudqwyxebeybpm")) - .withFragments(Arrays.asList("rtffyaqitmh", "eioqaqhvse", "fuqyrxpdlcgqlsi")) - .withIpLengths(Arrays.asList("qfrddgam", "uhiosrsju", "vfcdisyirn")) - .withTtlValues(Arrays.asList("czexrxzbujrtrhqv")) - .withDscpMarkings(Arrays.asList("vk")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("jeamurv", "mlovuanashcxl")) - .withPortGroupNames(Arrays.asList("erbdk", "lvidizozs", "bccxjmonfdgn", "n")) - .withFlags(Arrays.asList("nzonzl", "piqywnc", "jtszcof", "zehtdhgb"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("bgomfgbegl", "gleohi", "etnluankrrfx")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("tijv", "cvbmqzb", "q")) - .withInnerVlans(Arrays.asList("jrnwxacev")) - .withVlanGroupNames(Arrays.asList("kuyxoafg", "oqltfae", "linmfgv"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("ypoq", "yhlqhykprlpyznu", "iq", "smexiitdf")) - .withIpGroupNames(Arrays.asList("yasiibmiy", "nnust", "nlj", "nmgixh"))) - .withEtherTypes(Arrays.asList("zyvli", "q", "rkcxkj", "bn")) - .withFragments(Arrays.asList("suxswqrntvlwijp")) - .withIpLengths(Arrays.asList("exoqqpwcyyufm", "runcuwmqspkcd", "zhlctddunqndyfpc")) - .withTtlValues(Arrays.asList("bnjj")) - .withDscpMarkings(Arrays.asList("egy", "cw", "oxjumvqqo", "ihrraiouaub")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("zslzojhp", "tfnmdx", "tngfdgugeyzihgr", "yui")) - .withPortGroupNames(Arrays.asList("snmfpphojeevy", "yhsgz")) - .withFlags(Arrays.asList("oq", "fuojrngif", "rzpasccbiuimzdly", "dfqwmkyoq"))))) - .withActions( - Arrays - .asList( - new AccessControlListAction().withType(AclActionType.LOG).withCounterName("foudor"), - new AccessControlListAction().withType(AclActionType.LOG).withCounterName("yprotwyp"), - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("bxhugcmjkavlgorb"))); - model = BinaryData.fromObject(model).toObject(AccessControlListMatchConfiguration.class); - Assertions.assertEquals("eranokqgukkjqnv", model.matchConfigurationName()); - Assertions.assertEquals(8939885428846863813L, model.sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.ipAddressType()); - Assertions.assertEquals("n", model.matchConditions().get(0).protocolTypes().get(0)); - Assertions.assertEquals("imrsopteecjmei", model.matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals("sylwxdzaumweooh", model.matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals("jathwtzo", model.matchConditions().get(0).vlanMatchCondition().vlanGroupNames().get(0)); - Assertions - .assertEquals(SourceDestinationType.DESTINATION_IP, model.matchConditions().get(0).ipCondition().type()); - Assertions.assertEquals(PrefixType.LONGEST_PREFIX, model.matchConditions().get(0).ipCondition().prefixType()); - Assertions.assertEquals("eabfqxnm", model.matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions.assertEquals("rsiee", model.matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions.assertEquals("cdisd", model.matchConditions().get(0).etherTypes().get(0)); - Assertions.assertEquals("hryvy", model.matchConditions().get(0).fragments().get(0)); - Assertions.assertEquals("mvpdvjdhttzaef", model.matchConditions().get(0).ipLengths().get(0)); - Assertions.assertEquals("tg", model.matchConditions().get(0).ttlValues().get(0)); - Assertions.assertEquals("nhhtql", model.matchConditions().get(0).dscpMarkings().get(0)); - Assertions.assertEquals(PortType.DESTINATION_PORT, model.matchConditions().get(0).portCondition().portType()); - Assertions.assertEquals(Layer4Protocol.TCP, model.matchConditions().get(0).portCondition().layer4Protocol()); - Assertions.assertEquals("ohmcwsld", model.matchConditions().get(0).portCondition().ports().get(0)); - Assertions.assertEquals("etpwbralll", model.matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions.assertEquals("ssjhoiftxfkf", model.matchConditions().get(0).portCondition().flags().get(0)); - Assertions.assertEquals(AclActionType.LOG, model.actions().get(0).type()); - Assertions.assertEquals("foudor", model.actions().get(0).counterName()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPatchPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPatchPropertiesTests.java deleted file mode 100644 index c77f0de89615..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPatchPropertiesTests.java +++ /dev/null @@ -1,594 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListPatchProperties; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListAction; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AccessControlListPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccessControlListPatchProperties model = - BinaryData - .fromString( - "{\"annotation\":\"qzolxrzvhqjw\",\"configurationType\":\"File\",\"aclsUrl\":\"gv\",\"matchConfigurations\":[{\"matchConfigurationName\":\"rrkolawjmjs\",\"sequenceNumber\":7755384340839179054,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"etherTypes\":[\"zz\",\"yjaf\"],\"fragments\":[\"hguynuchlgmltxdw\",\"mozusgzvlnsnnjz\"],\"ipLengths\":[\"folpymwamxqzra\",\"p\",\"dphtv\",\"ulajvlejchc\"],\"ttlValues\":[\"zknmzlanrupd\"],\"dscpMarkings\":[\"phcnzqtpj\",\"mqrhvthl\",\"iwdcxsmlzzhzd\",\"xetlgydlhqv\"],\"portCondition\":{\"flags\":[\"xybafiqgea\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"kglklbyulidwcw\",\"mzegjon\"],\"portGroupNames\":[\"irwgdnqzbrf\",\"spzhzmtksjc\",\"tdigsxcdglj\",\"lkeuac\"]},\"protocolTypes\":[\"mflrytswfpfmdgyc\",\"nmskwhqj\",\"yslu\"],\"vlanMatchCondition\":{\"vlans\":[\"hhkvpedwqs\",\"srhmpqvww\",\"kondcb\"],\"innerVlans\":[\"muvqejosovyr\",\"leaesi\",\"uqtljqobbpih\",\"hcecybmrqbr\"],\"vlanGroupNames\":[\"mpxdlvy\",\"frexcrseqw\",\"ksghudgzhxogjgg\",\"voujkxibdafhrk\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"bv\",\"bhdyir\"],\"ipGroupNames\":[\"pgddeimawz\"]}},{\"etherTypes\":[\"kkum\",\"ikjcjcazt\",\"wsnsqowx\"],\"fragments\":[\"mlikytw\",\"czcswka\"],\"ipLengths\":[\"jyfdvlv\",\"b\",\"rnfxtgddp\",\"th\"],\"ttlValues\":[\"mnaoy\"],\"dscpMarkings\":[\"coeqswankltytm\",\"droznn\",\"drlktg\"],\"portCondition\":{\"flags\":[\"guxhem\",\"wyw\",\"eeczgfbu\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"sxbly\"],\"portGroupNames\":[\"zujksrlsmdes\",\"plpvm\",\"cdoewbidyv\"]},\"protocolTypes\":[\"wxvgpiudeugfsxze\"],\"vlanMatchCondition\":{\"vlans\":[\"wkufykhvuhxepm\"],\"innerVlans\":[\"znabaobns\",\"ujdjltymkmvg\"],\"vlanGroupNames\":[\"ywart\",\"pphkixkykxds\",\"j\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"hikkflrmy\",\"yincql\",\"riswslmiiio\",\"gqcg\"],\"ipGroupNames\":[\"gqkctotiowlxte\",\"dptjgwdtgukranb\",\"wphqlkccuzgygqw\",\"hoi\"]}},{\"etherTypes\":[\"gniiprglvaw\",\"wzdufypivlsbb\"],\"fragments\":[\"cubkmi\"],\"ipLengths\":[\"xkubvphavpmhbrbq\",\"vgovpbbttefjokn\",\"sqyzqedikdfr\"],\"ttlValues\":[\"qmrjg\",\"ihfqlggwfiwzc\",\"mjpb\",\"ephmgtvljvrcmyfq\"],\"dscpMarkings\":[\"xhnpo\",\"yqwcabvnuil\",\"ey\",\"swlpaugmrmfj\"],\"portCondition\":{\"flags\":[\"toaukhfkvcisiz\",\"oaedsxjwuivedwcg\",\"eewxeiqbpsmg\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"ljdlrgmspl\",\"gaufcs\",\"hvn\",\"wgnxkympqanxrj\"],\"portGroupNames\":[\"tw\",\"taoypnyghshxc\"]},\"protocolTypes\":[\"kgmnsghpxyc\",\"hdrwjjkh\"],\"vlanMatchCondition\":{\"vlans\":[\"ac\"],\"innerVlans\":[\"vxnqmhrpqpd\",\"wmkoisq\",\"ssffxuifmc\"],\"vlanGroupNames\":[\"obkdqzrdzsyl\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"zydmxzjijpvuaurk\",\"hci\",\"ldefxrdcoxn\",\"kkjanurnnqbnqbp\"],\"ipGroupNames\":[\"qltgrd\",\"gypxrxvbfihwuhvc\"]}},{\"etherTypes\":[\"s\"],\"fragments\":[\"rblmli\",\"wxihs\",\"nxw\",\"agnepzwaklsb\"],\"ipLengths\":[\"qqagwwr\",\"ao\",\"zisglrrczezkhh\",\"tnjadhq\"],\"ttlValues\":[\"jqoyueayfbpcm\"],\"dscpMarkings\":[\"byrrueqth\",\"mg\"],\"portCondition\":{\"flags\":[\"cbbxigdhxi\",\"d\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"wdpyq\",\"ybxubmdna\",\"cbq\"],\"portGroupNames\":[\"mjel\"]},\"protocolTypes\":[\"cigeleohdbvqvw\",\"kjopwbeon\"],\"vlanMatchCondition\":{\"vlans\":[\"zdqyb\",\"ceakxc\",\"tsoqfyiaseqchk\",\"ttzrazisgyki\"],\"innerVlans\":[\"vanbwzohmnrxxbs\",\"jklinh\"],\"vlanGroupNames\":[\"tysprqsgnzxojpsl\",\"vjgp\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"yxq\",\"apcohhouc\",\"pqojxcx\",\"rzdcgdzbenribcaw\"],\"ipGroupNames\":[\"qd\",\"tjwfljhznamtua\",\"mzwcjjncqt\",\"z\"]}}],\"actions\":[{\"type\":\"Log\",\"counterName\":\"gat\"},{\"type\":\"Count\",\"counterName\":\"bxn\"}]},{\"matchConfigurationName\":\"ebwgga\",\"sequenceNumber\":8497029044251944555,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"qfutlxjo\",\"zasunwqrjzfrgq\"],\"fragments\":[\"hcmbuocnjrohmbp\",\"ryxameblydyvkfkm\"],\"ipLengths\":[\"xne\",\"v\"],\"ttlValues\":[\"odlfpyapucygvo\"],\"dscpMarkings\":[\"unssxlghieegjl\",\"vvpa\"],\"portCondition\":{\"flags\":[\"gbuxantuygdh\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"rpiwrqofulo\",\"mjnlexwhcb\",\"pibkephuu\",\"erctatoyin\"],\"portGroupNames\":[\"brlc\",\"rduczkgofxyfs\",\"uc\",\"crrpcjttbstvje\"]},\"protocolTypes\":[\"rmvvfkoxmlghktui\",\"vrmazlpdwwexymzv\",\"azipbhpwvqsg\",\"yy\"],\"vlanMatchCondition\":{\"vlans\":[\"vensrpm\",\"yyvpkpatlb\",\"jp\",\"gsksrfhf\"],\"innerVlans\":[\"mknbnxwcdommpv\",\"qa\",\"zfgbrttuiaclkie\"],\"vlanGroupNames\":[\"jlfnthiq\",\"yuttdiygbpvnwswm\",\"xkyctwwgzwx\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"ygzyvneezaifght\",\"oqqtl\"],\"ipGroupNames\":[\"zbkr\",\"jjjavfqnvhnq\"]}}],\"actions\":[{\"type\":\"Drop\",\"counterName\":\"iyet\"},{\"type\":\"Log\",\"counterName\":\"vidbztjhqtfb\"},{\"type\":\"Log\",\"counterName\":\"nkbw\"}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{\"name\":\"p\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"yaupia\",\"cxnafbwqrooh\"]},{\"name\":\"ovmaonurjtum\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"ve\"]},{\"name\":\"slclblyjxltbsju\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"xigc\"]},{\"name\":\"gxuupbezqccydrtc\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"kkyihzt\",\"eq\",\"gqzgwldoychill\",\"ecfehuwa\"]}],\"vlanGroups\":[{\"name\":\"h\",\"vlans\":[\"llizs\",\"ac\",\"jvhrweft\"]}],\"portGroups\":[{\"name\":\"jp\",\"ports\":[\"s\"]},{\"name\":\"aepwamcxtcz\",\"ports\":[\"euknijduyyes\",\"ydjfb\"]},{\"name\":\"yv\",\"ports\":[\"lrtywikdmhlakuf\",\"gbhgau\",\"cdixmx\"]},{\"name\":\"rs\",\"ports\":[\"qg\",\"kfnozoeoqbvj\",\"vefgwbmqjchntas\"]}]},{\"ipGroups\":[{\"name\":\"xbulpzealbmqkyo\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"kmbtsuahx\",\"gxjc\",\"mzrrscubiwsdrn\",\"xqw\"]},{\"name\":\"iffjxcjrm\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"ibvjogjonmcy\",\"foyzbamwineof\"]},{\"name\":\"kak\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"vevboclzh\"]}],\"vlanGroups\":[{\"name\":\"yuxgvttxpnrupz\",\"vlans\":[\"rdixt\",\"ekidswyskb\",\"uffgllukkutvlx\"]},{\"name\":\"pqhvmblcouqehbhb\",\"vlans\":[\"ziryrandoy\",\"mbltoo\",\"mkfqlwxldy\"]},{\"name\":\"lsygaol\",\"vlans\":[\"nnbmjksibjgsjj\",\"xahmrnadzyqegxy\"]}],\"portGroups\":[{\"name\":\"nbm\",\"ports\":[\"jijkgqxnhmbke\",\"njaujvaan\",\"ggiycwkdtaawxwf\"]},{\"name\":\"aumrrqmbzmqkrat\",\"ports\":[\"wbjsidbirkf\",\"kso\"]},{\"name\":\"gogewijymrh\",\"ports\":[\"zozk\"]},{\"name\":\"wnf\",\"ports\":[\"hhqosmffjku\",\"ycyarnroohg\"]}]},{\"ipGroups\":[{\"name\":\"oghktdpycz\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"cnhz\",\"rottjzcfyjzptw\",\"lohap\",\"infsz\"]}],\"vlanGroups\":[{\"name\":\"qdhmrjzralcxpjby\",\"vlans\":[\"joqcjenkyhfqzvsq\",\"fxjelg\",\"mpzqjhhhq\",\"uwyvcacoyvi\"]},{\"name\":\"s\",\"vlans\":[\"sjsz\",\"bscm\",\"lzijiufehgmvflnw\"]}],\"portGroups\":[{\"name\":\"xrerlniylylyf\",\"ports\":[\"utgqztwh\",\"hmupgxyjtcdxabbu\",\"ftabenbbklqp\",\"zucafeddww\"]},{\"name\":\"z\",\"ports\":[\"xud\",\"nhgookrtalvnbw\"]}]}]}") - .toObject(AccessControlListPatchProperties.class); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("gv", model.aclsUrl()); - Assertions.assertEquals("rrkolawjmjs", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(7755384340839179054L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals( - "mflrytswfpfmdgyc", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "hhkvpedwqs", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "muvqejosovyr", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "mpxdlvy", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.SOURCE_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.LONGEST_PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "bv", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "pgddeimawz", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions.assertEquals("zz", model.matchConfigurations().get(0).matchConditions().get(0).etherTypes().get(0)); - Assertions - .assertEquals( - "hguynuchlgmltxdw", model.matchConfigurations().get(0).matchConditions().get(0).fragments().get(0)); - Assertions - .assertEquals( - "folpymwamxqzra", model.matchConfigurations().get(0).matchConditions().get(0).ipLengths().get(0)); - Assertions - .assertEquals( - "zknmzlanrupd", model.matchConfigurations().get(0).matchConditions().get(0).ttlValues().get(0)); - Assertions - .assertEquals( - "phcnzqtpj", model.matchConfigurations().get(0).matchConditions().get(0).dscpMarkings().get(0)); - Assertions - .assertEquals( - PortType.SOURCE_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.UDP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "kglklbyulidwcw", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "irwgdnqzbrf", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions - .assertEquals( - "xybafiqgea", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().flags().get(0)); - Assertions.assertEquals(AclActionType.LOG, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("gat", model.matchConfigurations().get(0).actions().get(0).counterName()); - Assertions.assertEquals("p", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV6, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals("yaupia", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("h", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions.assertEquals("llizs", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("jp", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("s", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - Assertions.assertEquals("qzolxrzvhqjw", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessControlListPatchProperties model = - new AccessControlListPatchProperties() - .withConfigurationType(ConfigurationType.FILE) - .withAclsUrl("gv") - .withMatchConfigurations( - Arrays - .asList( - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("rrkolawjmjs") - .withSequenceNumber(7755384340839179054L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes( - Arrays.asList("mflrytswfpfmdgyc", "nmskwhqj", "yslu")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("hhkvpedwqs", "srhmpqvww", "kondcb")) - .withInnerVlans( - Arrays - .asList( - "muvqejosovyr", - "leaesi", - "uqtljqobbpih", - "hcecybmrqbr")) - .withVlanGroupNames( - Arrays - .asList( - "mpxdlvy", - "frexcrseqw", - "ksghudgzhxogjgg", - "voujkxibdafhrk"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("bv", "bhdyir")) - .withIpGroupNames(Arrays.asList("pgddeimawz"))) - .withEtherTypes(Arrays.asList("zz", "yjaf")) - .withFragments(Arrays.asList("hguynuchlgmltxdw", "mozusgzvlnsnnjz")) - .withIpLengths( - Arrays.asList("folpymwamxqzra", "p", "dphtv", "ulajvlejchc")) - .withTtlValues(Arrays.asList("zknmzlanrupd")) - .withDscpMarkings( - Arrays - .asList( - "phcnzqtpj", "mqrhvthl", "iwdcxsmlzzhzd", "xetlgydlhqv")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("kglklbyulidwcw", "mzegjon")) - .withPortGroupNames( - Arrays - .asList( - "irwgdnqzbrf", - "spzhzmtksjc", - "tdigsxcdglj", - "lkeuac")) - .withFlags(Arrays.asList("xybafiqgea"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("wxvgpiudeugfsxze")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("wkufykhvuhxepm")) - .withInnerVlans(Arrays.asList("znabaobns", "ujdjltymkmvg")) - .withVlanGroupNames( - Arrays.asList("ywart", "pphkixkykxds", "j"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("hikkflrmy", "yincql", "riswslmiiio", "gqcg")) - .withIpGroupNames( - Arrays - .asList( - "gqkctotiowlxte", - "dptjgwdtgukranb", - "wphqlkccuzgygqw", - "hoi"))) - .withEtherTypes(Arrays.asList("kkum", "ikjcjcazt", "wsnsqowx")) - .withFragments(Arrays.asList("mlikytw", "czcswka")) - .withIpLengths(Arrays.asList("jyfdvlv", "b", "rnfxtgddp", "th")) - .withTtlValues(Arrays.asList("mnaoy")) - .withDscpMarkings(Arrays.asList("coeqswankltytm", "droznn", "drlktg")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("sxbly")) - .withPortGroupNames( - Arrays.asList("zujksrlsmdes", "plpvm", "cdoewbidyv")) - .withFlags(Arrays.asList("guxhem", "wyw", "eeczgfbu"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("kgmnsghpxyc", "hdrwjjkh")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("ac")) - .withInnerVlans( - Arrays.asList("vxnqmhrpqpd", "wmkoisq", "ssffxuifmc")) - .withVlanGroupNames(Arrays.asList("obkdqzrdzsyl"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays - .asList( - "zydmxzjijpvuaurk", - "hci", - "ldefxrdcoxn", - "kkjanurnnqbnqbp")) - .withIpGroupNames(Arrays.asList("qltgrd", "gypxrxvbfihwuhvc"))) - .withEtherTypes(Arrays.asList("gniiprglvaw", "wzdufypivlsbb")) - .withFragments(Arrays.asList("cubkmi")) - .withIpLengths( - Arrays - .asList("xkubvphavpmhbrbq", "vgovpbbttefjokn", "sqyzqedikdfr")) - .withTtlValues( - Arrays.asList("qmrjg", "ihfqlggwfiwzc", "mjpb", "ephmgtvljvrcmyfq")) - .withDscpMarkings( - Arrays.asList("xhnpo", "yqwcabvnuil", "ey", "swlpaugmrmfj")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays - .asList( - "ljdlrgmspl", "gaufcs", "hvn", "wgnxkympqanxrj")) - .withPortGroupNames(Arrays.asList("tw", "taoypnyghshxc")) - .withFlags( - Arrays - .asList( - "toaukhfkvcisiz", - "oaedsxjwuivedwcg", - "eewxeiqbpsmg"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("cigeleohdbvqvw", "kjopwbeon")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "zdqyb", - "ceakxc", - "tsoqfyiaseqchk", - "ttzrazisgyki")) - .withInnerVlans(Arrays.asList("vanbwzohmnrxxbs", "jklinh")) - .withVlanGroupNames(Arrays.asList("tysprqsgnzxojpsl", "vjgp"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays - .asList( - "yxq", "apcohhouc", "pqojxcx", "rzdcgdzbenribcaw")) - .withIpGroupNames( - Arrays.asList("qd", "tjwfljhznamtua", "mzwcjjncqt", "z"))) - .withEtherTypes(Arrays.asList("s")) - .withFragments(Arrays.asList("rblmli", "wxihs", "nxw", "agnepzwaklsb")) - .withIpLengths( - Arrays.asList("qqagwwr", "ao", "zisglrrczezkhh", "tnjadhq")) - .withTtlValues(Arrays.asList("jqoyueayfbpcm")) - .withDscpMarkings(Arrays.asList("byrrueqth", "mg")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("wdpyq", "ybxubmdna", "cbq")) - .withPortGroupNames(Arrays.asList("mjel")) - .withFlags(Arrays.asList("cbbxigdhxi", "d"))))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("gat"), - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("bxn"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("ebwgga") - .withSequenceNumber(8497029044251944555L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes( - Arrays - .asList( - "rmvvfkoxmlghktui", - "vrmazlpdwwexymzv", - "azipbhpwvqsg", - "yy")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays.asList("vensrpm", "yyvpkpatlb", "jp", "gsksrfhf")) - .withInnerVlans( - Arrays.asList("mknbnxwcdommpv", "qa", "zfgbrttuiaclkie")) - .withVlanGroupNames( - Arrays - .asList("jlfnthiq", "yuttdiygbpvnwswm", "xkyctwwgzwx"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("ygzyvneezaifght", "oqqtl")) - .withIpGroupNames(Arrays.asList("zbkr", "jjjavfqnvhnq"))) - .withEtherTypes(Arrays.asList("qfutlxjo", "zasunwqrjzfrgq")) - .withFragments(Arrays.asList("hcmbuocnjrohmbp", "ryxameblydyvkfkm")) - .withIpLengths(Arrays.asList("xne", "v")) - .withTtlValues(Arrays.asList("odlfpyapucygvo")) - .withDscpMarkings(Arrays.asList("unssxlghieegjl", "vvpa")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays - .asList( - "rpiwrqofulo", - "mjnlexwhcb", - "pibkephuu", - "erctatoyin")) - .withPortGroupNames( - Arrays - .asList( - "brlc", "rduczkgofxyfs", "uc", "crrpcjttbstvje")) - .withFlags(Arrays.asList("gbuxantuygdh"))))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("iyet"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("vidbztjhqtfb"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("nkbw"))))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("p") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("yaupia", "cxnafbwqrooh")), - new IpGroupProperties() - .withName("ovmaonurjtum") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("ve")), - new IpGroupProperties() - .withName("slclblyjxltbsju") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("xigc")), - new IpGroupProperties() - .withName("gxuupbezqccydrtc") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays.asList("kkyihzt", "eq", "gqzgwldoychill", "ecfehuwa")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("h") - .withVlans(Arrays.asList("llizs", "ac", "jvhrweft")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties().withName("jp").withPorts(Arrays.asList("s")), - new PortGroupProperties() - .withName("aepwamcxtcz") - .withPorts(Arrays.asList("euknijduyyes", "ydjfb")), - new PortGroupProperties() - .withName("yv") - .withPorts(Arrays.asList("lrtywikdmhlakuf", "gbhgau", "cdixmx")), - new PortGroupProperties() - .withName("rs") - .withPorts(Arrays.asList("qg", "kfnozoeoqbvj", "vefgwbmqjchntas")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("xbulpzealbmqkyo") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes( - Arrays.asList("kmbtsuahx", "gxjc", "mzrrscubiwsdrn", "xqw")), - new IpGroupProperties() - .withName("iffjxcjrm") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("ibvjogjonmcy", "foyzbamwineof")), - new IpGroupProperties() - .withName("kak") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("vevboclzh")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("yuxgvttxpnrupz") - .withVlans(Arrays.asList("rdixt", "ekidswyskb", "uffgllukkutvlx")), - new VlanGroupProperties() - .withName("pqhvmblcouqehbhb") - .withVlans(Arrays.asList("ziryrandoy", "mbltoo", "mkfqlwxldy")), - new VlanGroupProperties() - .withName("lsygaol") - .withVlans(Arrays.asList("nnbmjksibjgsjj", "xahmrnadzyqegxy")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("nbm") - .withPorts( - Arrays.asList("jijkgqxnhmbke", "njaujvaan", "ggiycwkdtaawxwf")), - new PortGroupProperties() - .withName("aumrrqmbzmqkrat") - .withPorts(Arrays.asList("wbjsidbirkf", "kso")), - new PortGroupProperties() - .withName("gogewijymrh") - .withPorts(Arrays.asList("zozk")), - new PortGroupProperties() - .withName("wnf") - .withPorts(Arrays.asList("hhqosmffjku", "ycyarnroohg")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("oghktdpycz") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays.asList("cnhz", "rottjzcfyjzptw", "lohap", "infsz")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("qdhmrjzralcxpjby") - .withVlans( - Arrays - .asList( - "joqcjenkyhfqzvsq", "fxjelg", "mpzqjhhhq", "uwyvcacoyvi")), - new VlanGroupProperties() - .withName("s") - .withVlans(Arrays.asList("sjsz", "bscm", "lzijiufehgmvflnw")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("xrerlniylylyf") - .withPorts( - Arrays - .asList( - "utgqztwh", - "hmupgxyjtcdxabbu", - "ftabenbbklqp", - "zucafeddww")), - new PortGroupProperties() - .withName("z") - .withPorts(Arrays.asList("xud", "nhgookrtalvnbw")))))) - .withAnnotation("qzolxrzvhqjw"); - model = BinaryData.fromObject(model).toObject(AccessControlListPatchProperties.class); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("gv", model.aclsUrl()); - Assertions.assertEquals("rrkolawjmjs", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(7755384340839179054L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals( - "mflrytswfpfmdgyc", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "hhkvpedwqs", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "muvqejosovyr", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "mpxdlvy", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.SOURCE_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.LONGEST_PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "bv", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "pgddeimawz", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions.assertEquals("zz", model.matchConfigurations().get(0).matchConditions().get(0).etherTypes().get(0)); - Assertions - .assertEquals( - "hguynuchlgmltxdw", model.matchConfigurations().get(0).matchConditions().get(0).fragments().get(0)); - Assertions - .assertEquals( - "folpymwamxqzra", model.matchConfigurations().get(0).matchConditions().get(0).ipLengths().get(0)); - Assertions - .assertEquals( - "zknmzlanrupd", model.matchConfigurations().get(0).matchConditions().get(0).ttlValues().get(0)); - Assertions - .assertEquals( - "phcnzqtpj", model.matchConfigurations().get(0).matchConditions().get(0).dscpMarkings().get(0)); - Assertions - .assertEquals( - PortType.SOURCE_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.UDP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "kglklbyulidwcw", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "irwgdnqzbrf", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions - .assertEquals( - "xybafiqgea", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().flags().get(0)); - Assertions.assertEquals(AclActionType.LOG, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("gat", model.matchConfigurations().get(0).actions().get(0).counterName()); - Assertions.assertEquals("p", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV6, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals("yaupia", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("h", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions.assertEquals("llizs", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("jp", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("s", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - Assertions.assertEquals("qzolxrzvhqjw", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPatchTests.java deleted file mode 100644 index 1f733351a4d1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPatchTests.java +++ /dev/null @@ -1,519 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListAction; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatch; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AccessControlListPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccessControlListPatch model = - BinaryData - .fromString( - "{\"properties\":{\"annotation\":\"hkfkimrtixokf\",\"configurationType\":\"File\",\"aclsUrl\":\"nljqepqwhixmons\",\"matchConfigurations\":[{\"matchConfigurationName\":\"yxgvelfcld\",\"sequenceNumber\":1657812076895337936,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"wcobie\"],\"fragments\":[\"mninwjizcilng\",\"gshejjtbxqmulux\"],\"ipLengths\":[\"zvners\",\"ycucrwnamikzeb\",\"qbsms\",\"ziqgfuh\"],\"ttlValues\":[\"ruswhv\",\"czznvfbycjsxj\"],\"dscpMarkings\":[\"xzv\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"qhndvnoam\",\"dsehaohdjhhflzo\",\"xcoxpelnjet\",\"gltsxoat\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Drop\",\"counterName\":\"swvefloccsrmoz\"},{\"type\":\"Drop\",\"counterName\":\"pgawtxxpkyjcxcjx\"},{\"type\":\"Log\",\"counterName\":\"fmpcycilrmca\"},{\"type\":\"Log\",\"counterName\":\"noxuztrksx\"}]},{\"matchConfigurationName\":\"ndfcpfn\",\"sequenceNumber\":6393112535874003719,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"osrxuzvoa\",\"ktcqio\"],\"fragments\":[\"bzahgxqd\",\"yrtltlaprltzkat\",\"hjm\"],\"ipLengths\":[\"bsoqeqala\",\"vlagun\",\"tgfebwln\"],\"ttlValues\":[\"yreeudz\",\"av\"],\"dscpMarkings\":[\"qmjxlyyzglgouwtl\",\"jjyuojqtobax\"],\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"unlbfjkwr\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"bhsy\",\"qunjqh\"],\"fragments\":[\"xaulkpakdkifmjnn\",\"wtqabpxuckp\"],\"ipLengths\":[\"oweyirdhlis\",\"gwflq\",\"mpizru\"],\"ttlValues\":[\"qxpxiwfcngjsaa\",\"iixtmkzj\"],\"dscpMarkings\":[\"iirhgfgrwsd\",\"gratzvzbglbyvict\",\"tbrxkjz\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"fmsh\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"gozxw\",\"pdbydpizqacln\"],\"fragments\":[\"biygnugjknfsmfct\",\"uxuuyilflq\",\"iquvrehm\",\"njhvsujztc\"],\"ipLengths\":[\"qjtwhauu\",\"fprnjl\",\"tlxs\"],\"ttlValues\":[\"ddoui\",\"amowaziynknlqwzd\",\"piwhxqs\",\"dtmaa\"],\"dscpMarkings\":[\"huxy\",\"rjvmtygjbmzyosp\",\"p\",\"hckfkyjpmspbps\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"yogtieyujtvczkcn\",\"xrx\",\"unjdx\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Log\",\"counterName\":\"xpaglqivbgkc\"},{\"type\":\"Log\",\"counterName\":\"zvuqdflvon\"}]},{\"matchConfigurationName\":\"pfpubcpzgpx\",\"sequenceNumber\":8408978722842734587,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"bgqjxgpnrhgo\"],\"fragments\":[\"pikqmh\",\"ao\"],\"ipLengths\":[\"mzvupor\",\"zdfuydzvkfvxcnqm\"],\"ttlValues\":[\"swokm\"],\"dscpMarkings\":[\"lgg\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"zqkzszuwi\",\"tglxx\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"gpicr\"],\"fragments\":[\"hr\",\"mqgjsxvpq\",\"bfrmbodthsqqgvri\",\"bakclacjfrnxous\"],\"ipLengths\":[\"zlwvsgmwohqfz\",\"zvuxm\",\"kjsvthnwpzteko\"],\"ttlValues\":[\"ibiattg\"],\"dscpMarkings\":[\"cfotangcfhnykzcu\",\"swvxwlmzqwmv\",\"xnjmxm\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"tcvcl\",\"ynpdkvgfab\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"buzphdugn\"],\"fragments\":[\"n\",\"gox\",\"jiuqhibtozi\"],\"ipLengths\":[\"jedmurrxxgewp\",\"tvqylkmqpzoyhlfb\",\"gwgcl\",\"xoe\"],\"ttlValues\":[\"njipnwjfujql\",\"fcbahhp\",\"pofoi\"],\"dscpMarkings\":[\"p\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"kkholvdndvia\",\"ogphuartvtiu\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Drop\",\"counterName\":\"n\"},{\"type\":\"Log\",\"counterName\":\"xhk\"}]},{\"matchConfigurationName\":\"qirwrweoox\",\"sequenceNumber\":355993923924701013,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"ewmozqvbu\",\"qmamhsycxhxzga\",\"ttaboidvmfqh\"],\"fragments\":[\"bowsepd\",\"g\",\"mtdherngb\"],\"ipLengths\":[\"uahokq\",\"obkauxofsh\",\"phwpnulaiywzej\"],\"ttlValues\":[\"slwkojpl\"],\"dscpMarkings\":[\"npdwr\",\"qafgfugsnnfhyet\",\"fypococtfjgti\"],\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"uyturml\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"lbau\",\"ropions\",\"onwpnga\"],\"fragments\":[\"nixjawrtmjfjmy\"],\"ipLengths\":[\"lzhcoxovnekh\",\"nlusfnrd\",\"jxtxrdc\",\"tjvidt\"],\"ttlValues\":[\"puslvyj\"],\"dscpMarkings\":[\"uwkasiz\",\"esfuught\",\"qfecjxeygtuhx\",\"ic\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"rswnjlxuzrhwp\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"aqehg\",\"dohzjq\",\"tu\"],\"fragments\":[\"gebx\",\"cnwfepbnwgfmxjg\",\"g\",\"jbgdlfgtdysnaquf\"],\"ipLengths\":[\"ctqhamzjrwdk\",\"zeqyjleziun\",\"xdfzantkw\"],\"ttlValues\":[\"yamlbnse\",\"ac\",\"jvpilguooqja\",\"m\"],\"dscpMarkings\":[\"gueiookjbsahrtdt\"],\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"ac\",\"lmotoebnfxofvcj\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"etherTypes\":[\"azftxejwabmdujtm\",\"cope\",\"c\",\"jurbuhhlkyqltqsr\"],\"fragments\":[\"uwkffdjktsysid\",\"vclglxnfuij\"],\"ipLengths\":[\"usqogsfikayia\",\"sharujtj\",\"qxfzyjqttvwk\"],\"ttlValues\":[\"j\",\"enuygbq\",\"qqekewvnqvcdlgu\"],\"dscpMarkings\":[\"mfdjwn\",\"axpunjqikczvv\",\"tacgxmfc\"],\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"htvs\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Count\",\"counterName\":\"j\"},{\"type\":\"Log\",\"counterName\":\"xypruuuy\"},{\"type\":\"Log\",\"counterName\":\"r\"}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{\"name\":\"uelyetndn\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"gagflnlgmtrwah\",\"jmucftby\"]},{\"name\":\"lrohkpig\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"ckzmkwklsnox\"]},{\"name\":\"mqeq\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"nhg\",\"ydyynfsvkh\",\"bvqt\"]}],\"vlanGroups\":[{\"name\":\"fdlpukhpyr\",\"vlans\":[\"zjcpeogk\",\"nmg\"]},{\"name\":\"ouxddbhfhpfpazj\",\"vlans\":[\"wjxhpdulon\",\"acn\"]},{\"name\":\"w\",\"vlans\":[\"tuevrh\",\"ljyoogwx\",\"nsduugwbsre\"]},{\"name\":\"fqkfuarenl\",\"vlans\":[\"tklnvnafvvkyfed\",\"v\"]}],\"portGroups\":[{\"name\":\"lcqxypokk\",\"ports\":[\"nqcymczngnbdxxew\",\"ninvudbchaqdt\",\"qecrqctmxx\",\"tddmf\"]}]},{\"ipGroups\":[{\"name\":\"tx\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"apxbannovvoxczy\",\"prwnwvroevytlyo\",\"rrrouuxvnsa\"]},{\"name\":\"crymodizrxklobd\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"mkmlmvevfx\",\"op\",\"hbzxli\"]},{\"name\":\"rdddtfgxqbawpcb\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"yknapqofyuicdh\",\"bd\",\"bwwg\",\"d\"]},{\"name\":\"bid\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"f\",\"lfmu\",\"apckccrrvw\",\"yoxoy\"]}],\"vlanGroups\":[{\"name\":\"haim\",\"vlans\":[\"roqboshbragapyy\",\"mfsvbpav\"]}],\"portGroups\":[{\"name\":\"ppdbwnupgahxkum\",\"ports\":[\"caac\",\"dmmcpugmehqep\",\"u\",\"hbzehewho\"]},{\"name\":\"nlbqnbldxeaclg\",\"ports\":[\"orim\",\"rsrrmoucsofldp\"]}]},{\"ipGroups\":[{\"name\":\"fcaabe\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"lvbmxuqibsxtkcu\",\"fbsfarfsiow\"]}],\"vlanGroups\":[{\"name\":\"nqpvwgfstmhqykiz\",\"vlans\":[\"saoafcluqvox\",\"ycjimryvwgcwwpbm\",\"gwe\",\"ydsx\"]},{\"name\":\"fo\",\"vlans\":[\"bvopwndyqle\",\"llklmtk\",\"lowkxxpvb\",\"dfjmzsyzfhotlh\"]}],\"portGroups\":[{\"name\":\"ychunsjlpjrtwszh\",\"ports\":[\"icphvtrrmhw\"]},{\"name\":\"fdpyflubh\",\"ports\":[\"lrocuyzlwh\",\"memhooclutnpq\"]},{\"name\":\"mczjkm\",\"ports\":[\"yujxsglhsrrry\",\"jylmbkzudnigr\",\"ihotjewlpxuzzjg\",\"refqy\"]}]},{\"ipGroups\":[{\"name\":\"oihiqak\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"brkwpzdqt\"]},{\"name\":\"cspodaqax\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"tgbebj\",\"ulbmoichdlp\",\"fpubntnbatz\"]}],\"vlanGroups\":[{\"name\":\"owsaaelcattcjuh\",\"vlans\":[\"vkmjcwmjvlgf\",\"gcvkyyli\",\"rzbjpsfxsfuz\",\"lvt\"]}],\"portGroups\":[{\"name\":\"bwidql\",\"ports\":[\"koveof\",\"zrvjfnmjmvlwyzgi\"]}]}]},\"tags\":{\"lfojuidjp\":\"ujr\",\"ovvtzejetjkln\":\"uyjucejikzo\",\"k\":\"ikyju\"}}") - .toObject(AccessControlListPatch.class); - Assertions.assertEquals("ujr", model.tags().get("lfojuidjp")); - Assertions.assertEquals("hkfkimrtixokf", model.annotation()); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("nljqepqwhixmons", model.aclsUrl()); - Assertions.assertEquals("yxgvelfcld", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(1657812076895337936L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals( - "qhndvnoam", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals("wcobie", model.matchConfigurations().get(0).matchConditions().get(0).etherTypes().get(0)); - Assertions - .assertEquals( - "mninwjizcilng", model.matchConfigurations().get(0).matchConditions().get(0).fragments().get(0)); - Assertions - .assertEquals("zvners", model.matchConfigurations().get(0).matchConditions().get(0).ipLengths().get(0)); - Assertions - .assertEquals("ruswhv", model.matchConfigurations().get(0).matchConditions().get(0).ttlValues().get(0)); - Assertions - .assertEquals("xzv", model.matchConfigurations().get(0).matchConditions().get(0).dscpMarkings().get(0)); - Assertions - .assertEquals( - Layer4Protocol.UDP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions.assertEquals(AclActionType.DROP, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("swvefloccsrmoz", model.matchConfigurations().get(0).actions().get(0).counterName()); - Assertions.assertEquals("uelyetndn", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV4, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals( - "gagflnlgmtrwah", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("fdlpukhpyr", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("zjcpeogk", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("lcqxypokk", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions - .assertEquals( - "nqcymczngnbdxxew", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessControlListPatch model = - new AccessControlListPatch() - .withTags(mapOf("lfojuidjp", "ujr", "ovvtzejetjkln", "uyjucejikzo", "k", "ikyju")) - .withAnnotation("hkfkimrtixokf") - .withConfigurationType(ConfigurationType.FILE) - .withAclsUrl("nljqepqwhixmons") - .withMatchConfigurations( - Arrays - .asList( - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("yxgvelfcld") - .withSequenceNumber(1657812076895337936L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes( - Arrays - .asList( - "qhndvnoam", "dsehaohdjhhflzo", "xcoxpelnjet", "gltsxoat")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("wcobie")) - .withFragments(Arrays.asList("mninwjizcilng", "gshejjtbxqmulux")) - .withIpLengths( - Arrays.asList("zvners", "ycucrwnamikzeb", "qbsms", "ziqgfuh")) - .withTtlValues(Arrays.asList("ruswhv", "czznvfbycjsxj")) - .withDscpMarkings(Arrays.asList("xzv")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("swvefloccsrmoz"), - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("pgawtxxpkyjcxcjx"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("fmpcycilrmca"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("noxuztrksx"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("ndfcpfn") - .withSequenceNumber(6393112535874003719L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("unlbfjkwr")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("osrxuzvoa", "ktcqio")) - .withFragments(Arrays.asList("bzahgxqd", "yrtltlaprltzkat", "hjm")) - .withIpLengths(Arrays.asList("bsoqeqala", "vlagun", "tgfebwln")) - .withTtlValues(Arrays.asList("yreeudz", "av")) - .withDscpMarkings(Arrays.asList("qmjxlyyzglgouwtl", "jjyuojqtobax")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.TCP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("fmsh")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("bhsy", "qunjqh")) - .withFragments(Arrays.asList("xaulkpakdkifmjnn", "wtqabpxuckp")) - .withIpLengths(Arrays.asList("oweyirdhlis", "gwflq", "mpizru")) - .withTtlValues(Arrays.asList("qxpxiwfcngjsaa", "iixtmkzj")) - .withDscpMarkings( - Arrays.asList("iirhgfgrwsd", "gratzvzbglbyvict", "tbrxkjz")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("yogtieyujtvczkcn", "xrx", "unjdx")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("gozxw", "pdbydpizqacln")) - .withFragments( - Arrays - .asList( - "biygnugjknfsmfct", "uxuuyilflq", "iquvrehm", "njhvsujztc")) - .withIpLengths(Arrays.asList("qjtwhauu", "fprnjl", "tlxs")) - .withTtlValues( - Arrays.asList("ddoui", "amowaziynknlqwzd", "piwhxqs", "dtmaa")) - .withDscpMarkings( - Arrays.asList("huxy", "rjvmtygjbmzyosp", "p", "hckfkyjpmspbps")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("xpaglqivbgkc"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("zvuqdflvon"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("pfpubcpzgpx") - .withSequenceNumber(8408978722842734587L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("zqkzszuwi", "tglxx")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("bgqjxgpnrhgo")) - .withFragments(Arrays.asList("pikqmh", "ao")) - .withIpLengths(Arrays.asList("mzvupor", "zdfuydzvkfvxcnqm")) - .withTtlValues(Arrays.asList("swokm")) - .withDscpMarkings(Arrays.asList("lgg")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("tcvcl", "ynpdkvgfab")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("gpicr")) - .withFragments( - Arrays - .asList( - "hr", "mqgjsxvpq", "bfrmbodthsqqgvri", "bakclacjfrnxous")) - .withIpLengths( - Arrays.asList("zlwvsgmwohqfz", "zvuxm", "kjsvthnwpzteko")) - .withTtlValues(Arrays.asList("ibiattg")) - .withDscpMarkings( - Arrays.asList("cfotangcfhnykzcu", "swvxwlmzqwmv", "xnjmxm")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("kkholvdndvia", "ogphuartvtiu")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("buzphdugn")) - .withFragments(Arrays.asList("n", "gox", "jiuqhibtozi")) - .withIpLengths( - Arrays.asList("jedmurrxxgewp", "tvqylkmqpzoyhlfb", "gwgcl", "xoe")) - .withTtlValues(Arrays.asList("njipnwjfujql", "fcbahhp", "pofoi")) - .withDscpMarkings(Arrays.asList("p")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("n"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("xhk"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("qirwrweoox") - .withSequenceNumber(355993923924701013L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("uyturml")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes( - Arrays.asList("ewmozqvbu", "qmamhsycxhxzga", "ttaboidvmfqh")) - .withFragments(Arrays.asList("bowsepd", "g", "mtdherngb")) - .withIpLengths(Arrays.asList("uahokq", "obkauxofsh", "phwpnulaiywzej")) - .withTtlValues(Arrays.asList("slwkojpl")) - .withDscpMarkings( - Arrays.asList("npdwr", "qafgfugsnnfhyet", "fypococtfjgti")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.TCP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("rswnjlxuzrhwp")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("lbau", "ropions", "onwpnga")) - .withFragments(Arrays.asList("nixjawrtmjfjmy")) - .withIpLengths( - Arrays.asList("lzhcoxovnekh", "nlusfnrd", "jxtxrdc", "tjvidt")) - .withTtlValues(Arrays.asList("puslvyj")) - .withDscpMarkings( - Arrays.asList("uwkasiz", "esfuught", "qfecjxeygtuhx", "ic")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("ac", "lmotoebnfxofvcj")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes(Arrays.asList("aqehg", "dohzjq", "tu")) - .withFragments( - Arrays.asList("gebx", "cnwfepbnwgfmxjg", "g", "jbgdlfgtdysnaquf")) - .withIpLengths( - Arrays.asList("ctqhamzjrwdk", "zeqyjleziun", "xdfzantkw")) - .withTtlValues(Arrays.asList("yamlbnse", "ac", "jvpilguooqja", "m")) - .withDscpMarkings(Arrays.asList("gueiookjbsahrtdt")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.UDP)), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("htvs")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEtherTypes( - Arrays.asList("azftxejwabmdujtm", "cope", "c", "jurbuhhlkyqltqsr")) - .withFragments(Arrays.asList("uwkffdjktsysid", "vclglxnfuij")) - .withIpLengths( - Arrays.asList("usqogsfikayia", "sharujtj", "qxfzyjqttvwk")) - .withTtlValues(Arrays.asList("j", "enuygbq", "qqekewvnqvcdlgu")) - .withDscpMarkings(Arrays.asList("mfdjwn", "axpunjqikczvv", "tacgxmfc")) - .withPortCondition( - new AccessControlListPortCondition() - .withLayer4Protocol(Layer4Protocol.TCP)))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("j"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("xypruuuy"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("r"))))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("uelyetndn") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("gagflnlgmtrwah", "jmucftby")), - new IpGroupProperties() - .withName("lrohkpig") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("ckzmkwklsnox")), - new IpGroupProperties() - .withName("mqeq") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("nhg", "ydyynfsvkh", "bvqt")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("fdlpukhpyr") - .withVlans(Arrays.asList("zjcpeogk", "nmg")), - new VlanGroupProperties() - .withName("ouxddbhfhpfpazj") - .withVlans(Arrays.asList("wjxhpdulon", "acn")), - new VlanGroupProperties() - .withName("w") - .withVlans(Arrays.asList("tuevrh", "ljyoogwx", "nsduugwbsre")), - new VlanGroupProperties() - .withName("fqkfuarenl") - .withVlans(Arrays.asList("tklnvnafvvkyfed", "v")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("lcqxypokk") - .withPorts( - Arrays - .asList( - "nqcymczngnbdxxew", - "ninvudbchaqdt", - "qecrqctmxx", - "tddmf")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("tx") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays.asList("apxbannovvoxczy", "prwnwvroevytlyo", "rrrouuxvnsa")), - new IpGroupProperties() - .withName("crymodizrxklobd") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("mkmlmvevfx", "op", "hbzxli")), - new IpGroupProperties() - .withName("rdddtfgxqbawpcb") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("yknapqofyuicdh", "bd", "bwwg", "d")), - new IpGroupProperties() - .withName("bid") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("f", "lfmu", "apckccrrvw", "yoxoy")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("haim") - .withVlans(Arrays.asList("roqboshbragapyy", "mfsvbpav")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("ppdbwnupgahxkum") - .withPorts(Arrays.asList("caac", "dmmcpugmehqep", "u", "hbzehewho")), - new PortGroupProperties() - .withName("nlbqnbldxeaclg") - .withPorts(Arrays.asList("orim", "rsrrmoucsofldp")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("fcaabe") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("lvbmxuqibsxtkcu", "fbsfarfsiow")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("nqpvwgfstmhqykiz") - .withVlans( - Arrays.asList("saoafcluqvox", "ycjimryvwgcwwpbm", "gwe", "ydsx")), - new VlanGroupProperties() - .withName("fo") - .withVlans( - Arrays - .asList( - "bvopwndyqle", "llklmtk", "lowkxxpvb", "dfjmzsyzfhotlh")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("ychunsjlpjrtwszh") - .withPorts(Arrays.asList("icphvtrrmhw")), - new PortGroupProperties() - .withName("fdpyflubh") - .withPorts(Arrays.asList("lrocuyzlwh", "memhooclutnpq")), - new PortGroupProperties() - .withName("mczjkm") - .withPorts( - Arrays - .asList( - "yujxsglhsrrry", - "jylmbkzudnigr", - "ihotjewlpxuzzjg", - "refqy")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("oihiqak") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("brkwpzdqt")), - new IpGroupProperties() - .withName("cspodaqax") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("tgbebj", "ulbmoichdlp", "fpubntnbatz")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("owsaaelcattcjuh") - .withVlans( - Arrays.asList("vkmjcwmjvlgf", "gcvkyyli", "rzbjpsfxsfuz", "lvt")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("bwidql") - .withPorts(Arrays.asList("koveof", "zrvjfnmjmvlwyzgi")))))); - model = BinaryData.fromObject(model).toObject(AccessControlListPatch.class); - Assertions.assertEquals("ujr", model.tags().get("lfojuidjp")); - Assertions.assertEquals("hkfkimrtixokf", model.annotation()); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("nljqepqwhixmons", model.aclsUrl()); - Assertions.assertEquals("yxgvelfcld", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(1657812076895337936L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals( - "qhndvnoam", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals("wcobie", model.matchConfigurations().get(0).matchConditions().get(0).etherTypes().get(0)); - Assertions - .assertEquals( - "mninwjizcilng", model.matchConfigurations().get(0).matchConditions().get(0).fragments().get(0)); - Assertions - .assertEquals("zvners", model.matchConfigurations().get(0).matchConditions().get(0).ipLengths().get(0)); - Assertions - .assertEquals("ruswhv", model.matchConfigurations().get(0).matchConditions().get(0).ttlValues().get(0)); - Assertions - .assertEquals("xzv", model.matchConfigurations().get(0).matchConditions().get(0).dscpMarkings().get(0)); - Assertions - .assertEquals( - Layer4Protocol.UDP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions.assertEquals(AclActionType.DROP, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("swvefloccsrmoz", model.matchConfigurations().get(0).actions().get(0).counterName()); - Assertions.assertEquals("uelyetndn", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV4, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals( - "gagflnlgmtrwah", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("fdlpukhpyr", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("zjcpeogk", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("lcqxypokk", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions - .assertEquals( - "nqcymczngnbdxxew", model.dynamicMatchConfigurations().get(0).portGroups().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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPatchablePropertiesTests.java deleted file mode 100644 index f1bfe2504c50..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPatchablePropertiesTests.java +++ /dev/null @@ -1,582 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListAction; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AccessControlListPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccessControlListPatchableProperties model = - BinaryData - .fromString( - "{\"configurationType\":\"Inline\",\"aclsUrl\":\"hmkxmaehvbb\",\"matchConfigurations\":[{\"matchConfigurationName\":\"pltfnhtba\",\"sequenceNumber\":1750720875062450600,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"yklyhpluodpvruud\",\"gzibthostgktstv\",\"xeclzedqbcvhzlhp\",\"odqkdlwwqfb\"],\"fragments\":[\"kxtrq\"],\"ipLengths\":[\"mlmbtxhwgfwsrta\",\"coezbrhubskh\",\"dyg\",\"ookk\"],\"ttlValues\":[\"jb\",\"leorfmluiqtqz\",\"avyvnqqyba\"],\"dscpMarkings\":[\"uayjkqa\",\"qgzsles\",\"cbhernntiewdj\",\"vbquwr\"],\"portCondition\":{\"flags\":[\"agohbuff\",\"mrqemvvhmx\",\"drjf\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"bj\",\"ewzcjznmwcp\",\"guaadraufactkahz\"],\"portGroupNames\":[\"jjziuxxpsh\",\"eekulfgslqubkwd\",\"enr\",\"sutujba\"]},\"protocolTypes\":[\"uo\",\"minyflnorwm\",\"uvwpklvxwmyg\",\"xpgpq\"],\"vlanMatchCondition\":{\"vlans\":[\"zepn\"],\"innerVlans\":[\"crxgibb\",\"axconfozauo\",\"sukokwbqplhl\",\"nuuepzlrp\"],\"vlanGroupNames\":[\"soldweyuqdunv\",\"nnrwrbiork\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"gdnhxmsiv\",\"omi\",\"ox\"],\"ipGroupNames\":[\"ufiqndieuzaof\",\"chvcyyysfgdo\"]}},{\"etherTypes\":[\"biipuip\",\"oqonma\",\"jeknizshq\",\"cimpevfg\"],\"fragments\":[\"rrilbywdxsmic\"],\"ipLengths\":[\"wfscjfn\",\"nszqujiz\",\"voqyt\",\"byowbblgyavutp\"],\"ttlValues\":[\"oxoismsksbpim\",\"qolj\"],\"dscpMarkings\":[\"gxxlxsffgcvizq\",\"dwl\"],\"portCondition\":{\"flags\":[\"oupfgfb\",\"jub\",\"yhgk\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"owzfttsttkt\"],\"portGroupNames\":[\"bqactxtgzukx\"]},\"protocolTypes\":[\"m\",\"tg\",\"qqxhrnxrxcpj\"],\"vlanMatchCondition\":{\"vlans\":[\"vokqdzfv\"],\"innerVlans\":[\"vjlfrqtt\",\"ajlkatnw\",\"yiopi\",\"kqqfk\"],\"vlanGroupNames\":[\"cxkdmligovi\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"azur\"],\"ipGroupNames\":[\"bgo\",\"rb\"]}},{\"etherTypes\":[\"ybfhjxa\",\"vvjgslor\",\"il\"],\"fragments\":[\"wt\",\"gkxnyedabg\"],\"ipLengths\":[\"dtj\",\"ewbcihxuuw\",\"c\"],\"ttlValues\":[\"ccybvp\",\"yakk\"],\"dscpMarkings\":[\"px\"],\"portCondition\":{\"flags\":[\"lma\",\"stcyohpfkyrkdbd\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"kmnwqjnobaiyhddv\",\"acegfnmntf\"],\"portGroupNames\":[\"memfnczdwvvbalxl\"]},\"protocolTypes\":[\"hpodbzev\"],\"vlanMatchCondition\":{\"vlans\":[\"hfuk\"],\"innerVlans\":[\"jcswsmys\",\"uluqypfc\",\"lerchpq\",\"mfpjbabw\"],\"vlanGroupNames\":[\"cxsspuunnoxyh\",\"xgqddrih\",\"fhoqca\",\"ewda\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"x\",\"kzbrmsgeivsiy\",\"zkdnc\"],\"ipGroupNames\":[\"onbzoggculapzwy\",\"pgogtqxepny\",\"b\",\"uajlyj\"]}}],\"actions\":[{\"type\":\"Drop\",\"counterName\":\"zhvfcibyfmowuxr\"},{\"type\":\"Count\",\"counterName\":\"dwxf\"},{\"type\":\"Log\",\"counterName\":\"vwzjbhyz\"}]},{\"matchConfigurationName\":\"jrkambtrnegvmnv\",\"sequenceNumber\":2282219520310913281,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"stjbkkdmfl\",\"est\",\"jlxr\",\"ilozapeewchpxlk\"],\"fragments\":[\"uziycsl\",\"vu\",\"uztcktyhjtqed\"],\"ipLengths\":[\"ulwm\",\"rqzz\",\"rjvpglydzgkrvqee\",\"toepryu\"],\"ttlValues\":[\"ytp\",\"dmovzvfva\",\"wzqa\"],\"dscpMarkings\":[\"gzuriglaecxndt\",\"cokpv\"],\"portCondition\":{\"flags\":[\"t\",\"ld\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"rclnpkc\",\"ayzri\"],\"portGroupNames\":[\"yawfvjlboxq\"]},\"protocolTypes\":[\"lmxhomdyn\",\"dwdigumb\",\"raauzzpt\"],\"vlanMatchCondition\":{\"vlans\":[\"sdzhezww\",\"aiqyuvvfo\"],\"innerVlans\":[\"hhqyi\"],\"vlanGroupNames\":[\"lauyav\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"tijfybvp\",\"ekrsgs\",\"b\",\"huzqgn\"],\"ipGroupNames\":[\"kynscliqhzv\",\"xnkomtkubo\",\"ppnvdxz\"]}},{\"etherTypes\":[\"hfrbbc\",\"vqagtltdhlf\",\"qojpy\"],\"fragments\":[\"trdcnifmzzs\"],\"ipLengths\":[\"brn\"],\"ttlValues\":[\"xmprafwg\"],\"dscpMarkings\":[\"ocxvdfffwafqr\",\"udaspavehh\",\"vkbunzozudh\",\"xg\"],\"portCondition\":{\"flags\":[\"xcdyuibhmfdnb\",\"ydvfvfcjnae\",\"isrvhm\",\"orffukiscv\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"lefaxvxilcbtgn\"],\"portGroupNames\":[\"eyqxtjjfzql\",\"hycav\",\"dggxdbeesmi\",\"knlrariaawiuagy\"]},\"protocolTypes\":[\"fbylyrfg\"],\"vlanMatchCondition\":{\"vlans\":[\"cojocqwogfnzjvus\",\"zldmozuxy\",\"fsbtkad\"],\"innerVlans\":[\"own\"],\"vlanGroupNames\":[\"kb\",\"grjqctojcmi\",\"of\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"yqdhcuplcplcw\"],\"ipGroupNames\":[\"hihlhzdsqtzbs\"]}},{\"etherTypes\":[\"o\"],\"fragments\":[\"hfgmvecactxm\"],\"ipLengths\":[\"e\",\"owcluqo\"],\"ttlValues\":[\"qvgqouw\",\"fzmpjwyivq\"],\"dscpMarkings\":[\"xcvhrfs\"],\"portCondition\":{\"flags\":[\"grttikteusqczk\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"byjaffmmf\",\"lcqcuubgqibrt\",\"lmetttwgdslqxi\"],\"portGroupNames\":[\"moo\",\"z\",\"seypxiutcxapz\"]},\"protocolTypes\":[\"petogebjox\",\"lhvnhlab\",\"q\",\"kkzjcjbtrga\"],\"vlanMatchCondition\":{\"vlans\":[\"ib\"],\"innerVlans\":[\"jsto\"],\"vlanGroupNames\":[\"it\",\"kxzt\",\"oobklftidgfcwq\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"hemjy\"],\"ipGroupNames\":[\"uj\",\"wtwko\",\"zwculkbawpfajnj\",\"ltlwtjjguktalhs\"]}}],\"actions\":[{\"type\":\"Drop\",\"counterName\":\"xzrpo\"},{\"type\":\"Drop\",\"counterName\":\"nwiaaomyl\"},{\"type\":\"Drop\",\"counterName\":\"ulcsethwwnpj\"},{\"type\":\"Log\",\"counterName\":\"swpchwahfbousn\"}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{\"name\":\"wetwlyxgncxykxh\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"mmbcxfhbcp\",\"rxvxcjzh\"]},{\"name\":\"zxfpxtgqsc\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"juhdqazkmtgguwpi\"]},{\"name\":\"ajc\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"hfcf\",\"wrxgkneuvy\",\"nzqodfvpg\",\"hoxgsgbpf\"]},{\"name\":\"djtxvzflbq\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"lgafcqusrdve\"]}],\"vlanGroups\":[{\"name\":\"dtutnwldu\",\"vlans\":[\"uzhyrmewipmvekdx\",\"kuqgsjjxundxgket\"]},{\"name\":\"hhzjhfj\",\"vlans\":[\"vmuvgpmu\"]},{\"name\":\"qsxvmhf\",\"vlans\":[\"jyihsasbhudypo\"]}],\"portGroups\":[{\"name\":\"ms\",\"ports\":[\"sqy\",\"pfoobr\",\"ttymsjny\",\"qdnfwqzdz\"]},{\"name\":\"ilaxhn\",\"ports\":[\"lyvijouwiv\",\"xoyzunbix\"]}]},{\"ipGroups\":[{\"name\":\"kvcpwpgclr\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"oxfrkenxpmyyefr\",\"mpdnqqskawa\"]}],\"vlanGroups\":[{\"name\":\"mbnpqf\",\"vlans\":[\"lkzmegnitgvkxl\",\"yqdrf\"]}],\"portGroups\":[{\"name\":\"alzxwhcan\",\"ports\":[\"oyqhlwig\"]},{\"name\":\"vbkbxgomf\",\"ports\":[\"wasqvdaeyyg\",\"xakjsqzhzb\"]}]},{\"ipGroups\":[{\"name\":\"imsidxasicddyvvj\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"ocwah\",\"qgatjeaahhvjhhn\"]},{\"name\":\"zybbj\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"syxkyxvxevblb\",\"ednljl\",\"geuaulx\",\"nsmjbnkppxynen\"]},{\"name\":\"vxei\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"lnsrmffe\",\"cxcktpi\",\"merteeammxqiek\"]}],\"vlanGroups\":[{\"name\":\"drtkgdoj\",\"vlans\":[\"vavrefdees\"]},{\"name\":\"cuijpxt\",\"vlans\":[\"wprtu\",\"wsawddjibabxvi\",\"itvtzeexavo\"]}],\"portGroups\":[{\"name\":\"lecdmdqbw\",\"ports\":[\"q\",\"gsfjac\",\"slhhxudbxv\"]},{\"name\":\"htnsi\",\"ports\":[\"hzmme\",\"ckdlpag\",\"rcxfailcfxwmdb\"]},{\"name\":\"dfgsftufqobrj\",\"ports\":[\"cgcckknhxkizvyt\",\"rzvul\",\"r\"]}]}]}") - .toObject(AccessControlListPatchableProperties.class); - Assertions.assertEquals(ConfigurationType.INLINE, model.configurationType()); - Assertions.assertEquals("hmkxmaehvbb", model.aclsUrl()); - Assertions.assertEquals("pltfnhtba", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(1750720875062450600L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals("uo", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "zepn", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "crxgibb", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "soldweyuqdunv", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.DESTINATION_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.LONGEST_PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "gdnhxmsiv", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "ufiqndieuzaof", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions - .assertEquals( - "yklyhpluodpvruud", model.matchConfigurations().get(0).matchConditions().get(0).etherTypes().get(0)); - Assertions - .assertEquals("kxtrq", model.matchConfigurations().get(0).matchConditions().get(0).fragments().get(0)); - Assertions - .assertEquals( - "mlmbtxhwgfwsrta", model.matchConfigurations().get(0).matchConditions().get(0).ipLengths().get(0)); - Assertions.assertEquals("jb", model.matchConfigurations().get(0).matchConditions().get(0).ttlValues().get(0)); - Assertions - .assertEquals("uayjkqa", model.matchConfigurations().get(0).matchConditions().get(0).dscpMarkings().get(0)); - Assertions - .assertEquals( - PortType.SOURCE_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.UDP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "bj", model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "jjziuxxpsh", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions - .assertEquals( - "agohbuff", model.matchConfigurations().get(0).matchConditions().get(0).portCondition().flags().get(0)); - Assertions.assertEquals(AclActionType.DROP, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("zhvfcibyfmowuxr", model.matchConfigurations().get(0).actions().get(0).counterName()); - Assertions.assertEquals("wetwlyxgncxykxh", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV4, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals( - "mmbcxfhbcp", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("dtutnwldu", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals( - "uzhyrmewipmvekdx", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("ms", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("sqy", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessControlListPatchableProperties model = - new AccessControlListPatchableProperties() - .withConfigurationType(ConfigurationType.INLINE) - .withAclsUrl("hmkxmaehvbb") - .withMatchConfigurations( - Arrays - .asList( - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("pltfnhtba") - .withSequenceNumber(1750720875062450600L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes( - Arrays.asList("uo", "minyflnorwm", "uvwpklvxwmyg", "xpgpq")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("zepn")) - .withInnerVlans( - Arrays - .asList( - "crxgibb", - "axconfozauo", - "sukokwbqplhl", - "nuuepzlrp")) - .withVlanGroupNames( - Arrays.asList("soldweyuqdunv", "nnrwrbiork"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("gdnhxmsiv", "omi", "ox")) - .withIpGroupNames( - Arrays.asList("ufiqndieuzaof", "chvcyyysfgdo"))) - .withEtherTypes( - Arrays - .asList( - "yklyhpluodpvruud", - "gzibthostgktstv", - "xeclzedqbcvhzlhp", - "odqkdlwwqfb")) - .withFragments(Arrays.asList("kxtrq")) - .withIpLengths( - Arrays.asList("mlmbtxhwgfwsrta", "coezbrhubskh", "dyg", "ookk")) - .withTtlValues(Arrays.asList("jb", "leorfmluiqtqz", "avyvnqqyba")) - .withDscpMarkings( - Arrays.asList("uayjkqa", "qgzsles", "cbhernntiewdj", "vbquwr")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts( - Arrays.asList("bj", "ewzcjznmwcp", "guaadraufactkahz")) - .withPortGroupNames( - Arrays - .asList( - "jjziuxxpsh", "eekulfgslqubkwd", "enr", "sutujba")) - .withFlags(Arrays.asList("agohbuff", "mrqemvvhmx", "drjf"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("m", "tg", "qqxhrnxrxcpj")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("vokqdzfv")) - .withInnerVlans( - Arrays.asList("vjlfrqtt", "ajlkatnw", "yiopi", "kqqfk")) - .withVlanGroupNames(Arrays.asList("cxkdmligovi"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("azur")) - .withIpGroupNames(Arrays.asList("bgo", "rb"))) - .withEtherTypes( - Arrays.asList("biipuip", "oqonma", "jeknizshq", "cimpevfg")) - .withFragments(Arrays.asList("rrilbywdxsmic")) - .withIpLengths( - Arrays.asList("wfscjfn", "nszqujiz", "voqyt", "byowbblgyavutp")) - .withTtlValues(Arrays.asList("oxoismsksbpim", "qolj")) - .withDscpMarkings(Arrays.asList("gxxlxsffgcvizq", "dwl")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("owzfttsttkt")) - .withPortGroupNames(Arrays.asList("bqactxtgzukx")) - .withFlags(Arrays.asList("oupfgfb", "jub", "yhgk"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("hpodbzev")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("hfuk")) - .withInnerVlans( - Arrays - .asList("jcswsmys", "uluqypfc", "lerchpq", "mfpjbabw")) - .withVlanGroupNames( - Arrays - .asList("cxsspuunnoxyh", "xgqddrih", "fhoqca", "ewda"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays.asList("x", "kzbrmsgeivsiy", "zkdnc")) - .withIpGroupNames( - Arrays - .asList( - "onbzoggculapzwy", "pgogtqxepny", "b", "uajlyj"))) - .withEtherTypes(Arrays.asList("ybfhjxa", "vvjgslor", "il")) - .withFragments(Arrays.asList("wt", "gkxnyedabg")) - .withIpLengths(Arrays.asList("dtj", "ewbcihxuuw", "c")) - .withTtlValues(Arrays.asList("ccybvp", "yakk")) - .withDscpMarkings(Arrays.asList("px")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("kmnwqjnobaiyhddv", "acegfnmntf")) - .withPortGroupNames(Arrays.asList("memfnczdwvvbalxl")) - .withFlags(Arrays.asList("lma", "stcyohpfkyrkdbd"))))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("zhvfcibyfmowuxr"), - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("dwxf"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("vwzjbhyz"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("jrkambtrnegvmnv") - .withSequenceNumber(2282219520310913281L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("lmxhomdyn", "dwdigumb", "raauzzpt")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("sdzhezww", "aiqyuvvfo")) - .withInnerVlans(Arrays.asList("hhqyi")) - .withVlanGroupNames(Arrays.asList("lauyav"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("tijfybvp", "ekrsgs", "b", "huzqgn")) - .withIpGroupNames( - Arrays.asList("kynscliqhzv", "xnkomtkubo", "ppnvdxz"))) - .withEtherTypes( - Arrays.asList("stjbkkdmfl", "est", "jlxr", "ilozapeewchpxlk")) - .withFragments(Arrays.asList("uziycsl", "vu", "uztcktyhjtqed")) - .withIpLengths( - Arrays.asList("ulwm", "rqzz", "rjvpglydzgkrvqee", "toepryu")) - .withTtlValues(Arrays.asList("ytp", "dmovzvfva", "wzqa")) - .withDscpMarkings(Arrays.asList("gzuriglaecxndt", "cokpv")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("rclnpkc", "ayzri")) - .withPortGroupNames(Arrays.asList("yawfvjlboxq")) - .withFlags(Arrays.asList("t", "ld"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("fbylyrfg")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays.asList("cojocqwogfnzjvus", "zldmozuxy", "fsbtkad")) - .withInnerVlans(Arrays.asList("own")) - .withVlanGroupNames(Arrays.asList("kb", "grjqctojcmi", "of"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("yqdhcuplcplcw")) - .withIpGroupNames(Arrays.asList("hihlhzdsqtzbs"))) - .withEtherTypes(Arrays.asList("hfrbbc", "vqagtltdhlf", "qojpy")) - .withFragments(Arrays.asList("trdcnifmzzs")) - .withIpLengths(Arrays.asList("brn")) - .withTtlValues(Arrays.asList("xmprafwg")) - .withDscpMarkings( - Arrays.asList("ocxvdfffwafqr", "udaspavehh", "vkbunzozudh", "xg")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("lefaxvxilcbtgn")) - .withPortGroupNames( - Arrays - .asList( - "eyqxtjjfzql", - "hycav", - "dggxdbeesmi", - "knlrariaawiuagy")) - .withFlags( - Arrays - .asList( - "xcdyuibhmfdnb", - "ydvfvfcjnae", - "isrvhm", - "orffukiscv"))), - new AccessControlListMatchCondition() - .withProtocolTypes( - Arrays.asList("petogebjox", "lhvnhlab", "q", "kkzjcjbtrga")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("ib")) - .withInnerVlans(Arrays.asList("jsto")) - .withVlanGroupNames( - Arrays.asList("it", "kxzt", "oobklftidgfcwq"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("hemjy")) - .withIpGroupNames( - Arrays - .asList( - "uj", - "wtwko", - "zwculkbawpfajnj", - "ltlwtjjguktalhs"))) - .withEtherTypes(Arrays.asList("o")) - .withFragments(Arrays.asList("hfgmvecactxm")) - .withIpLengths(Arrays.asList("e", "owcluqo")) - .withTtlValues(Arrays.asList("qvgqouw", "fzmpjwyivq")) - .withDscpMarkings(Arrays.asList("xcvhrfs")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays - .asList("byjaffmmf", "lcqcuubgqibrt", "lmetttwgdslqxi")) - .withPortGroupNames(Arrays.asList("moo", "z", "seypxiutcxapz")) - .withFlags(Arrays.asList("grttikteusqczk"))))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("xzrpo"), - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("nwiaaomyl"), - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("ulcsethwwnpj"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("swpchwahfbousn"))))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("wetwlyxgncxykxh") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("mmbcxfhbcp", "rxvxcjzh")), - new IpGroupProperties() - .withName("zxfpxtgqsc") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("juhdqazkmtgguwpi")), - new IpGroupProperties() - .withName("ajc") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes( - Arrays.asList("hfcf", "wrxgkneuvy", "nzqodfvpg", "hoxgsgbpf")), - new IpGroupProperties() - .withName("djtxvzflbq") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("lgafcqusrdve")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("dtutnwldu") - .withVlans(Arrays.asList("uzhyrmewipmvekdx", "kuqgsjjxundxgket")), - new VlanGroupProperties() - .withName("hhzjhfj") - .withVlans(Arrays.asList("vmuvgpmu")), - new VlanGroupProperties() - .withName("qsxvmhf") - .withVlans(Arrays.asList("jyihsasbhudypo")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("ms") - .withPorts(Arrays.asList("sqy", "pfoobr", "ttymsjny", "qdnfwqzdz")), - new PortGroupProperties() - .withName("ilaxhn") - .withPorts(Arrays.asList("lyvijouwiv", "xoyzunbix")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("kvcpwpgclr") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("oxfrkenxpmyyefr", "mpdnqqskawa")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("mbnpqf") - .withVlans(Arrays.asList("lkzmegnitgvkxl", "yqdrf")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("alzxwhcan") - .withPorts(Arrays.asList("oyqhlwig")), - new PortGroupProperties() - .withName("vbkbxgomf") - .withPorts(Arrays.asList("wasqvdaeyyg", "xakjsqzhzb")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("imsidxasicddyvvj") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("ocwah", "qgatjeaahhvjhhn")), - new IpGroupProperties() - .withName("zybbj") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes( - Arrays - .asList( - "syxkyxvxevblb", "ednljl", "geuaulx", "nsmjbnkppxynen")), - new IpGroupProperties() - .withName("vxei") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes( - Arrays.asList("lnsrmffe", "cxcktpi", "merteeammxqiek")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("drtkgdoj") - .withVlans(Arrays.asList("vavrefdees")), - new VlanGroupProperties() - .withName("cuijpxt") - .withVlans(Arrays.asList("wprtu", "wsawddjibabxvi", "itvtzeexavo")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("lecdmdqbw") - .withPorts(Arrays.asList("q", "gsfjac", "slhhxudbxv")), - new PortGroupProperties() - .withName("htnsi") - .withPorts(Arrays.asList("hzmme", "ckdlpag", "rcxfailcfxwmdb")), - new PortGroupProperties() - .withName("dfgsftufqobrj") - .withPorts(Arrays.asList("cgcckknhxkizvyt", "rzvul", "r")))))); - model = BinaryData.fromObject(model).toObject(AccessControlListPatchableProperties.class); - Assertions.assertEquals(ConfigurationType.INLINE, model.configurationType()); - Assertions.assertEquals("hmkxmaehvbb", model.aclsUrl()); - Assertions.assertEquals("pltfnhtba", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(1750720875062450600L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals("uo", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "zepn", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "crxgibb", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "soldweyuqdunv", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.DESTINATION_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.LONGEST_PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "gdnhxmsiv", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "ufiqndieuzaof", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions - .assertEquals( - "yklyhpluodpvruud", model.matchConfigurations().get(0).matchConditions().get(0).etherTypes().get(0)); - Assertions - .assertEquals("kxtrq", model.matchConfigurations().get(0).matchConditions().get(0).fragments().get(0)); - Assertions - .assertEquals( - "mlmbtxhwgfwsrta", model.matchConfigurations().get(0).matchConditions().get(0).ipLengths().get(0)); - Assertions.assertEquals("jb", model.matchConfigurations().get(0).matchConditions().get(0).ttlValues().get(0)); - Assertions - .assertEquals("uayjkqa", model.matchConfigurations().get(0).matchConditions().get(0).dscpMarkings().get(0)); - Assertions - .assertEquals( - PortType.SOURCE_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.UDP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "bj", model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "jjziuxxpsh", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions - .assertEquals( - "agohbuff", model.matchConfigurations().get(0).matchConditions().get(0).portCondition().flags().get(0)); - Assertions.assertEquals(AclActionType.DROP, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("zhvfcibyfmowuxr", model.matchConfigurations().get(0).actions().get(0).counterName()); - Assertions.assertEquals("wetwlyxgncxykxh", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV4, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals( - "mmbcxfhbcp", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("dtutnwldu", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals( - "uzhyrmewipmvekdx", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("ms", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("sqy", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPortConditionTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPortConditionTests.java deleted file mode 100644 index 16566b10592e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPortConditionTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AccessControlListPortConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccessControlListPortCondition model = - BinaryData - .fromString( - "{\"flags\":[\"wefqsfapaqtferr\",\"wexjkmfxapjwogq\",\"nobpudcdabtqwpw\",\"awbzasqb\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"yexaoguy\",\"i\",\"ids\",\"ault\"],\"portGroupNames\":[\"jumfqwazlnq\"]}") - .toObject(AccessControlListPortCondition.class); - Assertions.assertEquals(PortType.SOURCE_PORT, model.portType()); - Assertions.assertEquals(Layer4Protocol.TCP, model.layer4Protocol()); - Assertions.assertEquals("yexaoguy", model.ports().get(0)); - Assertions.assertEquals("jumfqwazlnq", model.portGroupNames().get(0)); - Assertions.assertEquals("wefqsfapaqtferr", model.flags().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessControlListPortCondition model = - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("yexaoguy", "i", "ids", "ault")) - .withPortGroupNames(Arrays.asList("jumfqwazlnq")) - .withFlags(Arrays.asList("wefqsfapaqtferr", "wexjkmfxapjwogq", "nobpudcdabtqwpw", "awbzasqb")); - model = BinaryData.fromObject(model).toObject(AccessControlListPortCondition.class); - Assertions.assertEquals(PortType.SOURCE_PORT, model.portType()); - Assertions.assertEquals(Layer4Protocol.TCP, model.layer4Protocol()); - Assertions.assertEquals("yexaoguy", model.ports().get(0)); - Assertions.assertEquals("jumfqwazlnq", model.portGroupNames().get(0)); - Assertions.assertEquals("wefqsfapaqtferr", model.flags().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPropertiesTests.java deleted file mode 100644 index c35ef12f95ad..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListPropertiesTests.java +++ /dev/null @@ -1,928 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListProperties; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListAction; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AclActionType; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AccessControlListPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccessControlListProperties model = - BinaryData - .fromString( - "{\"lastSyncedTime\":\"2021-05-30T00:59:07Z\",\"configurationState\":\"ErrorProvisioning\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"MAT\",\"configurationType\":\"File\",\"aclsUrl\":\"onowk\",\"matchConfigurations\":[{\"matchConfigurationName\":\"ankixzbinjeput\",\"sequenceNumber\":4034395875426050930,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"ftiyqzrnkcq\",\"yx\"],\"fragments\":[\"zlsico\"],\"ipLengths\":[\"qnwvlrya\"],\"ttlValues\":[\"heun\",\"mqhgyxzkonocuk\",\"klyaxuconu\"],\"dscpMarkings\":[\"fkbey\"],\"portCondition\":{\"flags\":[\"mjmwvvjektcx\",\"enhwlrs\",\"frzpwvlqdqgb\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"kaet\",\"kt\",\"fcivfsnkym\"],\"portGroupNames\":[\"qhjfbebr\",\"cxerf\",\"wutttxfvjrbi\"]},\"protocolTypes\":[\"xepcyvahfn\",\"jky\",\"xjvuujqgidokg\",\"ljyoxgvcltb\"],\"vlanMatchCondition\":{\"vlans\":[\"ghkjeszzhbi\"],\"innerVlans\":[\"xfvgxbfsmxne\",\"mpvecxgodebfqk\"],\"vlanGroupNames\":[\"mpukgriw\",\"lzlfbxzpuz\",\"cispnqzahmgkbr\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"uqqkpik\",\"drgvtqagn\",\"uynhijg\",\"mebf\"],\"ipGroupNames\":[\"rbu\"]}},{\"etherTypes\":[\"vpnazzm\",\"jrunmpxtt\",\"bh\",\"bnlankxmyskpb\"],\"fragments\":[\"btkcxywnytnrsyn\",\"qidybyx\",\"zfcl\",\"aaxdbabphlwrq\"],\"ipLengths\":[\"tsthsucocm\",\"yyazttbt\",\"wrqpue\",\"ckzywbiexzfeyue\"],\"ttlValues\":[\"bxu\"],\"dscpMarkings\":[\"hqwa\",\"muzyoxaepdk\",\"jancu\",\"rhdwbavxbniw\"],\"portCondition\":{\"flags\":[\"zt\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"xytxhpzxbz\",\"fzab\"],\"portGroupNames\":[\"uhxwtctyqiklbbov\"]},\"protocolTypes\":[\"zbhvgyuguosv\",\"kfssxqukkf\",\"l\"],\"vlanMatchCondition\":{\"vlans\":[\"xnkjzkdesl\",\"vlopwiyighx\",\"kdwzbaiuebbaumny\",\"upedeojnabckhs\"],\"innerVlans\":[\"psiebtfhvpes\",\"pskrdqmh\",\"jdhtldwkyzxu\",\"tkncwsc\"],\"vlanGroupNames\":[\"lxotogtwrupq\",\"xvnmicykvceov\",\"ilovnot\",\"fj\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"x\",\"hbttkphyw\"],\"ipGroupNames\":[\"jtoqne\",\"mclfplphoxuscr\",\"abgy\",\"psbjta\"]}},{\"etherTypes\":[\"gxywpmue\",\"fjz\",\"fqkquj\"],\"fragments\":[\"uyonobglaoc\",\"xtccmg\",\"udxytlmoyrx\",\"wfudwpzntxhdzhl\"],\"ipLengths\":[\"bh\",\"kfrlhrxsbky\",\"pycanuzbpz\"],\"ttlValues\":[\"kuwbcrnwb\",\"ehhseyvjusrts\",\"hspkdeemao\",\"mx\"],\"dscpMarkings\":[\"vt\"],\"portCondition\":{\"flags\":[\"qkrhahvljua\",\"aquhcdhm\",\"ualaexqpvfadmw\",\"rcrgvx\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"lf\",\"isgwbnbbeldawkz\",\"ali\",\"urqhaka\"],\"portGroupNames\":[\"shsfwxosowzxcu\",\"i\",\"jooxdjebw\"]},\"protocolTypes\":[\"wwfvov\",\"vmeueci\",\"yhz\"],\"vlanMatchCondition\":{\"vlans\":[\"jgjrwjueiotwm\",\"dytdxwitx\",\"rjaw\",\"qwgxhniskx\"],\"innerVlans\":[\"py\",\"gklwn\",\"nhjdauw\",\"vylwzbtdhxuj\"],\"vlanGroupNames\":[\"mpowuwpr\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"upjm\"],\"ipGroupNames\":[\"xobbcswsrt\",\"riplrbpbewtg\",\"fgb\"]}},{\"etherTypes\":[\"wxzvlvqhjkb\"],\"fragments\":[\"btn\",\"xiebwwaloayqcg\",\"rtzju\",\"gwyzm\"],\"ipLengths\":[\"ongmtsa\",\"jcbpwxqpsrknft\",\"uvriuhprwm\",\"yvxqtayriwwroy\"],\"ttlValues\":[\"xrmcqibycnojvk\",\"mefqsgzvahapjyzh\",\"vgqzcjrvxd\",\"zlmwlxkvugfhz\"],\"dscpMarkings\":[\"wjvzunluthnn\",\"rnxipei\",\"pjzu\",\"e\"],\"portCondition\":{\"flags\":[\"ltskzbbtd\",\"umveekgpwozuhkf\",\"bsjyofdx\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"touwaboekqv\",\"elnsmvbxw\",\"jsflhhcaalnjix\",\"sxyawjoyaqcs\"],\"portGroupNames\":[\"pkii\",\"zyexzn\",\"lixhnrztfol\",\"bnxknalaulppg\"]},\"protocolTypes\":[\"pnapnyiropuh\",\"igvpgylg\",\"git\",\"medjvcslynqwwncw\"],\"vlanMatchCondition\":{\"vlans\":[\"gktrmgucnapkte\"],\"innerVlans\":[\"lwptfdy\",\"pfqbuaceopzf\"],\"vlanGroupNames\":[\"huaoppp\",\"qeqxo\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"t\",\"bgbkdmoizpost\"],\"ipGroupNames\":[\"cfbu\",\"rmfqjhhkxbpvj\"]}}],\"actions\":[{\"type\":\"Count\",\"counterName\":\"j\"},{\"type\":\"Log\",\"counterName\":\"divkrt\"}]},{\"matchConfigurationName\":\"bxqz\",\"sequenceNumber\":2872622925140692526,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"etherTypes\":[\"dxxiv\",\"tvtc\",\"aqtdoqmcbx\",\"wvxysl\"],\"fragments\":[\"sfxobl\",\"tkblmpewww\",\"bkrvrnsvshqj\"],\"ipLengths\":[\"crsbfovasr\"],\"ttlValues\":[\"wbhsqfsub\"],\"dscpMarkings\":[\"birx\"],\"portCondition\":{\"flags\":[\"srfbjfdtwss\",\"t\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"bexilzznfqqnv\",\"pmqtaru\",\"ujmkcjhwqy\",\"jrybnwjewgdrjer\"],\"portGroupNames\":[\"enq\"]},\"protocolTypes\":[\"indoygmifthnzd\"],\"vlanMatchCondition\":{\"vlans\":[\"gnayqigynduh\"],\"innerVlans\":[\"qlkth\",\"maqolbgycduie\",\"tgccymvaolpss\"],\"vlanGroupNames\":[\"fmmdnbbg\",\"zpswiydmc\",\"yhz\",\"xssadbzmnvdf\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"xzb\",\"cblylpstdbhhxsr\"],\"ipGroupNames\":[\"ucerscdntnevfi\",\"jmygtdsslswtmwer\",\"ofz\",\"yqsemwa\"]}},{\"etherTypes\":[\"tshhszhedp\"],\"fragments\":[\"iwubmwmbesldnk\",\"wtppjflcxogaoko\"],\"ipLengths\":[\"nsikvmkqzeqqkdl\"],\"ttlValues\":[\"xmhhvhgureo\",\"kwobdagxtibq\",\"xbxwa\"],\"dscpMarkings\":[\"gqxndlkzgxhuripl\",\"podxunkb\",\"bxmubyynt\",\"lrb\"],\"portCondition\":{\"flags\":[\"ievseotgqrllt\",\"u\",\"lauwzizxbmpgcjef\",\"zmuvpbttdumorppx\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"tbhjpglkfgohdneu\",\"lfphsdyhtozfikd\",\"wwquuvxzxclvithh\",\"zonosgg\"],\"portGroupNames\":[\"ohfwds\"]},\"protocolTypes\":[\"aljutiiswac\"],\"vlanMatchCondition\":{\"vlans\":[\"k\",\"zewk\",\"vhqcrail\",\"pnppfuf\"],\"innerVlans\":[\"dmhdlxyjr\",\"sag\",\"fcnihgwq\"],\"vlanGroupNames\":[\"edgfbcvkcvq\",\"pkeqdcvdrhvoo\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"dopcjwvnh\",\"ld\",\"mgxcxrslpm\"],\"ipGroupNames\":[\"uoegrpkhjwniyqs\",\"uicpd\"]}}],\"actions\":[{\"type\":\"Log\",\"counterName\":\"vmbmp\"},{\"type\":\"Count\",\"counterName\":\"dfvue\"},{\"type\":\"Drop\",\"counterName\":\"bpfvm\"},{\"type\":\"Count\",\"counterName\":\"fouyf\"}]},{\"matchConfigurationName\":\"akcp\",\"sequenceNumber\":5193511789367343765,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"etherTypes\":[\"bexkpzksmondj\"],\"fragments\":[\"xvy\",\"omgkopkwho\",\"v\",\"ajqgxy\"],\"ipLengths\":[\"cmbqfqvmk\",\"xozap\",\"helxprglya\",\"dd\"],\"ttlValues\":[\"bcuejrjxgci\",\"ibrhosxsdqr\",\"zoymibmrqyibahw\",\"luszdtmhrkwof\"],\"dscpMarkings\":[\"oqac\",\"iexpbtgiwbwo\",\"nwashrtd\"],\"portCondition\":{\"flags\":[\"qxwbpokulpiu\",\"waasip\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"uqerpqlpqwc\"],\"portGroupNames\":[\"qgbdbuta\",\"vfbtkuwh\",\"mhykojoxafnndl\",\"ichkoymkcdyhb\"]},\"protocolTypes\":[\"pwdreqnovvqf\"],\"vlanMatchCondition\":{\"vlans\":[\"xywsuws\",\"rsndsytgadgvra\"],\"innerVlans\":[\"neqn\"],\"vlanGroupNames\":[\"rwlqu\",\"ijfqkacewiipfp\",\"bjibwwiftohq\",\"vpuvks\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"n\"],\"ipGroupNames\":[\"n\"]}},{\"etherTypes\":[\"huopxodlqiynto\"],\"fragments\":[\"hleosjsw\",\"rmslyzrpzbchckqq\"],\"ipLengths\":[\"ox\",\"ysuiizynkedya\",\"rwyhqmibzyhwitsm\"],\"ttlValues\":[\"ynpcdpumnzgmwznm\",\"biknsorgjhxbld\",\"lwwrl\",\"dmtnc\"],\"dscpMarkings\":[\"otllxdyhgsyo\"],\"portCondition\":{\"flags\":[\"ltdtbnnhad\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"cikhnv\",\"amqgxqquezikyw\",\"gxk\",\"lla\"],\"portGroupNames\":[\"lwuip\",\"ccjzkzivgvv\"]},\"protocolTypes\":[\"y\",\"hyrnxxmu\"],\"vlanMatchCondition\":{\"vlans\":[\"drd\",\"stkwqqtch\",\"alm\"],\"innerVlans\":[\"d\",\"aygdvwvgpioh\",\"wxrt\"],\"vlanGroupNames\":[\"xepxgyqagvrvmn\",\"k\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"lxgwimfnjhf\",\"xw\"],\"ipGroupNames\":[\"kkfoqr\"]}},{\"etherTypes\":[\"kzikfjawneaivxwc\",\"elpcirelsfeaenwa\"],\"fragments\":[\"tkl\",\"dxbjhwuaanozj\",\"sphyoulpjrvxa\",\"l\"],\"ipLengths\":[\"mjwosytx\",\"tcs\"],\"ttlValues\":[\"k\",\"qumiek\",\"ez\",\"ikh\"],\"dscpMarkings\":[\"jhdgqggebdunyga\",\"qidbqfatpxllrxcy\"],\"portCondition\":{\"flags\":[\"dsuvarmywdmjsjqb\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"rw\",\"yc\"],\"portGroupNames\":[\"hp\",\"xkgymareqnajxqu\",\"jhkycub\"]},\"protocolTypes\":[\"gssofwq\",\"zqalkrmnjijpx\",\"cqqudf\",\"byxbaaabjy\"],\"vlanMatchCondition\":{\"vlans\":[\"fimrzrtuzqogse\",\"nevfdnw\",\"wmewzsyy\",\"euzsoi\"],\"innerVlans\":[\"dpfrxtrthzvaytdw\"],\"vlanGroupNames\":[\"rqubpaxhexiil\",\"vpdtiirqtdqoa\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"quyfx\",\"xxle\",\"tramxjez\"],\"ipGroupNames\":[\"nwxuqlcvydyp\",\"tdooaoj\",\"niodkooeb\"]}},{\"etherTypes\":[\"jhemms\",\"vdkcrodtj\",\"nfwjlfltkacjvefk\",\"lfoakg\"],\"fragments\":[\"pagao\",\"pulpqblylsyxk\",\"jnsjervtiagxsd\"],\"ipLengths\":[\"e\"],\"ttlValues\":[\"bzkfzbeyvpn\",\"icvi\"],\"dscpMarkings\":[\"jjxd\"],\"portCondition\":{\"flags\":[\"ukzclewyhmlwpaz\",\"zpof\",\"cckwyfzqwhxxbu\",\"qa\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"tpp\",\"iolxor\",\"altol\",\"ncwsob\"],\"portGroupNames\":[\"sdbnwdcfhucqdpf\",\"vglsbjjca\",\"vxb\"]},\"protocolTypes\":[\"udutnco\",\"mr\",\"xqtvcofu\"],\"vlanMatchCondition\":{\"vlans\":[\"kgjubgdknnqvsazn\"],\"innerVlans\":[\"orudsgsa\"],\"vlanGroupNames\":[\"yc\",\"rauwjuetaebu\",\"u\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"l\",\"wabm\",\"oefki\",\"rvtp\"],\"ipGroupNames\":[\"jmqlgkfb\",\"ndo\",\"ongbjcnt\",\"jitcjedftwwaez\"]}}],\"actions\":[{\"type\":\"Log\",\"counterName\":\"pzfoqoui\"},{\"type\":\"Drop\",\"counterName\":\"arz\"},{\"type\":\"Log\",\"counterName\":\"foxciq\"},{\"type\":\"Drop\",\"counterName\":\"oamciodh\"}]},{\"matchConfigurationName\":\"azxkhnzbonlwnto\",\"sequenceNumber\":5469965944483736213,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"etherTypes\":[\"szzcmrvexztv\",\"t\",\"gsfraoyzkoow\",\"lmnguxaw\"],\"fragments\":[\"dsyuuximerqfob\",\"yznkby\",\"utwpfhp\",\"gmhrskdsnfdsdoak\"],\"ipLengths\":[\"lmkk\",\"evdlh\",\"wpusdsttwvogv\"],\"ttlValues\":[\"jdcngqqm\",\"akufgmjz\",\"wr\",\"grtwae\"],\"dscpMarkings\":[\"zkopb\",\"inrfdwoyu\",\"hziuiefozbhdms\"],\"portCondition\":{\"flags\":[\"qhoftrmaequiah\",\"icslfaoq\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"halns\",\"hc\"],\"portGroupNames\":[\"hka\"]},\"protocolTypes\":[\"itqscywuggwoluhc\",\"bwemhairs\",\"rgzdwmsweyp\",\"w\"],\"vlanMatchCondition\":{\"vlans\":[\"icccn\",\"qhuexm\",\"ttlstvlzywemhz\"],\"innerVlans\":[\"sdtclusiypbs\",\"gytguslfead\",\"ygqukyhejh\",\"isxgfp\"],\"vlanGroupNames\":[\"lppvksrpq\",\"ujzra\",\"htwdwrftswibyrcd\",\"bhshfwpracstwity\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"dcpnmdyodnw\",\"xltjcvnhltiu\",\"cxnavv\",\"xqi\"],\"ipGroupNames\":[\"unyowxwl\",\"djrkvfgbvfvpd\",\"odacizs\",\"q\"]}},{\"etherTypes\":[\"rribd\",\"ibqipqkg\",\"vxndz\"],\"fragments\":[\"refajpjorwkqnyh\",\"b\",\"j\"],\"ipLengths\":[\"vfxzsjab\",\"bsystawfsdjpvk\",\"p\",\"jxbkzbzkdvn\"],\"ttlValues\":[\"budurgkakmo\",\"zhjjklffhmouwq\"],\"dscpMarkings\":[\"rfzeey\",\"bizikayuhq\"],\"portCondition\":{\"flags\":[\"sybbqwr\"],\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"fp\",\"vm\"],\"portGroupNames\":[\"as\",\"thaqfxssmwu\",\"wbdsr\",\"zpdrhneu\"]},\"protocolTypes\":[\"q\",\"d\",\"ytisibir\"],\"vlanMatchCondition\":{\"vlans\":[\"kpzi\",\"ejzanlfz\",\"iavrm\"],\"innerVlans\":[\"nokixrjqcirgz\"],\"vlanGroupNames\":[\"lazszrn\",\"oiindfpwpjy\",\"wbtlhflsjcdh\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"ofel\",\"a\"],\"ipGroupNames\":[\"mqhldvrii\",\"ojnal\",\"hfkvtvsexsowuel\"]}},{\"etherTypes\":[\"hahhxvrhmzkwpj\",\"wws\",\"ughftqsx\",\"qxujxukndxd\"],\"fragments\":[\"jguufzdm\",\"yqtfihwh\",\"otzi\",\"gamv\"],\"ipLengths\":[\"o\"],\"ttlValues\":[\"zudphqamvdkfw\",\"nwcvtbvkayhmtnv\"],\"dscpMarkings\":[\"atkzwpcnpw\",\"cjaesgvvs\",\"cyajguqf\"],\"portCondition\":{\"flags\":[\"zlvdnkfxusemdw\",\"rmuhapfcq\",\"psqxq\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"ymgc\",\"elvezrypq\",\"mfe\"],\"portGroupNames\":[\"rqwky\",\"kobopgxed\",\"owepbqpcrfkb\",\"ccsnjvcdwxlpq\"]},\"protocolTypes\":[\"tn\",\"htjsying\"],\"vlanMatchCondition\":{\"vlans\":[\"tmtdhtmdvypgik\",\"gszywk\",\"irryuzhlh\"],\"innerVlans\":[\"qrvqq\",\"atjinrvgoupmfiib\",\"ggjioolvr\"],\"vlanGroupNames\":[\"v\",\"kkgll\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"yvblmhvkzu\",\"bxvvyhg\",\"opbyrqufegxu\",\"wz\"],\"ipGroupNames\":[\"hlmctlpdngitvgb\",\"hrixkwmy\",\"jejveg\"]}},{\"etherTypes\":[\"pna\",\"xexccbdreaxhcexd\",\"rvqahqkghtpwi\",\"nhyjsv\"],\"fragments\":[\"xzb\",\"voowvr\",\"mtg\"],\"ipLengths\":[\"pyostronzmyhgfi\",\"nsxkmcwaekrrjr\",\"afxtsgum\",\"jglikkxwslolb\"],\"ttlValues\":[\"uzlm\",\"felfktg\"],\"dscpMarkings\":[\"rpw\"],\"portCondition\":{\"flags\":[\"noigbrnjwmwk\",\"nbsazejjoqkag\"],\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"augzxnfaazpxdtn\",\"dm\",\"qjjlwuen\"],\"portGroupNames\":[\"pyouaibrebqaays\",\"kixqtnqtt\",\"zlwfffiakp\",\"pqqmted\"]},\"protocolTypes\":[\"mjihyeozphv\"],\"vlanMatchCondition\":{\"vlans\":[\"qncygupkvi\"],\"innerVlans\":[\"scw\",\"qupevzh\",\"stotxh\",\"jujbypelmcuvhixb\"],\"vlanGroupNames\":[\"fw\",\"yl\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"p\",\"iwkkbn\",\"jrywvtylbfpnc\",\"rd\"],\"ipGroupNames\":[\"iithtywu\",\"xcbihw\",\"knfd\"]}}],\"actions\":[{\"type\":\"Log\",\"counterName\":\"rdgoihxumw\"},{\"type\":\"Drop\",\"counterName\":\"dzjlu\"}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{\"name\":\"gg\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"tov\",\"tgseinqfiufxqkn\",\"irgne\"]}],\"vlanGroups\":[{\"name\":\"qmsniffcdmqnro\",\"vlans\":[\"ijnkrxfrdd\"]},{\"name\":\"ratiz\",\"vlans\":[\"nasx\",\"ft\",\"zq\"]},{\"name\":\"hftwesgog\",\"vlans\":[\"onnxkrlgnyhm\",\"ssxkkgthr\",\"gh\",\"jbdhqxvc\"]},{\"name\":\"frpdsofbshrns\",\"vlans\":[\"swdvzyybycnun\",\"jsrtk\"]}],\"portGroups\":[{\"name\":\"opqgikyzirtxdyux\",\"ports\":[\"ntps\",\"wgioilqukry\",\"xtqmieoxor\",\"gufhyaomtbg\"]},{\"name\":\"avgrvkffovjz\",\"ports\":[\"bibgjmfxumv\",\"cluyovwxnbkf\"]},{\"name\":\"zxscyhwzdgirujb\",\"ports\":[\"mvzzbtdcqvp\",\"iyujviylwdshfs\"]},{\"name\":\"rbgyefry\",\"ports\":[\"aojfm\",\"nc\"]}]},{\"ipGroups\":[{\"name\":\"fhir\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"xoftpipiwyczu\",\"xacpqjli\",\"hyus\",\"skasdvlmfwdgzxu\"]},{\"name\":\"cvpa\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"uzvx\",\"risjnhnytxifqjz\"]},{\"name\":\"mrhublwpc\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"gjup\",\"uutpwoqhih\",\"jqgwzp\"]}],\"vlanGroups\":[{\"name\":\"tcypsxjvfoim\",\"vlans\":[\"lirc\",\"zjxvydfcea\"]},{\"name\":\"lhvygdyftu\",\"vlans\":[\"wnawjslbiw\",\"ojgcyzt\",\"fmznba\",\"qphchqnrnrpxehuw\"]},{\"name\":\"k\",\"vlans\":[\"ifmviklbydvk\",\"bejdznxcv\"]},{\"name\":\"rhnj\",\"vlans\":[\"lvtno\",\"qfzgemjdftul\",\"ltducea\"]}],\"portGroups\":[{\"name\":\"zuo\",\"ports\":[\"wcw\"]},{\"name\":\"ioknssxmoj\",\"ports\":[\"p\",\"jpr\"]}]}],\"annotation\":\"wcfzqljyxgt\"}") - .toObject(AccessControlListProperties.class); - Assertions.assertEquals("wcfzqljyxgt", model.annotation()); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("onowk", model.aclsUrl()); - Assertions.assertEquals("ankixzbinjeput", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(4034395875426050930L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals( - "xepcyvahfn", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "ghkjeszzhbi", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "xfvgxbfsmxne", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "mpukgriw", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.SOURCE_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.LONGEST_PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "uqqkpik", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "rbu", model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions - .assertEquals( - "ftiyqzrnkcq", model.matchConfigurations().get(0).matchConditions().get(0).etherTypes().get(0)); - Assertions - .assertEquals("zlsico", model.matchConfigurations().get(0).matchConditions().get(0).fragments().get(0)); - Assertions - .assertEquals("qnwvlrya", model.matchConfigurations().get(0).matchConditions().get(0).ipLengths().get(0)); - Assertions.assertEquals("heun", model.matchConfigurations().get(0).matchConditions().get(0).ttlValues().get(0)); - Assertions - .assertEquals("fkbey", model.matchConfigurations().get(0).matchConditions().get(0).dscpMarkings().get(0)); - Assertions - .assertEquals( - PortType.DESTINATION_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.UDP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "kaet", model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "qhjfbebr", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions - .assertEquals( - "mjmwvvjektcx", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().flags().get(0)); - Assertions.assertEquals(AclActionType.COUNT, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("j", model.matchConfigurations().get(0).actions().get(0).counterName()); - Assertions.assertEquals("gg", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV4, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions.assertEquals("tov", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("qmsniffcdmqnro", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("ijnkrxfrdd", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions - .assertEquals("opqgikyzirtxdyux", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("ntps", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessControlListProperties model = - new AccessControlListProperties() - .withAnnotation("wcfzqljyxgt") - .withConfigurationType(ConfigurationType.FILE) - .withAclsUrl("onowk") - .withMatchConfigurations( - Arrays - .asList( - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("ankixzbinjeput") - .withSequenceNumber(4034395875426050930L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes( - Arrays.asList("xepcyvahfn", "jky", "xjvuujqgidokg", "ljyoxgvcltb")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("ghkjeszzhbi")) - .withInnerVlans(Arrays.asList("xfvgxbfsmxne", "mpvecxgodebfqk")) - .withVlanGroupNames( - Arrays.asList("mpukgriw", "lzlfbxzpuz", "cispnqzahmgkbr"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("uqqkpik", "drgvtqagn", "uynhijg", "mebf")) - .withIpGroupNames(Arrays.asList("rbu"))) - .withEtherTypes(Arrays.asList("ftiyqzrnkcq", "yx")) - .withFragments(Arrays.asList("zlsico")) - .withIpLengths(Arrays.asList("qnwvlrya")) - .withTtlValues(Arrays.asList("heun", "mqhgyxzkonocuk", "klyaxuconu")) - .withDscpMarkings(Arrays.asList("fkbey")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("kaet", "kt", "fcivfsnkym")) - .withPortGroupNames( - Arrays.asList("qhjfbebr", "cxerf", "wutttxfvjrbi")) - .withFlags( - Arrays.asList("mjmwvvjektcx", "enhwlrs", "frzpwvlqdqgb"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("zbhvgyuguosv", "kfssxqukkf", "l")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "xnkjzkdesl", - "vlopwiyighx", - "kdwzbaiuebbaumny", - "upedeojnabckhs")) - .withInnerVlans( - Arrays - .asList( - "psiebtfhvpes", - "pskrdqmh", - "jdhtldwkyzxu", - "tkncwsc")) - .withVlanGroupNames( - Arrays - .asList( - "lxotogtwrupq", "xvnmicykvceov", "ilovnot", "fj"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("x", "hbttkphyw")) - .withIpGroupNames( - Arrays - .asList("jtoqne", "mclfplphoxuscr", "abgy", "psbjta"))) - .withEtherTypes( - Arrays.asList("vpnazzm", "jrunmpxtt", "bh", "bnlankxmyskpb")) - .withFragments( - Arrays - .asList("btkcxywnytnrsyn", "qidybyx", "zfcl", "aaxdbabphlwrq")) - .withIpLengths( - Arrays - .asList("tsthsucocm", "yyazttbt", "wrqpue", "ckzywbiexzfeyue")) - .withTtlValues(Arrays.asList("bxu")) - .withDscpMarkings( - Arrays.asList("hqwa", "muzyoxaepdk", "jancu", "rhdwbavxbniw")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("xytxhpzxbz", "fzab")) - .withPortGroupNames(Arrays.asList("uhxwtctyqiklbbov")) - .withFlags(Arrays.asList("zt"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("wwfvov", "vmeueci", "yhz")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "jgjrwjueiotwm", "dytdxwitx", "rjaw", "qwgxhniskx")) - .withInnerVlans( - Arrays.asList("py", "gklwn", "nhjdauw", "vylwzbtdhxuj")) - .withVlanGroupNames(Arrays.asList("mpowuwpr"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("upjm")) - .withIpGroupNames( - Arrays.asList("xobbcswsrt", "riplrbpbewtg", "fgb"))) - .withEtherTypes(Arrays.asList("gxywpmue", "fjz", "fqkquj")) - .withFragments( - Arrays - .asList( - "uyonobglaoc", "xtccmg", "udxytlmoyrx", "wfudwpzntxhdzhl")) - .withIpLengths(Arrays.asList("bh", "kfrlhrxsbky", "pycanuzbpz")) - .withTtlValues( - Arrays.asList("kuwbcrnwb", "ehhseyvjusrts", "hspkdeemao", "mx")) - .withDscpMarkings(Arrays.asList("vt")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays.asList("lf", "isgwbnbbeldawkz", "ali", "urqhaka")) - .withPortGroupNames( - Arrays.asList("shsfwxosowzxcu", "i", "jooxdjebw")) - .withFlags( - Arrays - .asList( - "qkrhahvljua", - "aquhcdhm", - "ualaexqpvfadmw", - "rcrgvx"))), - new AccessControlListMatchCondition() - .withProtocolTypes( - Arrays - .asList("pnapnyiropuh", "igvpgylg", "git", "medjvcslynqwwncw")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("gktrmgucnapkte")) - .withInnerVlans(Arrays.asList("lwptfdy", "pfqbuaceopzf")) - .withVlanGroupNames(Arrays.asList("huaoppp", "qeqxo"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("t", "bgbkdmoizpost")) - .withIpGroupNames(Arrays.asList("cfbu", "rmfqjhhkxbpvj"))) - .withEtherTypes(Arrays.asList("wxzvlvqhjkb")) - .withFragments(Arrays.asList("btn", "xiebwwaloayqcg", "rtzju", "gwyzm")) - .withIpLengths( - Arrays - .asList( - "ongmtsa", - "jcbpwxqpsrknft", - "uvriuhprwm", - "yvxqtayriwwroy")) - .withTtlValues( - Arrays - .asList( - "xrmcqibycnojvk", - "mefqsgzvahapjyzh", - "vgqzcjrvxd", - "zlmwlxkvugfhz")) - .withDscpMarkings(Arrays.asList("wjvzunluthnn", "rnxipei", "pjzu", "e")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays - .asList( - "touwaboekqv", - "elnsmvbxw", - "jsflhhcaalnjix", - "sxyawjoyaqcs")) - .withPortGroupNames( - Arrays - .asList( - "pkii", "zyexzn", "lixhnrztfol", "bnxknalaulppg")) - .withFlags( - Arrays - .asList("ltskzbbtd", "umveekgpwozuhkf", "bsjyofdx"))))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("j"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("divkrt"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("bxqz") - .withSequenceNumber(2872622925140692526L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("indoygmifthnzd")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("gnayqigynduh")) - .withInnerVlans( - Arrays.asList("qlkth", "maqolbgycduie", "tgccymvaolpss")) - .withVlanGroupNames( - Arrays - .asList( - "fmmdnbbg", "zpswiydmc", "yhz", "xssadbzmnvdf"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("xzb", "cblylpstdbhhxsr")) - .withIpGroupNames( - Arrays - .asList( - "ucerscdntnevfi", - "jmygtdsslswtmwer", - "ofz", - "yqsemwa"))) - .withEtherTypes(Arrays.asList("dxxiv", "tvtc", "aqtdoqmcbx", "wvxysl")) - .withFragments(Arrays.asList("sfxobl", "tkblmpewww", "bkrvrnsvshqj")) - .withIpLengths(Arrays.asList("crsbfovasr")) - .withTtlValues(Arrays.asList("wbhsqfsub")) - .withDscpMarkings(Arrays.asList("birx")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays - .asList( - "bexilzznfqqnv", - "pmqtaru", - "ujmkcjhwqy", - "jrybnwjewgdrjer")) - .withPortGroupNames(Arrays.asList("enq")) - .withFlags(Arrays.asList("srfbjfdtwss", "t"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("aljutiiswac")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("k", "zewk", "vhqcrail", "pnppfuf")) - .withInnerVlans(Arrays.asList("dmhdlxyjr", "sag", "fcnihgwq")) - .withVlanGroupNames( - Arrays.asList("edgfbcvkcvq", "pkeqdcvdrhvoo"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("dopcjwvnh", "ld", "mgxcxrslpm")) - .withIpGroupNames(Arrays.asList("uoegrpkhjwniyqs", "uicpd"))) - .withEtherTypes(Arrays.asList("tshhszhedp")) - .withFragments(Arrays.asList("iwubmwmbesldnk", "wtppjflcxogaoko")) - .withIpLengths(Arrays.asList("nsikvmkqzeqqkdl")) - .withTtlValues(Arrays.asList("xmhhvhgureo", "kwobdagxtibq", "xbxwa")) - .withDscpMarkings( - Arrays.asList("gqxndlkzgxhuripl", "podxunkb", "bxmubyynt", "lrb")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays - .asList( - "tbhjpglkfgohdneu", - "lfphsdyhtozfikd", - "wwquuvxzxclvithh", - "zonosgg")) - .withPortGroupNames(Arrays.asList("ohfwds")) - .withFlags( - Arrays - .asList( - "ievseotgqrllt", - "u", - "lauwzizxbmpgcjef", - "zmuvpbttdumorppx"))))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("vmbmp"), - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("dfvue"), - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("bpfvm"), - new AccessControlListAction() - .withType(AclActionType.COUNT) - .withCounterName("fouyf"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("akcp") - .withSequenceNumber(5193511789367343765L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("pwdreqnovvqf")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("xywsuws", "rsndsytgadgvra")) - .withInnerVlans(Arrays.asList("neqn")) - .withVlanGroupNames( - Arrays - .asList( - "rwlqu", - "ijfqkacewiipfp", - "bjibwwiftohq", - "vpuvks"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("n")) - .withIpGroupNames(Arrays.asList("n"))) - .withEtherTypes(Arrays.asList("bexkpzksmondj")) - .withFragments(Arrays.asList("xvy", "omgkopkwho", "v", "ajqgxy")) - .withIpLengths(Arrays.asList("cmbqfqvmk", "xozap", "helxprglya", "dd")) - .withTtlValues( - Arrays - .asList( - "bcuejrjxgci", - "ibrhosxsdqr", - "zoymibmrqyibahw", - "luszdtmhrkwof")) - .withDscpMarkings(Arrays.asList("oqac", "iexpbtgiwbwo", "nwashrtd")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("uqerpqlpqwc")) - .withPortGroupNames( - Arrays - .asList( - "qgbdbuta", - "vfbtkuwh", - "mhykojoxafnndl", - "ichkoymkcdyhb")) - .withFlags(Arrays.asList("qxwbpokulpiu", "waasip"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("y", "hyrnxxmu")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("drd", "stkwqqtch", "alm")) - .withInnerVlans(Arrays.asList("d", "aygdvwvgpioh", "wxrt")) - .withVlanGroupNames(Arrays.asList("xepxgyqagvrvmn", "k"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("lxgwimfnjhf", "xw")) - .withIpGroupNames(Arrays.asList("kkfoqr"))) - .withEtherTypes(Arrays.asList("huopxodlqiynto")) - .withFragments(Arrays.asList("hleosjsw", "rmslyzrpzbchckqq")) - .withIpLengths(Arrays.asList("ox", "ysuiizynkedya", "rwyhqmibzyhwitsm")) - .withTtlValues( - Arrays - .asList("ynpcdpumnzgmwznm", "biknsorgjhxbld", "lwwrl", "dmtnc")) - .withDscpMarkings(Arrays.asList("otllxdyhgsyo")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts( - Arrays.asList("cikhnv", "amqgxqquezikyw", "gxk", "lla")) - .withPortGroupNames(Arrays.asList("lwuip", "ccjzkzivgvv")) - .withFlags(Arrays.asList("ltdtbnnhad"))), - new AccessControlListMatchCondition() - .withProtocolTypes( - Arrays.asList("gssofwq", "zqalkrmnjijpx", "cqqudf", "byxbaaabjy")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "fimrzrtuzqogse", "nevfdnw", "wmewzsyy", "euzsoi")) - .withInnerVlans(Arrays.asList("dpfrxtrthzvaytdw")) - .withVlanGroupNames( - Arrays.asList("rqubpaxhexiil", "vpdtiirqtdqoa"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("quyfx", "xxle", "tramxjez")) - .withIpGroupNames( - Arrays.asList("nwxuqlcvydyp", "tdooaoj", "niodkooeb"))) - .withEtherTypes(Arrays.asList("kzikfjawneaivxwc", "elpcirelsfeaenwa")) - .withFragments( - Arrays.asList("tkl", "dxbjhwuaanozj", "sphyoulpjrvxa", "l")) - .withIpLengths(Arrays.asList("mjwosytx", "tcs")) - .withTtlValues(Arrays.asList("k", "qumiek", "ez", "ikh")) - .withDscpMarkings(Arrays.asList("jhdgqggebdunyga", "qidbqfatpxllrxcy")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("rw", "yc")) - .withPortGroupNames( - Arrays.asList("hp", "xkgymareqnajxqu", "jhkycub")) - .withFlags(Arrays.asList("dsuvarmywdmjsjqb"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("udutnco", "mr", "xqtvcofu")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("kgjubgdknnqvsazn")) - .withInnerVlans(Arrays.asList("orudsgsa")) - .withVlanGroupNames(Arrays.asList("yc", "rauwjuetaebu", "u"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("l", "wabm", "oefki", "rvtp")) - .withIpGroupNames( - Arrays - .asList( - "jmqlgkfb", "ndo", "ongbjcnt", "jitcjedftwwaez"))) - .withEtherTypes( - Arrays.asList("jhemms", "vdkcrodtj", "nfwjlfltkacjvefk", "lfoakg")) - .withFragments( - Arrays.asList("pagao", "pulpqblylsyxk", "jnsjervtiagxsd")) - .withIpLengths(Arrays.asList("e")) - .withTtlValues(Arrays.asList("bzkfzbeyvpn", "icvi")) - .withDscpMarkings(Arrays.asList("jjxd")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("tpp", "iolxor", "altol", "ncwsob")) - .withPortGroupNames( - Arrays.asList("sdbnwdcfhucqdpf", "vglsbjjca", "vxb")) - .withFlags( - Arrays - .asList( - "ukzclewyhmlwpaz", - "zpof", - "cckwyfzqwhxxbu", - "qa"))))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("pzfoqoui"), - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("arz"), - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("foxciq"), - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("oamciodh"))), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("azxkhnzbonlwnto") - .withSequenceNumber(5469965944483736213L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition() - .withProtocolTypes( - Arrays.asList("itqscywuggwoluhc", "bwemhairs", "rgzdwmsweyp", "w")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("icccn", "qhuexm", "ttlstvlzywemhz")) - .withInnerVlans( - Arrays - .asList( - "sdtclusiypbs", - "gytguslfead", - "ygqukyhejh", - "isxgfp")) - .withVlanGroupNames( - Arrays - .asList( - "lppvksrpq", - "ujzra", - "htwdwrftswibyrcd", - "bhshfwpracstwity"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays - .asList("dcpnmdyodnw", "xltjcvnhltiu", "cxnavv", "xqi")) - .withIpGroupNames( - Arrays.asList("unyowxwl", "djrkvfgbvfvpd", "odacizs", "q"))) - .withEtherTypes( - Arrays.asList("szzcmrvexztv", "t", "gsfraoyzkoow", "lmnguxaw")) - .withFragments( - Arrays - .asList( - "dsyuuximerqfob", "yznkby", "utwpfhp", "gmhrskdsnfdsdoak")) - .withIpLengths(Arrays.asList("lmkk", "evdlh", "wpusdsttwvogv")) - .withTtlValues(Arrays.asList("jdcngqqm", "akufgmjz", "wr", "grtwae")) - .withDscpMarkings(Arrays.asList("zkopb", "inrfdwoyu", "hziuiefozbhdms")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("halns", "hc")) - .withPortGroupNames(Arrays.asList("hka")) - .withFlags(Arrays.asList("qhoftrmaequiah", "icslfaoq"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("q", "d", "ytisibir")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("kpzi", "ejzanlfz", "iavrm")) - .withInnerVlans(Arrays.asList("nokixrjqcirgz")) - .withVlanGroupNames( - Arrays.asList("lazszrn", "oiindfpwpjy", "wbtlhflsjcdh"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("ofel", "a")) - .withIpGroupNames( - Arrays.asList("mqhldvrii", "ojnal", "hfkvtvsexsowuel"))) - .withEtherTypes(Arrays.asList("rribd", "ibqipqkg", "vxndz")) - .withFragments(Arrays.asList("refajpjorwkqnyh", "b", "j")) - .withIpLengths( - Arrays.asList("vfxzsjab", "bsystawfsdjpvk", "p", "jxbkzbzkdvn")) - .withTtlValues(Arrays.asList("budurgkakmo", "zhjjklffhmouwq")) - .withDscpMarkings(Arrays.asList("rfzeey", "bizikayuhq")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("fp", "vm")) - .withPortGroupNames( - Arrays.asList("as", "thaqfxssmwu", "wbdsr", "zpdrhneu")) - .withFlags(Arrays.asList("sybbqwr"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("tn", "htjsying")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays.asList("tmtdhtmdvypgik", "gszywk", "irryuzhlh")) - .withInnerVlans( - Arrays.asList("qrvqq", "atjinrvgoupmfiib", "ggjioolvr")) - .withVlanGroupNames(Arrays.asList("v", "kkgll"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays - .asList("yvblmhvkzu", "bxvvyhg", "opbyrqufegxu", "wz")) - .withIpGroupNames( - Arrays.asList("hlmctlpdngitvgb", "hrixkwmy", "jejveg"))) - .withEtherTypes( - Arrays.asList("hahhxvrhmzkwpj", "wws", "ughftqsx", "qxujxukndxd")) - .withFragments(Arrays.asList("jguufzdm", "yqtfihwh", "otzi", "gamv")) - .withIpLengths(Arrays.asList("o")) - .withTtlValues(Arrays.asList("zudphqamvdkfw", "nwcvtbvkayhmtnv")) - .withDscpMarkings(Arrays.asList("atkzwpcnpw", "cjaesgvvs", "cyajguqf")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("ymgc", "elvezrypq", "mfe")) - .withPortGroupNames( - Arrays - .asList( - "rqwky", - "kobopgxed", - "owepbqpcrfkb", - "ccsnjvcdwxlpq")) - .withFlags( - Arrays.asList("zlvdnkfxusemdw", "rmuhapfcq", "psqxq"))), - new AccessControlListMatchCondition() - .withProtocolTypes(Arrays.asList("mjihyeozphv")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("qncygupkvi")) - .withInnerVlans( - Arrays - .asList("scw", "qupevzh", "stotxh", "jujbypelmcuvhixb")) - .withVlanGroupNames(Arrays.asList("fw", "yl"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays.asList("p", "iwkkbn", "jrywvtylbfpnc", "rd")) - .withIpGroupNames(Arrays.asList("iithtywu", "xcbihw", "knfd"))) - .withEtherTypes( - Arrays.asList("pna", "xexccbdreaxhcexd", "rvqahqkghtpwi", "nhyjsv")) - .withFragments(Arrays.asList("xzb", "voowvr", "mtg")) - .withIpLengths( - Arrays - .asList( - "pyostronzmyhgfi", - "nsxkmcwaekrrjr", - "afxtsgum", - "jglikkxwslolb")) - .withTtlValues(Arrays.asList("uzlm", "felfktg")) - .withDscpMarkings(Arrays.asList("rpw")) - .withPortCondition( - new AccessControlListPortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("augzxnfaazpxdtn", "dm", "qjjlwuen")) - .withPortGroupNames( - Arrays - .asList( - "pyouaibrebqaays", - "kixqtnqtt", - "zlwfffiakp", - "pqqmted")) - .withFlags(Arrays.asList("noigbrnjwmwk", "nbsazejjoqkag"))))) - .withActions( - Arrays - .asList( - new AccessControlListAction() - .withType(AclActionType.LOG) - .withCounterName("rdgoihxumw"), - new AccessControlListAction() - .withType(AclActionType.DROP) - .withCounterName("dzjlu"))))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("gg") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("tov", "tgseinqfiufxqkn", "irgne")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("qmsniffcdmqnro") - .withVlans(Arrays.asList("ijnkrxfrdd")), - new VlanGroupProperties() - .withName("ratiz") - .withVlans(Arrays.asList("nasx", "ft", "zq")), - new VlanGroupProperties() - .withName("hftwesgog") - .withVlans( - Arrays.asList("onnxkrlgnyhm", "ssxkkgthr", "gh", "jbdhqxvc")), - new VlanGroupProperties() - .withName("frpdsofbshrns") - .withVlans(Arrays.asList("swdvzyybycnun", "jsrtk")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("opqgikyzirtxdyux") - .withPorts( - Arrays.asList("ntps", "wgioilqukry", "xtqmieoxor", "gufhyaomtbg")), - new PortGroupProperties() - .withName("avgrvkffovjz") - .withPorts(Arrays.asList("bibgjmfxumv", "cluyovwxnbkf")), - new PortGroupProperties() - .withName("zxscyhwzdgirujb") - .withPorts(Arrays.asList("mvzzbtdcqvp", "iyujviylwdshfs")), - new PortGroupProperties() - .withName("rbgyefry") - .withPorts(Arrays.asList("aojfm", "nc")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("fhir") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays - .asList( - "xoftpipiwyczu", "xacpqjli", "hyus", "skasdvlmfwdgzxu")), - new IpGroupProperties() - .withName("cvpa") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("uzvx", "risjnhnytxifqjz")), - new IpGroupProperties() - .withName("mrhublwpc") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("gjup", "uutpwoqhih", "jqgwzp")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("tcypsxjvfoim") - .withVlans(Arrays.asList("lirc", "zjxvydfcea")), - new VlanGroupProperties() - .withName("lhvygdyftu") - .withVlans( - Arrays - .asList("wnawjslbiw", "ojgcyzt", "fmznba", "qphchqnrnrpxehuw")), - new VlanGroupProperties() - .withName("k") - .withVlans(Arrays.asList("ifmviklbydvk", "bejdznxcv")), - new VlanGroupProperties() - .withName("rhnj") - .withVlans(Arrays.asList("lvtno", "qfzgemjdftul", "ltducea")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties().withName("zuo").withPorts(Arrays.asList("wcw")), - new PortGroupProperties() - .withName("ioknssxmoj") - .withPorts(Arrays.asList("p", "jpr")))))); - model = BinaryData.fromObject(model).toObject(AccessControlListProperties.class); - Assertions.assertEquals("wcfzqljyxgt", model.annotation()); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("onowk", model.aclsUrl()); - Assertions.assertEquals("ankixzbinjeput", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(4034395875426050930L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals( - "xepcyvahfn", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "ghkjeszzhbi", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "xfvgxbfsmxne", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "mpukgriw", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.SOURCE_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.LONGEST_PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "uqqkpik", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "rbu", model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions - .assertEquals( - "ftiyqzrnkcq", model.matchConfigurations().get(0).matchConditions().get(0).etherTypes().get(0)); - Assertions - .assertEquals("zlsico", model.matchConfigurations().get(0).matchConditions().get(0).fragments().get(0)); - Assertions - .assertEquals("qnwvlrya", model.matchConfigurations().get(0).matchConditions().get(0).ipLengths().get(0)); - Assertions.assertEquals("heun", model.matchConfigurations().get(0).matchConditions().get(0).ttlValues().get(0)); - Assertions - .assertEquals("fkbey", model.matchConfigurations().get(0).matchConditions().get(0).dscpMarkings().get(0)); - Assertions - .assertEquals( - PortType.DESTINATION_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.UDP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "kaet", model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "qhjfbebr", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions - .assertEquals( - "mjmwvvjektcx", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().flags().get(0)); - Assertions.assertEquals(AclActionType.COUNT, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("j", model.matchConfigurations().get(0).actions().get(0).counterName()); - Assertions.assertEquals("gg", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV4, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions.assertEquals("tov", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("qmsniffcdmqnro", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("ijnkrxfrdd", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions - .assertEquals("opqgikyzirtxdyux", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("ntps", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateMockTests.java deleted file mode 100644 index 870b62a5523f..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlList; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListAction; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -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 AccessControlListsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"lastSyncedTime\":\"2021-02-05T15:09:47Z\",\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"RMA\",\"configurationType\":\"File\",\"aclsUrl\":\"zwgdpvhwiril\",\"matchConfigurations\":[{\"matchConfigurationName\":\"rhqdoxd\",\"sequenceNumber\":4989762918343425516,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{}],\"actions\":[{},{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{},{},{}],\"vlanGroups\":[{},{},{},{}],\"portGroups\":[{},{}]}],\"annotation\":\"dpd\"},\"location\":\"er\",\"tags\":{\"ure\":\"dlirqqclsaqifep\",\"fpxeswctlfytb\":\"vivkiglioklsu\",\"ddfclmowu\":\"tytvnpbgces\"},\"id\":\"ofofkbcjz\",\"name\":\"wweoblbtdqz\",\"type\":\"ixccnkfsog\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AccessControlList response = - manager - .accessControlLists() - .define("dcyandblkb") - .withRegion("lhxsoanguhbnho") - .withExistingResourceGroup("zvvpaysqwh") - .withTags( - mapOf( - "zpxlitwkejmgemud", - "zreneggpdt", - "pezammpkapvnpeu", - "pehskvsdfvhr", - "svktfps", - "gnmfakeqnitroml")) - .withConfigurationType(ConfigurationType.FILE) - .withAclsUrl("ctfvxuos") - .withMatchConfigurations( - Arrays - .asList( - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("a") - .withSequenceNumber(7453371447000048334L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition(), - new AccessControlListMatchCondition())) - .withActions(Arrays.asList(new AccessControlListAction())))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups(Arrays.asList(new IpGroupProperties(), new IpGroupProperties())) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties())) - .withPortGroups(Arrays.asList(new PortGroupProperties())), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties(), new IpGroupProperties(), new IpGroupProperties())) - .withVlanGroups(Arrays.asList(new VlanGroupProperties(), new VlanGroupProperties())) - .withPortGroups(Arrays.asList(new PortGroupProperties(), new PortGroupProperties())))) - .withAnnotation("beqkittl") - .create(); - - Assertions.assertEquals("er", response.location()); - Assertions.assertEquals("dlirqqclsaqifep", response.tags().get("ure")); - Assertions.assertEquals(ConfigurationType.FILE, response.configurationType()); - Assertions.assertEquals("zwgdpvhwiril", response.aclsUrl()); - Assertions.assertEquals("rhqdoxd", response.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(4989762918343425516L, response.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, response.matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("dpd", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index efe33cb1f10b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlList; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -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 AccessControlListsGetByResourceGroupWithResponseMockTests { - @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\":{\"lastSyncedTime\":\"2021-09-23T22:30:34Z\",\"configurationState\":\"Failed\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"Disabled\",\"configurationType\":\"File\",\"aclsUrl\":\"uzscyfyi\",\"matchConfigurations\":[{\"matchConfigurationName\":\"asjnfgngxaojeeyv\",\"sequenceNumber\":4807900032809026267,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{},{},{},{}],\"actions\":[{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{},{},{}],\"vlanGroups\":[{},{},{},{}],\"portGroups\":[{},{}]},{\"ipGroups\":[{},{},{},{}],\"vlanGroups\":[{},{}],\"portGroups\":[{},{},{}]},{\"ipGroups\":[{},{},{}],\"vlanGroups\":[{}],\"portGroups\":[{},{},{},{}]}],\"annotation\":\"kjcdzuiygtcyzcje\"},\"location\":\"ubaldjcgldryvlr\",\"tags\":{\"jbfomfbozpjyxe\":\"hzirmxca\",\"jthp\":\"ppqcwdnn\"},\"id\":\"nxebycympohx\",\"name\":\"bnnpnsebcxnous\",\"type\":\"dyzssjlmykdygj\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AccessControlList response = - manager - .accessControlLists() - .getByResourceGroupWithResponse("tuqvirlun", "skydigtvjxsocsv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ubaldjcgldryvlr", response.location()); - Assertions.assertEquals("hzirmxca", response.tags().get("jbfomfbozpjyxe")); - Assertions.assertEquals(ConfigurationType.FILE, response.configurationType()); - Assertions.assertEquals("uzscyfyi", response.aclsUrl()); - Assertions.assertEquals("asjnfgngxaojeeyv", response.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(4807900032809026267L, response.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, response.matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("kjcdzuiygtcyzcje", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListByResourceGroupMockTests.java deleted file mode 100644 index c6c41be8991d..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlList; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -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 AccessControlListsListByResourceGroupMockTests { - @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\":{\"lastSyncedTime\":\"2021-11-30T00:20:31Z\",\"configurationState\":\"Failed\",\"provisioningState\":\"Failed\",\"administrativeState\":\"MAT\",\"configurationType\":\"File\",\"aclsUrl\":\"rgyoimmssz\",\"matchConfigurations\":[{\"matchConfigurationName\":\"vkognhtv\",\"sequenceNumber\":5591618762734770844,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{}],\"actions\":[{},{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{},{},{},{}],\"vlanGroups\":[{},{},{}],\"portGroups\":[{},{}]},{\"ipGroups\":[{},{},{}],\"vlanGroups\":[{},{},{},{}],\"portGroups\":[{},{},{}]},{\"ipGroups\":[{}],\"vlanGroups\":[{}],\"portGroups\":[{},{},{},{}]}],\"annotation\":\"rjlqdoqeje\"},\"location\":\"d\",\"tags\":{\"lpdyehj\":\"hdkubgywadr\"},\"id\":\"wc\",\"name\":\"lvxboc\",\"type\":\"yw\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.accessControlLists().listByResourceGroup("gspjlf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("d", response.iterator().next().location()); - Assertions.assertEquals("hdkubgywadr", response.iterator().next().tags().get("lpdyehj")); - Assertions.assertEquals(ConfigurationType.FILE, response.iterator().next().configurationType()); - Assertions.assertEquals("rgyoimmssz", response.iterator().next().aclsUrl()); - Assertions - .assertEquals("vkognhtv", response.iterator().next().matchConfigurations().get(0).matchConfigurationName()); - Assertions - .assertEquals( - 5591618762734770844L, response.iterator().next().matchConfigurations().get(0).sequenceNumber()); - Assertions - .assertEquals(IpAddressType.IPV6, response.iterator().next().matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("rjlqdoqeje", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListMockTests.java deleted file mode 100644 index 1c7c0d1e9ab6..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlList; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -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 AccessControlListsListMockTests { - @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\":{\"lastSyncedTime\":\"2021-07-17T20:34:59Z\",\"configurationState\":\"Provisioned\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"Enabled\",\"configurationType\":\"Inline\",\"aclsUrl\":\"olngsfmhwdxqupy\",\"matchConfigurations\":[{\"matchConfigurationName\":\"lmnjqzm\",\"sequenceNumber\":6179342709153587202,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{},{}],\"actions\":[{},{},{}]},{\"matchConfigurationName\":\"q\",\"sequenceNumber\":6471796079746395246,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{},{},{}],\"actions\":[{},{},{}]},{\"matchConfigurationName\":\"jo\",\"sequenceNumber\":3660511499393161300,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{},{}],\"actions\":[{},{},{},{}]},{\"matchConfigurationName\":\"qeiaddp\",\"sequenceNumber\":6395873061735067904,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{},{},{}],\"actions\":[{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{},{},{}],\"vlanGroups\":[{},{},{},{}],\"portGroups\":[{}]}],\"annotation\":\"nzbqvioynctfq\"},\"location\":\"vvwzprjaaaiaib\",\"tags\":{\"wmefzvzuz\":\"vlyaqtloc\",\"zgyhen\":\"crlkorv\",\"nozf\":\"sfyqncowm\",\"agwaakktbjort\":\"ywjiaaosla\"},\"id\":\"tkajqhsnsej\",\"name\":\"lislxyljzbkd\",\"type\":\"lfjwxgvtkjctv\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.accessControlLists().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vvwzprjaaaiaib", response.iterator().next().location()); - Assertions.assertEquals("vlyaqtloc", response.iterator().next().tags().get("wmefzvzuz")); - Assertions.assertEquals(ConfigurationType.INLINE, response.iterator().next().configurationType()); - Assertions.assertEquals("olngsfmhwdxqupy", response.iterator().next().aclsUrl()); - Assertions - .assertEquals("lmnjqzm", response.iterator().next().matchConfigurations().get(0).matchConfigurationName()); - Assertions - .assertEquals( - 6179342709153587202L, response.iterator().next().matchConfigurations().get(0).sequenceNumber()); - Assertions - .assertEquals(IpAddressType.IPV6, response.iterator().next().matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("nzbqvioynctfq", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListResultTests.java deleted file mode 100644 index 94e38dcb9990..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListResultTests.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListInner; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListAction; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListsListResult; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AccessControlListsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccessControlListsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"lastSyncedTime\":\"2021-08-20T21:04:40Z\",\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Failed\",\"administrativeState\":\"Enabled\",\"configurationType\":\"File\",\"aclsUrl\":\"aiancznvodr\",\"matchConfigurations\":[{\"matchConfigurationName\":\"lxydkxrxv\",\"sequenceNumber\":731559020622365295,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{},{}],\"actions\":[{},{},{},{}]},{\"matchConfigurationName\":\"jnqkhy\",\"sequenceNumber\":7281626165756330252,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{}],\"actions\":[{},{}]},{\"matchConfigurationName\":\"rqlrqffawe\",\"sequenceNumber\":49967768153129763,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{},{},{},{}],\"actions\":[{}]},{\"matchConfigurationName\":\"av\",\"sequenceNumber\":1106225492612051465,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{}],\"actions\":[{},{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{}],\"vlanGroups\":[{}],\"portGroups\":[{},{},{},{}]},{\"ipGroups\":[{},{}],\"vlanGroups\":[{}],\"portGroups\":[{},{},{},{}]},{\"ipGroups\":[{},{}],\"vlanGroups\":[{}],\"portGroups\":[{},{}]}],\"annotation\":\"duusioycblevpmcl\"},\"location\":\"yxkyxlz\",\"tags\":{\"taf\":\"gkzz\"},\"id\":\"bzf\",\"name\":\"ovwmbjlzqsczpgvd\",\"type\":\"napfdqwowftpt\"}],\"nextLink\":\"wjtkschgcgqyhl\"}") - .toObject(AccessControlListsListResult.class); - Assertions.assertEquals("yxkyxlz", model.value().get(0).location()); - Assertions.assertEquals("gkzz", model.value().get(0).tags().get("taf")); - Assertions.assertEquals(ConfigurationType.FILE, model.value().get(0).configurationType()); - Assertions.assertEquals("aiancznvodr", model.value().get(0).aclsUrl()); - Assertions - .assertEquals("lxydkxrxv", model.value().get(0).matchConfigurations().get(0).matchConfigurationName()); - Assertions - .assertEquals(731559020622365295L, model.value().get(0).matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.value().get(0).matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("duusioycblevpmcl", model.value().get(0).annotation()); - Assertions.assertEquals("wjtkschgcgqyhl", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessControlListsListResult model = - new AccessControlListsListResult() - .withValue( - Arrays - .asList( - new AccessControlListInner() - .withLocation("yxkyxlz") - .withTags(mapOf("taf", "gkzz")) - .withConfigurationType(ConfigurationType.FILE) - .withAclsUrl("aiancznvodr") - .withMatchConfigurations( - Arrays - .asList( - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("lxydkxrxv") - .withSequenceNumber(731559020622365295L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition(), - new AccessControlListMatchCondition(), - new AccessControlListMatchCondition())) - .withActions( - Arrays - .asList( - new AccessControlListAction(), - new AccessControlListAction(), - new AccessControlListAction(), - new AccessControlListAction())), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("jnqkhy") - .withSequenceNumber(7281626165756330252L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays.asList(new AccessControlListMatchCondition())) - .withActions( - Arrays - .asList( - new AccessControlListAction(), - new AccessControlListAction())), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("rqlrqffawe") - .withSequenceNumber(49967768153129763L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new AccessControlListMatchCondition(), - new AccessControlListMatchCondition(), - new AccessControlListMatchCondition(), - new AccessControlListMatchCondition())) - .withActions(Arrays.asList(new AccessControlListAction())), - new AccessControlListMatchConfiguration() - .withMatchConfigurationName("av") - .withSequenceNumber(1106225492612051465L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays.asList(new AccessControlListMatchCondition())) - .withActions( - Arrays - .asList( - new AccessControlListAction(), - new AccessControlListAction(), - new AccessControlListAction())))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups(Arrays.asList(new IpGroupProperties())) - .withVlanGroups(Arrays.asList(new VlanGroupProperties())) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties(), - new PortGroupProperties(), - new PortGroupProperties(), - new PortGroupProperties())), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays.asList(new IpGroupProperties(), new IpGroupProperties())) - .withVlanGroups(Arrays.asList(new VlanGroupProperties())) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties(), - new PortGroupProperties(), - new PortGroupProperties(), - new PortGroupProperties())), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays.asList(new IpGroupProperties(), new IpGroupProperties())) - .withVlanGroups(Arrays.asList(new VlanGroupProperties())) - .withPortGroups( - Arrays - .asList(new PortGroupProperties(), new PortGroupProperties())))) - .withAnnotation("duusioycblevpmcl"))) - .withNextLink("wjtkschgcgqyhl"); - model = BinaryData.fromObject(model).toObject(AccessControlListsListResult.class); - Assertions.assertEquals("yxkyxlz", model.value().get(0).location()); - Assertions.assertEquals("gkzz", model.value().get(0).tags().get("taf")); - Assertions.assertEquals(ConfigurationType.FILE, model.value().get(0).configurationType()); - Assertions.assertEquals("aiancznvodr", model.value().get(0).aclsUrl()); - Assertions - .assertEquals("lxydkxrxv", model.value().get(0).matchConfigurations().get(0).matchConfigurationName()); - Assertions - .assertEquals(731559020622365295L, model.value().get(0).matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.value().get(0).matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("duusioycblevpmcl", model.value().get(0).annotation()); - Assertions.assertEquals("wjtkschgcgqyhl", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsResyncMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsResyncMockTests.java deleted file mode 100644 index 4cab897453dd..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsResyncMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -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 AccessControlListsResyncMockTests { - @Test - public void testResync() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Succeeded\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager.accessControlLists().resync("cptctxpoegyckme", "fvrcclcl", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateAdministrativeStateMockTests.java deleted file mode 100644 index 0019f904305e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccessControlListsUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"ErrorDeprovisioning\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .accessControlLists() - .updateAdministrativeState( - "peawzzkvfccozv", - "xsp", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("trmsukxt")) - .withState(EnableDisableState.ENABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsValidateConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsValidateConfigurationMockTests.java deleted file mode 100644 index 79d47659e0bb..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsValidateConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationResponse; -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 AccessControlListsValidateConfigurationMockTests { - @Test - public void testValidateConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"ErrorDeprovisioning\",\"url\":\"ylxtebvse\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateConfigurationResponse response = - manager.accessControlLists().validateConfiguration("yjom", "wrvp", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ylxtebvse", response.url()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ActionIpCommunityPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ActionIpCommunityPropertiesTests.java deleted file mode 100644 index 5f24def8d35e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ActionIpCommunityPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ActionIpCommunityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ActionIpCommunityProperties model = - BinaryData - .fromString( - "{\"delete\":{\"ipCommunityIds\":[\"ikuqirhs\",\"xpaowkgvnlfueyx\",\"zibrlr\"]},\"set\":{\"ipCommunityIds\":[\"febpiucenbvrl\",\"l\",\"fknb\",\"zwi\"]},\"add\":{\"ipCommunityIds\":[\"yiqjz\",\"wrduxntpfxxgja\",\"yxfwfctq\"]}}") - .toObject(ActionIpCommunityProperties.class); - Assertions.assertEquals("yiqjz", model.add().ipCommunityIds().get(0)); - Assertions.assertEquals("ikuqirhs", model.delete().ipCommunityIds().get(0)); - Assertions.assertEquals("febpiucenbvrl", model.set().ipCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActionIpCommunityProperties model = - new ActionIpCommunityProperties() - .withAdd( - new IpCommunityIdList().withIpCommunityIds(Arrays.asList("yiqjz", "wrduxntpfxxgja", "yxfwfctq"))) - .withDelete( - new IpCommunityIdList().withIpCommunityIds(Arrays.asList("ikuqirhs", "xpaowkgvnlfueyx", "zibrlr"))) - .withSet( - new IpCommunityIdList().withIpCommunityIds(Arrays.asList("febpiucenbvrl", "l", "fknb", "zwi"))); - model = BinaryData.fromObject(model).toObject(ActionIpCommunityProperties.class); - Assertions.assertEquals("yiqjz", model.add().ipCommunityIds().get(0)); - Assertions.assertEquals("ikuqirhs", model.delete().ipCommunityIds().get(0)); - Assertions.assertEquals("febpiucenbvrl", model.set().ipCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ActionIpExtendedCommunityPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ActionIpExtendedCommunityPropertiesTests.java deleted file mode 100644 index c6c0ac445a64..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ActionIpExtendedCommunityPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ActionIpExtendedCommunityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ActionIpExtendedCommunityProperties model = - BinaryData - .fromString( - "{\"delete\":{\"ipExtendedCommunityIds\":[\"rlfqm\",\"j\"]},\"set\":{\"ipExtendedCommunityIds\":[\"bfvvcwvu\",\"kmjufav\",\"lnpbsotmynkln\",\"rznmtvrkkfcwxi\"]},\"add\":{\"ipExtendedCommunityIds\":[\"xneykeip\",\"utcbvriuvnfazx\",\"vsa\"]}}") - .toObject(ActionIpExtendedCommunityProperties.class); - Assertions.assertEquals("xneykeip", model.add().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals("rlfqm", model.delete().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals("bfvvcwvu", model.set().ipExtendedCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActionIpExtendedCommunityProperties model = - new ActionIpExtendedCommunityProperties() - .withAdd( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("xneykeip", "utcbvriuvnfazx", "vsa"))) - .withDelete(new IpExtendedCommunityIdList().withIpExtendedCommunityIds(Arrays.asList("rlfqm", "j"))) - .withSet( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays.asList("bfvvcwvu", "kmjufav", "lnpbsotmynkln", "rznmtvrkkfcwxi"))); - model = BinaryData.fromObject(model).toObject(ActionIpExtendedCommunityProperties.class); - Assertions.assertEquals("xneykeip", model.add().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals("rlfqm", model.delete().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals("bfvvcwvu", model.set().ipExtendedCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AggregateRouteConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AggregateRouteConfigurationTests.java deleted file mode 100644 index f81e5f1ee1f0..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AggregateRouteConfigurationTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRoute; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AggregateRouteConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AggregateRouteConfiguration model = - BinaryData - .fromString( - "{\"ipv4Routes\":[{\"prefix\":\"qecroodl\"}],\"ipv6Routes\":[{\"prefix\":\"drdaasa\"},{\"prefix\":\"xob\"},{\"prefix\":\"mfkwiyjvzuk\"}]}") - .toObject(AggregateRouteConfiguration.class); - Assertions.assertEquals("qecroodl", model.ipv4Routes().get(0).prefix()); - Assertions.assertEquals("drdaasa", model.ipv6Routes().get(0).prefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AggregateRouteConfiguration model = - new AggregateRouteConfiguration() - .withIpv4Routes(Arrays.asList(new AggregateRoute().withPrefix("qecroodl"))) - .withIpv6Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("drdaasa"), - new AggregateRoute().withPrefix("xob"), - new AggregateRoute().withPrefix("mfkwiyjvzuk"))); - model = BinaryData.fromObject(model).toObject(AggregateRouteConfiguration.class); - Assertions.assertEquals("qecroodl", model.ipv4Routes().get(0).prefix()); - Assertions.assertEquals("drdaasa", model.ipv6Routes().get(0).prefix()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AggregateRouteTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AggregateRouteTests.java deleted file mode 100644 index 8f919dc3d535..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AggregateRouteTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRoute; -import org.junit.jupiter.api.Assertions; - -public final class AggregateRouteTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AggregateRoute model = BinaryData.fromString("{\"prefix\":\"srnawnvzmln\"}").toObject(AggregateRoute.class); - Assertions.assertEquals("srnawnvzmln", model.prefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AggregateRoute model = new AggregateRoute().withPrefix("srnawnvzmln"); - model = BinaryData.fromObject(model).toObject(AggregateRoute.class); - Assertions.assertEquals("srnawnvzmln", model.prefix()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AnnotationResourceTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AnnotationResourceTests.java deleted file mode 100644 index 2bbc30db9e0e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/AnnotationResourceTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; -import org.junit.jupiter.api.Assertions; - -public final class AnnotationResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AnnotationResource model = - BinaryData.fromString("{\"annotation\":\"heyd\"}").toObject(AnnotationResource.class); - Assertions.assertEquals("heyd", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AnnotationResource model = new AnnotationResource().withAnnotation("heyd"); - model = BinaryData.fromObject(model).toObject(AnnotationResource.class); - Assertions.assertEquals("heyd", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/BfdConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/BfdConfigurationTests.java deleted file mode 100644 index 9519cdf65846..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/BfdConfigurationTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class BfdConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BfdConfiguration model = - BinaryData - .fromString( - "{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":362770996,\"multiplier\":2098126283}") - .toObject(BfdConfiguration.class); - Assertions.assertEquals(362770996, model.intervalInMilliSeconds()); - Assertions.assertEquals(2098126283, model.multiplier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BfdConfiguration model = - new BfdConfiguration().withIntervalInMilliSeconds(362770996).withMultiplier(2098126283); - model = BinaryData.fromObject(model).toObject(BfdConfiguration.class); - Assertions.assertEquals(362770996, model.intervalInMilliSeconds()); - Assertions.assertEquals(2098126283, model.multiplier()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/BgpConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/BgpConfigurationTests.java deleted file mode 100644 index 7c1a9dddeb63..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/BgpConfigurationTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BgpConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BgpConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BgpConfiguration model = - BinaryData - .fromString( - "{\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":101641984,\"multiplier\":719655788},\"defaultRouteOriginate\":\"True\",\"allowAS\":191759687,\"allowASOverride\":\"Disable\",\"fabricASN\":505239500038837458,\"peerASN\":5939846871013452726,\"ipv4ListenRangePrefixes\":[\"jzgdyrc\",\"uqbsgzlrqhb\"],\"ipv6ListenRangePrefixes\":[\"ogdxwbsfpyxxtjlf\",\"ecominxojjluxxd\"],\"ipv4NeighborAddress\":[{\"address\":\"zd\",\"configurationState\":\"Accepted\"},{\"address\":\"mueza\",\"configurationState\":\"ErrorDeprovisioning\"}],\"ipv6NeighborAddress\":[{\"address\":\"qloto\",\"configurationState\":\"ErrorProvisioning\"},{\"address\":\"wtaznkcqw\",\"configurationState\":\"Accepted\"},{\"address\":\"yofgwhnkbtlwljss\",\"configurationState\":\"Rejected\"},{\"address\":\"nldkp\",\"configurationState\":\"ErrorDeprovisioning\"}],\"annotation\":\"isubxbteog\"}") - .toObject(BgpConfiguration.class); - Assertions.assertEquals("isubxbteog", model.annotation()); - Assertions.assertEquals(101641984, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(719655788, model.bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.defaultRouteOriginate()); - Assertions.assertEquals(191759687, model.allowAS()); - Assertions.assertEquals(AllowASOverride.DISABLE, model.allowASOverride()); - Assertions.assertEquals(5939846871013452726L, model.peerAsn()); - Assertions.assertEquals("jzgdyrc", model.ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("ogdxwbsfpyxxtjlf", model.ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("zd", model.ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("qloto", model.ipv6NeighborAddress().get(0).address()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BgpConfiguration model = - new BgpConfiguration() - .withAnnotation("isubxbteog") - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(101641984).withMultiplier(719655788)) - .withDefaultRouteOriginate(BooleanEnumProperty.TRUE) - .withAllowAS(191759687) - .withAllowASOverride(AllowASOverride.DISABLE) - .withPeerAsn(5939846871013452726L) - .withIpv4ListenRangePrefixes(Arrays.asList("jzgdyrc", "uqbsgzlrqhb")) - .withIpv6ListenRangePrefixes(Arrays.asList("ogdxwbsfpyxxtjlf", "ecominxojjluxxd")) - .withIpv4NeighborAddress( - Arrays.asList(new NeighborAddress().withAddress("zd"), new NeighborAddress().withAddress("mueza"))) - .withIpv6NeighborAddress( - Arrays - .asList( - new NeighborAddress().withAddress("qloto"), - new NeighborAddress().withAddress("wtaznkcqw"), - new NeighborAddress().withAddress("yofgwhnkbtlwljss"), - new NeighborAddress().withAddress("nldkp"))); - model = BinaryData.fromObject(model).toObject(BgpConfiguration.class); - Assertions.assertEquals("isubxbteog", model.annotation()); - Assertions.assertEquals(101641984, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(719655788, model.bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.defaultRouteOriginate()); - Assertions.assertEquals(191759687, model.allowAS()); - Assertions.assertEquals(AllowASOverride.DISABLE, model.allowASOverride()); - Assertions.assertEquals(5939846871013452726L, model.peerAsn()); - Assertions.assertEquals("jzgdyrc", model.ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("ogdxwbsfpyxxtjlf", model.ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("zd", model.ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("qloto", model.ipv6NeighborAddress().get(0).address()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonDynamicMatchConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonDynamicMatchConfigurationTests.java deleted file mode 100644 index 269d9da29036..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonDynamicMatchConfigurationTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CommonDynamicMatchConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommonDynamicMatchConfiguration model = - BinaryData - .fromString( - "{\"ipGroups\":[{\"name\":\"cblembnkbwv\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"ivqiheb\",\"tswbzuwfmd\"]}],\"vlanGroups\":[{\"name\":\"egizv\",\"vlans\":[\"elisdjub\",\"gbqi\",\"kxkbsazgakgacyr\"]},{\"name\":\"jdmspofapvuhryln\",\"vlans\":[\"rz\",\"bzjedmstk\",\"nlvxbcuii\"]}],\"portGroups\":[{\"name\":\"wfansnvpdi\",\"ports\":[\"kostbzbki\",\"buqny\",\"phzfylsgcrp\",\"bcunezzceze\"]},{\"name\":\"w\",\"ports\":[\"lwxjwetn\"]}]}") - .toObject(CommonDynamicMatchConfiguration.class); - Assertions.assertEquals("cblembnkbwv", model.ipGroups().get(0).name()); - Assertions.assertEquals(IpAddressType.IPV4, model.ipGroups().get(0).ipAddressType()); - Assertions.assertEquals("ivqiheb", model.ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("egizv", model.vlanGroups().get(0).name()); - Assertions.assertEquals("elisdjub", model.vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("wfansnvpdi", model.portGroups().get(0).name()); - Assertions.assertEquals("kostbzbki", model.portGroups().get(0).ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommonDynamicMatchConfiguration model = - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("cblembnkbwv") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("ivqiheb", "tswbzuwfmd")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("egizv") - .withVlans(Arrays.asList("elisdjub", "gbqi", "kxkbsazgakgacyr")), - new VlanGroupProperties() - .withName("jdmspofapvuhryln") - .withVlans(Arrays.asList("rz", "bzjedmstk", "nlvxbcuii")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("wfansnvpdi") - .withPorts(Arrays.asList("kostbzbki", "buqny", "phzfylsgcrp", "bcunezzceze")), - new PortGroupProperties().withName("w").withPorts(Arrays.asList("lwxjwetn")))); - model = BinaryData.fromObject(model).toObject(CommonDynamicMatchConfiguration.class); - Assertions.assertEquals("cblembnkbwv", model.ipGroups().get(0).name()); - Assertions.assertEquals(IpAddressType.IPV4, model.ipGroups().get(0).ipAddressType()); - Assertions.assertEquals("ivqiheb", model.ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("egizv", model.vlanGroups().get(0).name()); - Assertions.assertEquals("elisdjub", model.vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("wfansnvpdi", model.portGroups().get(0).name()); - Assertions.assertEquals("kostbzbki", model.portGroups().get(0).ports().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonMatchConditionsTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonMatchConditionsTests.java deleted file mode 100644 index bba942afa6b5..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonMatchConditionsTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.CommonMatchConditions; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CommonMatchConditionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommonMatchConditions model = - BinaryData - .fromString( - "{\"protocolTypes\":[\"kvntjlrigjkskyri\"],\"vlanMatchCondition\":{\"vlans\":[\"idsxwaabzmifry\"],\"innerVlans\":[\"mmaxrizkzobgo\",\"xlhslnel\",\"ieixynllxe\"],\"vlanGroupNames\":[\"rojphslhcawjutif\",\"wfmvigorqjbt\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"afhonqj\",\"jeick\"],\"ipGroupNames\":[\"cpopmxel\",\"wcltyjede\"]}}") - .toObject(CommonMatchConditions.class); - Assertions.assertEquals("kvntjlrigjkskyri", model.protocolTypes().get(0)); - Assertions.assertEquals("idsxwaabzmifry", model.vlanMatchCondition().vlans().get(0)); - Assertions.assertEquals("mmaxrizkzobgo", model.vlanMatchCondition().innerVlans().get(0)); - Assertions.assertEquals("rojphslhcawjutif", model.vlanMatchCondition().vlanGroupNames().get(0)); - Assertions.assertEquals(SourceDestinationType.SOURCE_IP, model.ipCondition().type()); - Assertions.assertEquals(PrefixType.PREFIX, model.ipCondition().prefixType()); - Assertions.assertEquals("afhonqj", model.ipCondition().ipPrefixValues().get(0)); - Assertions.assertEquals("cpopmxel", model.ipCondition().ipGroupNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommonMatchConditions model = - new CommonMatchConditions() - .withProtocolTypes(Arrays.asList("kvntjlrigjkskyri")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("idsxwaabzmifry")) - .withInnerVlans(Arrays.asList("mmaxrizkzobgo", "xlhslnel", "ieixynllxe")) - .withVlanGroupNames(Arrays.asList("rojphslhcawjutif", "wfmvigorqjbt"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("afhonqj", "jeick")) - .withIpGroupNames(Arrays.asList("cpopmxel", "wcltyjede"))); - model = BinaryData.fromObject(model).toObject(CommonMatchConditions.class); - Assertions.assertEquals("kvntjlrigjkskyri", model.protocolTypes().get(0)); - Assertions.assertEquals("idsxwaabzmifry", model.vlanMatchCondition().vlans().get(0)); - Assertions.assertEquals("mmaxrizkzobgo", model.vlanMatchCondition().innerVlans().get(0)); - Assertions.assertEquals("rojphslhcawjutif", model.vlanMatchCondition().vlanGroupNames().get(0)); - Assertions.assertEquals(SourceDestinationType.SOURCE_IP, model.ipCondition().type()); - Assertions.assertEquals(PrefixType.PREFIX, model.ipCondition().prefixType()); - Assertions.assertEquals("afhonqj", model.ipCondition().ipPrefixValues().get(0)); - Assertions.assertEquals("cpopmxel", model.ipCondition().ipGroupNames().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonPostActionResponseForDeviceUpdateInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonPostActionResponseForDeviceUpdateInnerTests.java deleted file mode 100644 index 95dad275ea46..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonPostActionResponseForDeviceUpdateInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.CommonPostActionResponseForDeviceUpdateInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CommonPostActionResponseForDeviceUpdateInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommonPostActionResponseForDeviceUpdateInner model = - BinaryData - .fromString( - "{\"configurationState\":\"Provisioned\",\"successfulDevices\":[\"gfnzh\",\"tmjtsghp\"],\"failedDevices\":[\"cp\",\"arpzeqacdldtzm\",\"ypefcpczshnuqnda\",\"zupfkhuytuszxhm\"]}") - .toObject(CommonPostActionResponseForDeviceUpdateInner.class); - Assertions.assertEquals("gfnzh", model.successfulDevices().get(0)); - Assertions.assertEquals("cp", model.failedDevices().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommonPostActionResponseForDeviceUpdateInner model = - new CommonPostActionResponseForDeviceUpdateInner() - .withSuccessfulDevices(Arrays.asList("gfnzh", "tmjtsghp")) - .withFailedDevices(Arrays.asList("cp", "arpzeqacdldtzm", "ypefcpczshnuqnda", "zupfkhuytuszxhm")); - model = BinaryData.fromObject(model).toObject(CommonPostActionResponseForDeviceUpdateInner.class); - Assertions.assertEquals("gfnzh", model.successfulDevices().get(0)); - Assertions.assertEquals("cp", model.failedDevices().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonPostActionResponseForStateUpdateInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonPostActionResponseForStateUpdateInnerTests.java deleted file mode 100644 index bfbee7b71fbc..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/CommonPostActionResponseForStateUpdateInnerTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.CommonPostActionResponseForStateUpdateInner; - -public final class CommonPostActionResponseForStateUpdateInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommonPostActionResponseForStateUpdateInner model = - BinaryData - .fromString("{\"configurationState\":\"ErrorDeprovisioning\"}") - .toObject(CommonPostActionResponseForStateUpdateInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommonPostActionResponseForStateUpdateInner model = new CommonPostActionResponseForStateUpdateInner(); - model = BinaryData.fromObject(model).toObject(CommonPostActionResponseForStateUpdateInner.class); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ConnectedSubnetRoutePolicyTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ConnectedSubnetRoutePolicyTests.java deleted file mode 100644 index 84640a39b6ba..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ConnectedSubnetRoutePolicyTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnetRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3ExportRoutePolicy; -import org.junit.jupiter.api.Assertions; - -public final class ConnectedSubnetRoutePolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectedSubnetRoutePolicy model = - BinaryData - .fromString( - "{\"exportRoutePolicyId\":\"ywsxvjabjqqaxu\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"mc\",\"exportIpv6RoutePolicyId\":\"dndoabhjxw\"}}") - .toObject(ConnectedSubnetRoutePolicy.class); - Assertions.assertEquals("ywsxvjabjqqaxu", model.exportRoutePolicyId()); - Assertions.assertEquals("mc", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("dndoabhjxw", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedSubnetRoutePolicy model = - new ConnectedSubnetRoutePolicy() - .withExportRoutePolicyId("ywsxvjabjqqaxu") - .withExportRoutePolicy( - new L3ExportRoutePolicy() - .withExportIpv4RoutePolicyId("mc") - .withExportIpv6RoutePolicyId("dndoabhjxw")); - model = BinaryData.fromObject(model).toObject(ConnectedSubnetRoutePolicy.class); - Assertions.assertEquals("ywsxvjabjqqaxu", model.exportRoutePolicyId()); - Assertions.assertEquals("mc", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("dndoabhjxw", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ConnectedSubnetTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ConnectedSubnetTests.java deleted file mode 100644 index 148a3fe0a0b6..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ConnectedSubnetTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; -import org.junit.jupiter.api.Assertions; - -public final class ConnectedSubnetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectedSubnet model = - BinaryData - .fromString("{\"prefix\":\"nymmqgwokmikpa\",\"annotation\":\"bmjxuvjipf\"}") - .toObject(ConnectedSubnet.class); - Assertions.assertEquals("bmjxuvjipf", model.annotation()); - Assertions.assertEquals("nymmqgwokmikpa", model.prefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedSubnet model = new ConnectedSubnet().withAnnotation("bmjxuvjipf").withPrefix("nymmqgwokmikpa"); - model = BinaryData.fromObject(model).toObject(ConnectedSubnet.class); - Assertions.assertEquals("bmjxuvjipf", model.annotation()); - Assertions.assertEquals("nymmqgwokmikpa", model.prefix()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ControllerServicesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ControllerServicesTests.java deleted file mode 100644 index b46e5aebd4e6..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ControllerServicesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ControllerServices; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ControllerServicesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ControllerServices model = - BinaryData - .fromString( - "{\"ipv4AddressSpaces\":[\"bhtleberpy\",\"jeknfqnw\",\"j\"],\"ipv6AddressSpaces\":[\"wkdnjrxgkrhwiehy\",\"pnowawonoehrguql\"]}") - .toObject(ControllerServices.class); - Assertions.assertEquals("bhtleberpy", model.ipv4AddressSpaces().get(0)); - Assertions.assertEquals("wkdnjrxgkrhwiehy", model.ipv6AddressSpaces().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ControllerServices model = - new ControllerServices() - .withIpv4AddressSpaces(Arrays.asList("bhtleberpy", "jeknfqnw", "j")) - .withIpv6AddressSpaces(Arrays.asList("wkdnjrxgkrhwiehy", "pnowawonoehrguql")); - model = BinaryData.fromObject(model).toObject(ControllerServices.class); - Assertions.assertEquals("bhtleberpy", model.ipv4AddressSpaces().get(0)); - Assertions.assertEquals("wkdnjrxgkrhwiehy", model.ipv6AddressSpaces().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/DestinationPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/DestinationPropertiesTests.java deleted file mode 100644 index 8726b5e4ade9..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/DestinationPropertiesTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationProperties; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.IsolationDomainProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DestinationProperties model = - BinaryData - .fromString( - "{\"name\":\"wscrngtwgxrolw\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"sdksut\",\"isolationDomainProperties\":{\"encapsulation\":\"GRE\",\"neighborGroupIds\":[\"havishbvjhxvpmq\",\"uquxlphngrxl\"]},\"destinationTapRuleId\":\"oweorocrq\"}") - .toObject(DestinationProperties.class); - Assertions.assertEquals("wscrngtwgxrolw", model.name()); - Assertions.assertEquals(DestinationType.ISOLATION_DOMAIN, model.destinationType()); - Assertions.assertEquals("sdksut", model.destinationId()); - Assertions.assertEquals(Encapsulation.GRE, model.isolationDomainProperties().encapsulation()); - Assertions.assertEquals("havishbvjhxvpmq", model.isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("oweorocrq", model.destinationTapRuleId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DestinationProperties model = - new DestinationProperties() - .withName("wscrngtwgxrolw") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("sdksut") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.GRE) - .withNeighborGroupIds(Arrays.asList("havishbvjhxvpmq", "uquxlphngrxl"))) - .withDestinationTapRuleId("oweorocrq"); - model = BinaryData.fromObject(model).toObject(DestinationProperties.class); - Assertions.assertEquals("wscrngtwgxrolw", model.name()); - Assertions.assertEquals(DestinationType.ISOLATION_DOMAIN, model.destinationType()); - Assertions.assertEquals("sdksut", model.destinationId()); - Assertions.assertEquals(Encapsulation.GRE, model.isolationDomainProperties().encapsulation()); - Assertions.assertEquals("havishbvjhxvpmq", model.isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("oweorocrq", model.destinationTapRuleId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/DeviceInterfacePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/DeviceInterfacePropertiesTests.java deleted file mode 100644 index fed102168efe..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/DeviceInterfacePropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.DeviceInterfaceProperties; -import com.azure.resourcemanager.managednetworkfabric.models.SupportedConnectorProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeviceInterfacePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceInterfaceProperties model = - BinaryData - .fromString( - "{\"identifier\":\"gzkheubanl\",\"interfaceType\":\"npqcc\",\"supportedConnectorTypes\":[{\"connectorType\":\"wzlzklasl\",\"maxSpeedInMbps\":749818941},{\"connectorType\":\"zuxlrarwpewsau\",\"maxSpeedInMbps\":1198933921},{\"connectorType\":\"tighsxjpy\",\"maxSpeedInMbps\":1790305531},{\"connectorType\":\"bala\",\"maxSpeedInMbps\":76421440}]}") - .toObject(DeviceInterfaceProperties.class); - Assertions.assertEquals("gzkheubanl", model.identifier()); - Assertions.assertEquals("npqcc", model.interfaceType()); - Assertions.assertEquals("wzlzklasl", model.supportedConnectorTypes().get(0).connectorType()); - Assertions.assertEquals(749818941, model.supportedConnectorTypes().get(0).maxSpeedInMbps()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceInterfaceProperties model = - new DeviceInterfaceProperties() - .withIdentifier("gzkheubanl") - .withInterfaceType("npqcc") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties() - .withConnectorType("wzlzklasl") - .withMaxSpeedInMbps(749818941), - new SupportedConnectorProperties() - .withConnectorType("zuxlrarwpewsau") - .withMaxSpeedInMbps(1198933921), - new SupportedConnectorProperties() - .withConnectorType("tighsxjpy") - .withMaxSpeedInMbps(1790305531), - new SupportedConnectorProperties().withConnectorType("bala").withMaxSpeedInMbps(76421440))); - model = BinaryData.fromObject(model).toObject(DeviceInterfaceProperties.class); - Assertions.assertEquals("gzkheubanl", model.identifier()); - Assertions.assertEquals("npqcc", model.interfaceType()); - Assertions.assertEquals("wzlzklasl", model.supportedConnectorTypes().get(0).connectorType()); - Assertions.assertEquals(749818941, model.supportedConnectorTypes().get(0).maxSpeedInMbps()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/EnableDisableOnResourcesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/EnableDisableOnResourcesTests.java deleted file mode 100644 index e77dbd9a6a5a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/EnableDisableOnResourcesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EnableDisableOnResourcesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnableDisableOnResources model = - BinaryData.fromString("{\"resourceIds\":[\"v\"]}").toObject(EnableDisableOnResources.class); - Assertions.assertEquals("v", model.resourceIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnableDisableOnResources model = new EnableDisableOnResources().withResourceIds(Arrays.asList("v")); - model = BinaryData.fromObject(model).toObject(EnableDisableOnResources.class); - Assertions.assertEquals("v", model.resourceIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExportRoutePolicyInformationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExportRoutePolicyInformationTests.java deleted file mode 100644 index 320a61b2bd89..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExportRoutePolicyInformationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicyInformation; -import org.junit.jupiter.api.Assertions; - -public final class ExportRoutePolicyInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExportRoutePolicyInformation model = - BinaryData - .fromString("{\"exportIpv4RoutePolicyId\":\"oyrzaaoe\",\"exportIpv6RoutePolicyId\":\"pmjen\"}") - .toObject(ExportRoutePolicyInformation.class); - Assertions.assertEquals("oyrzaaoe", model.exportIpv4RoutePolicyId()); - Assertions.assertEquals("pmjen", model.exportIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExportRoutePolicyInformation model = - new ExportRoutePolicyInformation() - .withExportIpv4RoutePolicyId("oyrzaaoe") - .withExportIpv6RoutePolicyId("pmjen"); - model = BinaryData.fromObject(model).toObject(ExportRoutePolicyInformation.class); - Assertions.assertEquals("oyrzaaoe", model.exportIpv4RoutePolicyId()); - Assertions.assertEquals("pmjen", model.exportIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExportRoutePolicyTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExportRoutePolicyTests.java deleted file mode 100644 index 4cd5db398273..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExportRoutePolicyTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import org.junit.jupiter.api.Assertions; - -public final class ExportRoutePolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExportRoutePolicy model = - BinaryData - .fromString("{\"exportIpv4RoutePolicyId\":\"mvetatlakfq\",\"exportIpv6RoutePolicyId\":\"xwgiks\"}") - .toObject(ExportRoutePolicy.class); - Assertions.assertEquals("mvetatlakfq", model.exportIpv4RoutePolicyId()); - Assertions.assertEquals("xwgiks", model.exportIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExportRoutePolicy model = - new ExportRoutePolicy().withExportIpv4RoutePolicyId("mvetatlakfq").withExportIpv6RoutePolicyId("xwgiks"); - model = BinaryData.fromObject(model).toObject(ExportRoutePolicy.class); - Assertions.assertEquals("mvetatlakfq", model.exportIpv4RoutePolicyId()); - Assertions.assertEquals("xwgiks", model.exportIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExtensionEnumPropertyTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExtensionEnumPropertyTests.java deleted file mode 100644 index b6d7e1ef7129..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExtensionEnumPropertyTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.Extension; -import com.azure.resourcemanager.managednetworkfabric.models.ExtensionEnumProperty; -import org.junit.jupiter.api.Assertions; - -public final class ExtensionEnumPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionEnumProperty model = - BinaryData.fromString("{\"extension\":\"NoExtension\"}").toObject(ExtensionEnumProperty.class); - Assertions.assertEquals(Extension.NO_EXTENSION, model.extension()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionEnumProperty model = new ExtensionEnumProperty().withExtension(Extension.NO_EXTENSION); - model = BinaryData.fromObject(model).toObject(ExtensionEnumProperty.class); - Assertions.assertEquals(Extension.NO_EXTENSION, model.extension()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkInnerTests.java deleted file mode 100644 index 6a29297b8814..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkInnerTests.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkInner; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExternalNetworkInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalNetworkInner model = - BinaryData - .fromString( - "{\"properties\":{\"networkToNetworkInterconnectId\":\"bmsgycqsxrmdv\",\"peeringOption\":\"OptionA\",\"optionBProperties\":{\"importRouteTargets\":[\"aeohpjhgejkbvhh\"],\"exportRouteTargets\":[\"rgh\",\"oxae\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"xjxjoe\",\"lqxr\",\"dknkobe\",\"tmbozomtzamicbig\"],\"importIpv6RouteTargets\":[\"gzseznuxkeua\",\"raabmdlqjb\"],\"exportIpv4RouteTargets\":[\"f\",\"xlhupmomihzbdnp\",\"pkcdpreyxely\"],\"exportIpv6RouteTargets\":[\"hflrufssjyghsfx\",\"kb\",\"ammgmqfmefgv\",\"cpdwjgquxwey\"]}},\"optionAProperties\":{\"mtu\":623314328,\"vlanId\":632132991,\"fabricASN\":8484596339350627164,\"peerASN\":3718211800072849399,\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":615370227,\"multiplier\":1611420396},\"ingressAclId\":\"nrrnquoxsoti\",\"egressAclId\":\"imseobf\",\"primaryIpv4Prefix\":\"stcyilbvzmmxcjz\",\"primaryIpv6Prefix\":\"uzexokjxebjvbzin\",\"secondaryIpv4Prefix\":\"bwmvogljsvl\",\"secondaryIpv6Prefix\":\"idnwceha\"},\"configurationState\":\"Rejected\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Enabled\",\"importRoutePolicyId\":\"giomqo\",\"exportRoutePolicyId\":\"epiaeapfsergd\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"qnacyheq\",\"importIpv6RoutePolicyId\":\"pqqncju\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"jozfym\",\"exportIpv6RoutePolicyId\":\"m\"},\"annotation\":\"pyvqy\"},\"id\":\"li\",\"name\":\"iipsejbsvsiaies\",\"type\":\"hddzydisnuepy\"}") - .toObject(ExternalNetworkInner.class); - Assertions.assertEquals(PeeringOption.OPTIONA, model.peeringOption()); - Assertions.assertEquals("aeohpjhgejkbvhh", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("rgh", model.optionBProperties().exportRouteTargets().get(0)); - Assertions.assertEquals("xjxjoe", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("gzseznuxkeua", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("f", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions - .assertEquals("hflrufssjyghsfx", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("stcyilbvzmmxcjz", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("uzexokjxebjvbzin", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("bwmvogljsvl", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("idnwceha", model.optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(623314328, model.optionAProperties().mtu()); - Assertions.assertEquals(632132991, model.optionAProperties().vlanId()); - Assertions.assertEquals(3718211800072849399L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(615370227, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1611420396, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("nrrnquoxsoti", model.optionAProperties().ingressAclId()); - Assertions.assertEquals("imseobf", model.optionAProperties().egressAclId()); - Assertions.assertEquals("giomqo", model.importRoutePolicyId()); - Assertions.assertEquals("epiaeapfsergd", model.exportRoutePolicyId()); - Assertions.assertEquals("qnacyheq", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("pqqncju", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("jozfym", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("m", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("pyvqy", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalNetworkInner model = - new ExternalNetworkInner() - .withPeeringOption(PeeringOption.OPTIONA) - .withOptionBProperties( - new L3OptionBProperties() - .withImportRouteTargets(Arrays.asList("aeohpjhgejkbvhh")) - .withExportRouteTargets(Arrays.asList("rgh", "oxae")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets( - Arrays.asList("xjxjoe", "lqxr", "dknkobe", "tmbozomtzamicbig")) - .withImportIpv6RouteTargets(Arrays.asList("gzseznuxkeua", "raabmdlqjb")) - .withExportIpv4RouteTargets(Arrays.asList("f", "xlhupmomihzbdnp", "pkcdpreyxely")) - .withExportIpv6RouteTargets( - Arrays.asList("hflrufssjyghsfx", "kb", "ammgmqfmefgv", "cpdwjgquxwey")))) - .withOptionAProperties( - new ExternalNetworkPropertiesOptionAProperties() - .withPrimaryIpv4Prefix("stcyilbvzmmxcjz") - .withPrimaryIpv6Prefix("uzexokjxebjvbzin") - .withSecondaryIpv4Prefix("bwmvogljsvl") - .withSecondaryIpv6Prefix("idnwceha") - .withMtu(623314328) - .withVlanId(632132991) - .withPeerAsn(3718211800072849399L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(615370227).withMultiplier(1611420396)) - .withIngressAclId("nrrnquoxsoti") - .withEgressAclId("imseobf")) - .withImportRoutePolicyId("giomqo") - .withExportRoutePolicyId("epiaeapfsergd") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("qnacyheq") - .withImportIpv6RoutePolicyId("pqqncju")) - .withExportRoutePolicy( - new ExportRoutePolicy().withExportIpv4RoutePolicyId("jozfym").withExportIpv6RoutePolicyId("m")) - .withAnnotation("pyvqy"); - model = BinaryData.fromObject(model).toObject(ExternalNetworkInner.class); - Assertions.assertEquals(PeeringOption.OPTIONA, model.peeringOption()); - Assertions.assertEquals("aeohpjhgejkbvhh", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("rgh", model.optionBProperties().exportRouteTargets().get(0)); - Assertions.assertEquals("xjxjoe", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("gzseznuxkeua", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("f", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions - .assertEquals("hflrufssjyghsfx", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("stcyilbvzmmxcjz", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("uzexokjxebjvbzin", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("bwmvogljsvl", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("idnwceha", model.optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(623314328, model.optionAProperties().mtu()); - Assertions.assertEquals(632132991, model.optionAProperties().vlanId()); - Assertions.assertEquals(3718211800072849399L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(615370227, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1611420396, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("nrrnquoxsoti", model.optionAProperties().ingressAclId()); - Assertions.assertEquals("imseobf", model.optionAProperties().egressAclId()); - Assertions.assertEquals("giomqo", model.importRoutePolicyId()); - Assertions.assertEquals("epiaeapfsergd", model.exportRoutePolicyId()); - Assertions.assertEquals("qnacyheq", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("pqqncju", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("jozfym", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("m", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("pyvqy", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchPropertiesOptionAPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchPropertiesOptionAPropertiesTests.java deleted file mode 100644 index 02f00a80cc90..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchPropertiesOptionAPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPatchPropertiesOptionAProperties; -import org.junit.jupiter.api.Assertions; - -public final class ExternalNetworkPatchPropertiesOptionAPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalNetworkPatchPropertiesOptionAProperties model = - BinaryData - .fromString( - "{\"mtu\":465055471,\"vlanId\":1999100319,\"fabricASN\":3083093657904489984,\"peerASN\":5237325054200645561,\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":610488087,\"multiplier\":81227364},\"ingressAclId\":\"skiioshjgczetybn\",\"egressAclId\":\"ztlcgc\",\"primaryIpv4Prefix\":\"chfjvmywjzebe\",\"primaryIpv6Prefix\":\"vlbefvwclj\",\"secondaryIpv4Prefix\":\"pylrwoxzgwpsy\",\"secondaryIpv6Prefix\":\"ijeypdvrbkerdkdk\"}") - .toObject(ExternalNetworkPatchPropertiesOptionAProperties.class); - Assertions.assertEquals("chfjvmywjzebe", model.primaryIpv4Prefix()); - Assertions.assertEquals("vlbefvwclj", model.primaryIpv6Prefix()); - Assertions.assertEquals("pylrwoxzgwpsy", model.secondaryIpv4Prefix()); - Assertions.assertEquals("ijeypdvrbkerdkdk", model.secondaryIpv6Prefix()); - Assertions.assertEquals(465055471, model.mtu()); - Assertions.assertEquals(1999100319, model.vlanId()); - Assertions.assertEquals(5237325054200645561L, model.peerAsn()); - Assertions.assertEquals(610488087, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(81227364, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("skiioshjgczetybn", model.ingressAclId()); - Assertions.assertEquals("ztlcgc", model.egressAclId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalNetworkPatchPropertiesOptionAProperties model = - new ExternalNetworkPatchPropertiesOptionAProperties() - .withPrimaryIpv4Prefix("chfjvmywjzebe") - .withPrimaryIpv6Prefix("vlbefvwclj") - .withSecondaryIpv4Prefix("pylrwoxzgwpsy") - .withSecondaryIpv6Prefix("ijeypdvrbkerdkdk") - .withMtu(465055471) - .withVlanId(1999100319) - .withPeerAsn(5237325054200645561L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(610488087).withMultiplier(81227364)) - .withIngressAclId("skiioshjgczetybn") - .withEgressAclId("ztlcgc"); - model = BinaryData.fromObject(model).toObject(ExternalNetworkPatchPropertiesOptionAProperties.class); - Assertions.assertEquals("chfjvmywjzebe", model.primaryIpv4Prefix()); - Assertions.assertEquals("vlbefvwclj", model.primaryIpv6Prefix()); - Assertions.assertEquals("pylrwoxzgwpsy", model.secondaryIpv4Prefix()); - Assertions.assertEquals("ijeypdvrbkerdkdk", model.secondaryIpv6Prefix()); - Assertions.assertEquals(465055471, model.mtu()); - Assertions.assertEquals(1999100319, model.vlanId()); - Assertions.assertEquals(5237325054200645561L, model.peerAsn()); - Assertions.assertEquals(610488087, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(81227364, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("skiioshjgczetybn", model.ingressAclId()); - Assertions.assertEquals("ztlcgc", model.egressAclId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchPropertiesTests.java deleted file mode 100644 index 93350d312b23..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchPropertiesTests.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkPatchProperties; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPatchPropertiesOptionAProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExternalNetworkPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalNetworkPatchProperties model = - BinaryData - .fromString( - "{\"peeringOption\":\"OptionA\",\"optionBProperties\":{\"importRouteTargets\":[\"aatsdohzniucb\",\"aombwiinjdl\",\"wktlepowa\",\"vqxuajgcqw\"],\"exportRouteTargets\":[\"nkgfcfdr\",\"wsikxxtclhuulr\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"okvjgbzsxebrslt\",\"fyhcdjw\",\"uoard\",\"agttpufpb\"],\"importIpv6RouteTargets\":[\"rholhujbfwxi\",\"lkysolsyjp\",\"xslwhd\"],\"exportIpv4RouteTargets\":[\"htbbzj\",\"f\",\"huwzbxpcqzgi\"],\"exportIpv6RouteTargets\":[\"jecoh\",\"xvvlrrsk\"]}},\"optionAProperties\":{\"mtu\":750981171,\"vlanId\":570361576,\"fabricASN\":3359893942207943937,\"peerASN\":5680957003254900576,\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":615725522,\"multiplier\":1037262158},\"ingressAclId\":\"yksyimyccgrvkcx\",\"egressAclId\":\"nnuifersej\",\"primaryIpv4Prefix\":\"prkjg\",\"primaryIpv6Prefix\":\"rjmwvvbtuqkxxi\",\"secondaryIpv4Prefix\":\"gxql\",\"secondaryIpv6Prefix\":\"k\"},\"importRoutePolicyId\":\"jgxieqfkyfh\",\"exportRoutePolicyId\":\"vjaqu\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"ynvskpajbmgeume\",\"importIpv6RoutePolicyId\":\"jbxcbccwkqmtxa\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"iscr\",\"exportIpv6RoutePolicyId\":\"lgftrqrejdaa\"},\"annotation\":\"qimlda\"}") - .toObject(ExternalNetworkPatchProperties.class); - Assertions.assertEquals("qimlda", model.annotation()); - Assertions.assertEquals(PeeringOption.OPTIONA, model.peeringOption()); - Assertions.assertEquals("aatsdohzniucb", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("nkgfcfdr", model.optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals("okvjgbzsxebrslt", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("rholhujbfwxi", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("htbbzj", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("jecoh", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("prkjg", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("rjmwvvbtuqkxxi", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("gxql", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("k", model.optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(750981171, model.optionAProperties().mtu()); - Assertions.assertEquals(570361576, model.optionAProperties().vlanId()); - Assertions.assertEquals(5680957003254900576L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(615725522, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1037262158, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("yksyimyccgrvkcx", model.optionAProperties().ingressAclId()); - Assertions.assertEquals("nnuifersej", model.optionAProperties().egressAclId()); - Assertions.assertEquals("jgxieqfkyfh", model.importRoutePolicyId()); - Assertions.assertEquals("vjaqu", model.exportRoutePolicyId()); - Assertions.assertEquals("ynvskpajbmgeume", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("jbxcbccwkqmtxa", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("iscr", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("lgftrqrejdaa", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalNetworkPatchProperties model = - new ExternalNetworkPatchProperties() - .withAnnotation("qimlda") - .withPeeringOption(PeeringOption.OPTIONA) - .withOptionBProperties( - new L3OptionBProperties() - .withImportRouteTargets( - Arrays.asList("aatsdohzniucb", "aombwiinjdl", "wktlepowa", "vqxuajgcqw")) - .withExportRouteTargets(Arrays.asList("nkgfcfdr", "wsikxxtclhuulr")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets( - Arrays.asList("okvjgbzsxebrslt", "fyhcdjw", "uoard", "agttpufpb")) - .withImportIpv6RouteTargets(Arrays.asList("rholhujbfwxi", "lkysolsyjp", "xslwhd")) - .withExportIpv4RouteTargets(Arrays.asList("htbbzj", "f", "huwzbxpcqzgi")) - .withExportIpv6RouteTargets(Arrays.asList("jecoh", "xvvlrrsk")))) - .withOptionAProperties( - new ExternalNetworkPatchPropertiesOptionAProperties() - .withPrimaryIpv4Prefix("prkjg") - .withPrimaryIpv6Prefix("rjmwvvbtuqkxxi") - .withSecondaryIpv4Prefix("gxql") - .withSecondaryIpv6Prefix("k") - .withMtu(750981171) - .withVlanId(570361576) - .withPeerAsn(5680957003254900576L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(615725522).withMultiplier(1037262158)) - .withIngressAclId("yksyimyccgrvkcx") - .withEgressAclId("nnuifersej")) - .withImportRoutePolicyId("jgxieqfkyfh") - .withExportRoutePolicyId("vjaqu") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("ynvskpajbmgeume") - .withImportIpv6RoutePolicyId("jbxcbccwkqmtxa")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("iscr") - .withExportIpv6RoutePolicyId("lgftrqrejdaa")); - model = BinaryData.fromObject(model).toObject(ExternalNetworkPatchProperties.class); - Assertions.assertEquals("qimlda", model.annotation()); - Assertions.assertEquals(PeeringOption.OPTIONA, model.peeringOption()); - Assertions.assertEquals("aatsdohzniucb", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("nkgfcfdr", model.optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals("okvjgbzsxebrslt", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("rholhujbfwxi", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("htbbzj", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("jecoh", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("prkjg", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("rjmwvvbtuqkxxi", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("gxql", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("k", model.optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(750981171, model.optionAProperties().mtu()); - Assertions.assertEquals(570361576, model.optionAProperties().vlanId()); - Assertions.assertEquals(5680957003254900576L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(615725522, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1037262158, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("yksyimyccgrvkcx", model.optionAProperties().ingressAclId()); - Assertions.assertEquals("nnuifersej", model.optionAProperties().egressAclId()); - Assertions.assertEquals("jgxieqfkyfh", model.importRoutePolicyId()); - Assertions.assertEquals("vjaqu", model.exportRoutePolicyId()); - Assertions.assertEquals("ynvskpajbmgeume", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("jbxcbccwkqmtxa", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("iscr", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("lgftrqrejdaa", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchTests.java deleted file mode 100644 index 0317248a1729..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchTests.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPatch; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPatchPropertiesOptionAProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExternalNetworkPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalNetworkPatch model = - BinaryData - .fromString( - "{\"properties\":{\"peeringOption\":\"OptionB\",\"optionBProperties\":{\"importRouteTargets\":[\"pztgazwyqejgaaok\"],\"exportRouteTargets\":[\"kppgkqzkcyzm\",\"fngdyfcixr\",\"lcqvhoejgoiutgw\",\"mkahpqha\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"a\"],\"importIpv6RouteTargets\":[\"ncogmipnmliqmvlb\",\"i\",\"eaqgrvgpomxpupd\"],\"exportIpv4RouteTargets\":[\"fjyi\"],\"exportIpv6RouteTargets\":[\"cwiqbuout\",\"py\",\"gleofjsbgbw\",\"zvdajfwnncf\"]}},\"optionAProperties\":{\"mtu\":749238965,\"vlanId\":615886837,\"fabricASN\":8813392024271979294,\"peerASN\":932324930477699546,\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":191025372,\"multiplier\":354836266},\"ingressAclId\":\"ougu\",\"egressAclId\":\"n\",\"primaryIpv4Prefix\":\"pg\",\"primaryIpv6Prefix\":\"tbasu\",\"secondaryIpv4Prefix\":\"ap\",\"secondaryIpv6Prefix\":\"n\"},\"importRoutePolicyId\":\"eaqbkixv\",\"exportRoutePolicyId\":\"wy\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"bfqvzfjmspu\",\"importIpv6RoutePolicyId\":\"feuzjljmphfkye\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"gj\",\"exportIpv6RoutePolicyId\":\"icuydoccn\"},\"annotation\":\"hanzbuiad\"}}") - .toObject(ExternalNetworkPatch.class); - Assertions.assertEquals(PeeringOption.OPTIONB, model.peeringOption()); - Assertions.assertEquals("pztgazwyqejgaaok", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("kppgkqzkcyzm", model.optionBProperties().exportRouteTargets().get(0)); - Assertions.assertEquals("a", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("ncogmipnmliqmvlb", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("fjyi", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("cwiqbuout", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("pg", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("tbasu", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("ap", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("n", model.optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(749238965, model.optionAProperties().mtu()); - Assertions.assertEquals(615886837, model.optionAProperties().vlanId()); - Assertions.assertEquals(932324930477699546L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(191025372, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(354836266, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("ougu", model.optionAProperties().ingressAclId()); - Assertions.assertEquals("n", model.optionAProperties().egressAclId()); - Assertions.assertEquals("eaqbkixv", model.importRoutePolicyId()); - Assertions.assertEquals("wy", model.exportRoutePolicyId()); - Assertions.assertEquals("bfqvzfjmspu", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("feuzjljmphfkye", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("gj", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("icuydoccn", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("hanzbuiad", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalNetworkPatch model = - new ExternalNetworkPatch() - .withPeeringOption(PeeringOption.OPTIONB) - .withOptionBProperties( - new L3OptionBProperties() - .withImportRouteTargets(Arrays.asList("pztgazwyqejgaaok")) - .withExportRouteTargets( - Arrays.asList("kppgkqzkcyzm", "fngdyfcixr", "lcqvhoejgoiutgw", "mkahpqha")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("a")) - .withImportIpv6RouteTargets(Arrays.asList("ncogmipnmliqmvlb", "i", "eaqgrvgpomxpupd")) - .withExportIpv4RouteTargets(Arrays.asList("fjyi")) - .withExportIpv6RouteTargets( - Arrays.asList("cwiqbuout", "py", "gleofjsbgbw", "zvdajfwnncf")))) - .withOptionAProperties( - new ExternalNetworkPatchPropertiesOptionAProperties() - .withPrimaryIpv4Prefix("pg") - .withPrimaryIpv6Prefix("tbasu") - .withSecondaryIpv4Prefix("ap") - .withSecondaryIpv6Prefix("n") - .withMtu(749238965) - .withVlanId(615886837) - .withPeerAsn(932324930477699546L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(191025372).withMultiplier(354836266)) - .withIngressAclId("ougu") - .withEgressAclId("n")) - .withImportRoutePolicyId("eaqbkixv") - .withExportRoutePolicyId("wy") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("bfqvzfjmspu") - .withImportIpv6RoutePolicyId("feuzjljmphfkye")) - .withExportRoutePolicy( - new ExportRoutePolicy().withExportIpv4RoutePolicyId("gj").withExportIpv6RoutePolicyId("icuydoccn")) - .withAnnotation("hanzbuiad"); - model = BinaryData.fromObject(model).toObject(ExternalNetworkPatch.class); - Assertions.assertEquals(PeeringOption.OPTIONB, model.peeringOption()); - Assertions.assertEquals("pztgazwyqejgaaok", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("kppgkqzkcyzm", model.optionBProperties().exportRouteTargets().get(0)); - Assertions.assertEquals("a", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("ncogmipnmliqmvlb", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("fjyi", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("cwiqbuout", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("pg", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("tbasu", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("ap", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("n", model.optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(749238965, model.optionAProperties().mtu()); - Assertions.assertEquals(615886837, model.optionAProperties().vlanId()); - Assertions.assertEquals(932324930477699546L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(191025372, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(354836266, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("ougu", model.optionAProperties().ingressAclId()); - Assertions.assertEquals("n", model.optionAProperties().egressAclId()); - Assertions.assertEquals("eaqbkixv", model.importRoutePolicyId()); - Assertions.assertEquals("wy", model.exportRoutePolicyId()); - Assertions.assertEquals("bfqvzfjmspu", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("feuzjljmphfkye", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("gj", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("icuydoccn", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("hanzbuiad", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchablePropertiesTests.java deleted file mode 100644 index 7c9fc06d4f20..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPatchablePropertiesTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import org.junit.jupiter.api.Assertions; - -public final class ExternalNetworkPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalNetworkPatchableProperties model = - BinaryData - .fromString( - "{\"importRoutePolicyId\":\"euscplhyv\",\"exportRoutePolicyId\":\"xlyzkxit\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"ezsvkolrupjov\",\"importIpv6RoutePolicyId\":\"zsayebrazw\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"zbtz\",\"exportIpv6RoutePolicyId\":\"kykipfsdyepfnoc\"}}") - .toObject(ExternalNetworkPatchableProperties.class); - Assertions.assertEquals("euscplhyv", model.importRoutePolicyId()); - Assertions.assertEquals("xlyzkxit", model.exportRoutePolicyId()); - Assertions.assertEquals("ezsvkolrupjov", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("zsayebrazw", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("zbtz", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("kykipfsdyepfnoc", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalNetworkPatchableProperties model = - new ExternalNetworkPatchableProperties() - .withImportRoutePolicyId("euscplhyv") - .withExportRoutePolicyId("xlyzkxit") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("ezsvkolrupjov") - .withImportIpv6RoutePolicyId("zsayebrazw")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("zbtz") - .withExportIpv6RoutePolicyId("kykipfsdyepfnoc")); - model = BinaryData.fromObject(model).toObject(ExternalNetworkPatchableProperties.class); - Assertions.assertEquals("euscplhyv", model.importRoutePolicyId()); - Assertions.assertEquals("xlyzkxit", model.exportRoutePolicyId()); - Assertions.assertEquals("ezsvkolrupjov", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("zsayebrazw", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("zbtz", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("kykipfsdyepfnoc", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPropertiesOptionAPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPropertiesOptionAPropertiesTests.java deleted file mode 100644 index 2191b73f23d1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPropertiesOptionAPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties; -import org.junit.jupiter.api.Assertions; - -public final class ExternalNetworkPropertiesOptionAPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalNetworkPropertiesOptionAProperties model = - BinaryData - .fromString( - "{\"mtu\":26197066,\"vlanId\":964103530,\"fabricASN\":3205216102887519977,\"peerASN\":6279545175956457599,\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":273654247,\"multiplier\":1068309041},\"ingressAclId\":\"bsr\",\"egressAclId\":\"dylperpilttjzgc\",\"primaryIpv4Prefix\":\"cmfpfbodet\",\"primaryIpv6Prefix\":\"sr\",\"secondaryIpv4Prefix\":\"tshuvftwaivm\",\"secondaryIpv6Prefix\":\"kevz\"}") - .toObject(ExternalNetworkPropertiesOptionAProperties.class); - Assertions.assertEquals("cmfpfbodet", model.primaryIpv4Prefix()); - Assertions.assertEquals("sr", model.primaryIpv6Prefix()); - Assertions.assertEquals("tshuvftwaivm", model.secondaryIpv4Prefix()); - Assertions.assertEquals("kevz", model.secondaryIpv6Prefix()); - Assertions.assertEquals(26197066, model.mtu()); - Assertions.assertEquals(964103530, model.vlanId()); - Assertions.assertEquals(6279545175956457599L, model.peerAsn()); - Assertions.assertEquals(273654247, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1068309041, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("bsr", model.ingressAclId()); - Assertions.assertEquals("dylperpilttjzgc", model.egressAclId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalNetworkPropertiesOptionAProperties model = - new ExternalNetworkPropertiesOptionAProperties() - .withPrimaryIpv4Prefix("cmfpfbodet") - .withPrimaryIpv6Prefix("sr") - .withSecondaryIpv4Prefix("tshuvftwaivm") - .withSecondaryIpv6Prefix("kevz") - .withMtu(26197066) - .withVlanId(964103530) - .withPeerAsn(6279545175956457599L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(273654247).withMultiplier(1068309041)) - .withIngressAclId("bsr") - .withEgressAclId("dylperpilttjzgc"); - model = BinaryData.fromObject(model).toObject(ExternalNetworkPropertiesOptionAProperties.class); - Assertions.assertEquals("cmfpfbodet", model.primaryIpv4Prefix()); - Assertions.assertEquals("sr", model.primaryIpv6Prefix()); - Assertions.assertEquals("tshuvftwaivm", model.secondaryIpv4Prefix()); - Assertions.assertEquals("kevz", model.secondaryIpv6Prefix()); - Assertions.assertEquals(26197066, model.mtu()); - Assertions.assertEquals(964103530, model.vlanId()); - Assertions.assertEquals(6279545175956457599L, model.peerAsn()); - Assertions.assertEquals(273654247, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1068309041, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("bsr", model.ingressAclId()); - Assertions.assertEquals("dylperpilttjzgc", model.egressAclId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPropertiesTests.java deleted file mode 100644 index fc518c99d6a9..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworkPropertiesTests.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkProperties; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExternalNetworkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalNetworkProperties model = - BinaryData - .fromString( - "{\"networkToNetworkInterconnectId\":\"jlnldpxottdiiaoc\",\"peeringOption\":\"OptionA\",\"optionBProperties\":{\"importRouteTargets\":[\"ihweeb\"],\"exportRouteTargets\":[\"ryv\",\"jw\",\"w\",\"qsratjhd\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"s\"],\"importIpv6RouteTargets\":[\"hfrzgdkkagvwukhs\",\"s\",\"mo\"],\"exportIpv4RouteTargets\":[\"zhwilzzh\",\"ijmri\",\"r\"],\"exportIpv6RouteTargets\":[\"neyttl\",\"cxiv\"]}},\"optionAProperties\":{\"mtu\":1101167829,\"vlanId\":1675553374,\"fabricASN\":8471281620008693109,\"peerASN\":3957781968769055536,\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":1287309734,\"multiplier\":528254951},\"ingressAclId\":\"vzlqywa\",\"egressAclId\":\"qnjckhmocg\",\"primaryIpv4Prefix\":\"hgouarh\",\"primaryIpv6Prefix\":\"ixq\",\"secondaryIpv4Prefix\":\"gljkybsj\",\"secondaryIpv6Prefix\":\"lrvtz\"},\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"Enabled\",\"importRoutePolicyId\":\"pjhxpcvrdn\",\"exportRoutePolicyId\":\"it\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"qady\",\"importIpv6RoutePolicyId\":\"jahwriuomzczf\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"eevsa\",\"exportIpv6RoutePolicyId\":\"wspcaxikhfjqebg\"},\"annotation\":\"xkxgzzrom\"}") - .toObject(ExternalNetworkProperties.class); - Assertions.assertEquals("xkxgzzrom", model.annotation()); - Assertions.assertEquals(PeeringOption.OPTIONA, model.peeringOption()); - Assertions.assertEquals("ihweeb", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("ryv", model.optionBProperties().exportRouteTargets().get(0)); - Assertions.assertEquals("s", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("hfrzgdkkagvwukhs", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("zhwilzzh", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("neyttl", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("hgouarh", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("ixq", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("gljkybsj", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("lrvtz", model.optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(1101167829, model.optionAProperties().mtu()); - Assertions.assertEquals(1675553374, model.optionAProperties().vlanId()); - Assertions.assertEquals(3957781968769055536L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(1287309734, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(528254951, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("vzlqywa", model.optionAProperties().ingressAclId()); - Assertions.assertEquals("qnjckhmocg", model.optionAProperties().egressAclId()); - Assertions.assertEquals("pjhxpcvrdn", model.importRoutePolicyId()); - Assertions.assertEquals("it", model.exportRoutePolicyId()); - Assertions.assertEquals("qady", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("jahwriuomzczf", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("eevsa", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("wspcaxikhfjqebg", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalNetworkProperties model = - new ExternalNetworkProperties() - .withAnnotation("xkxgzzrom") - .withPeeringOption(PeeringOption.OPTIONA) - .withOptionBProperties( - new L3OptionBProperties() - .withImportRouteTargets(Arrays.asList("ihweeb")) - .withExportRouteTargets(Arrays.asList("ryv", "jw", "w", "qsratjhd")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("s")) - .withImportIpv6RouteTargets(Arrays.asList("hfrzgdkkagvwukhs", "s", "mo")) - .withExportIpv4RouteTargets(Arrays.asList("zhwilzzh", "ijmri", "r")) - .withExportIpv6RouteTargets(Arrays.asList("neyttl", "cxiv")))) - .withOptionAProperties( - new ExternalNetworkPropertiesOptionAProperties() - .withPrimaryIpv4Prefix("hgouarh") - .withPrimaryIpv6Prefix("ixq") - .withSecondaryIpv4Prefix("gljkybsj") - .withSecondaryIpv6Prefix("lrvtz") - .withMtu(1101167829) - .withVlanId(1675553374) - .withPeerAsn(3957781968769055536L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1287309734).withMultiplier(528254951)) - .withIngressAclId("vzlqywa") - .withEgressAclId("qnjckhmocg")) - .withImportRoutePolicyId("pjhxpcvrdn") - .withExportRoutePolicyId("it") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("qady") - .withImportIpv6RoutePolicyId("jahwriuomzczf")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("eevsa") - .withExportIpv6RoutePolicyId("wspcaxikhfjqebg")); - model = BinaryData.fromObject(model).toObject(ExternalNetworkProperties.class); - Assertions.assertEquals("xkxgzzrom", model.annotation()); - Assertions.assertEquals(PeeringOption.OPTIONA, model.peeringOption()); - Assertions.assertEquals("ihweeb", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("ryv", model.optionBProperties().exportRouteTargets().get(0)); - Assertions.assertEquals("s", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("hfrzgdkkagvwukhs", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("zhwilzzh", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("neyttl", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("hgouarh", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("ixq", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("gljkybsj", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("lrvtz", model.optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(1101167829, model.optionAProperties().mtu()); - Assertions.assertEquals(1675553374, model.optionAProperties().vlanId()); - Assertions.assertEquals(3957781968769055536L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(1287309734, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(528254951, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("vzlqywa", model.optionAProperties().ingressAclId()); - Assertions.assertEquals("qnjckhmocg", model.optionAProperties().egressAclId()); - Assertions.assertEquals("pjhxpcvrdn", model.importRoutePolicyId()); - Assertions.assertEquals("it", model.exportRoutePolicyId()); - Assertions.assertEquals("qady", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("jahwriuomzczf", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("eevsa", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("wspcaxikhfjqebg", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksCreateMockTests.java deleted file mode 100644 index 446d07687eb1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksCreateMockTests.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetwork; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -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 ExternalNetworksCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"networkToNetworkInterconnectId\":\"a\",\"peeringOption\":\"OptionA\",\"optionBProperties\":{\"importRouteTargets\":[\"rofyyraiai\"],\"exportRouteTargets\":[\"ewq\",\"amptldddorzlj\",\"nxfk\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"fpilloirmvxdbktu\"],\"importIpv6RouteTargets\":[\"cj\",\"nrq\",\"znwwtkuytwii\",\"inlic\"],\"exportIpv4RouteTargets\":[\"y\",\"ioxdwffwyz\",\"ke\",\"curr\"],\"exportIpv6RouteTargets\":[\"cok\",\"d\"]}},\"optionAProperties\":{\"mtu\":1525302870,\"vlanId\":1012452621,\"fabricASN\":4579924260113513543,\"peerASN\":5552466204827853231,\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":1412875484,\"multiplier\":399962735},\"ingressAclId\":\"dvcgowrdtddd\",\"egressAclId\":\"zd\",\"primaryIpv4Prefix\":\"bcztamkyrkwsthp\",\"primaryIpv6Prefix\":\"ocffx\",\"secondaryIpv4Prefix\":\"nodqqzjbfyrosw\",\"secondaryIpv6Prefix\":\"qdf\"},\"configurationState\":\"Accepted\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"RMA\",\"importRoutePolicyId\":\"lypztuskpn\",\"exportRoutePolicyId\":\"ocl\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"jzaqbodswazburs\",\"importIpv6RoutePolicyId\":\"ffudbkvunn\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"asnzlaw\",\"exportIpv6RoutePolicyId\":\"qsnixxwdqzurv\"},\"annotation\":\"szk\"},\"id\":\"xbhhpvv\",\"name\":\"eghtmqo\",\"type\":\"xvnmcyzecuvwate\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExternalNetwork response = - manager - .externalNetworks() - .define("crktjoygynsixg") - .withExistingL3IsolationDomain("zeylz", "iimx") - .withPeeringOption(PeeringOption.OPTIONB) - .withOptionBProperties( - new L3OptionBProperties() - .withImportRouteTargets( - Arrays.asList("arbruvqbeyxwrm", "pzpex", "bhgjajkvwkocx", "bdzllvnatbgvlpg")) - .withExportRouteTargets(Arrays.asList("enfakybep")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("qieoymppglxjsfgb")) - .withImportIpv6RouteTargets(Arrays.asList("saz")) - .withExportIpv4RouteTargets(Arrays.asList("xlu", "rukhqbu", "yrbdkgqdmvvvjm")) - .withExportIpv6RouteTargets(Arrays.asList("fexuvsv")))) - .withOptionAProperties( - new ExternalNetworkPropertiesOptionAProperties() - .withPrimaryIpv4Prefix("osdpxtsdyw") - .withPrimaryIpv6Prefix("efvwgwphwxi") - .withSecondaryIpv4Prefix("wmixaqgfpuhhzwrs") - .withSecondaryIpv6Prefix("m") - .withMtu(1275827384) - .withVlanId(542898393) - .withPeerAsn(2170141583982264991L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(485391700).withMultiplier(1060922277)) - .withIngressAclId("zuuy") - .withEgressAclId("haeem")) - .withImportRoutePolicyId("mlixalphkgminhe") - .withExportRoutePolicyId("gdj") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("sngmluyrlkpis") - .withImportIpv6RoutePolicyId("rmrjpjthi")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("bcylzzietumzen") - .withExportIpv6RoutePolicyId("drue")) - .withAnnotation("exawxo") - .create(); - - Assertions.assertEquals(PeeringOption.OPTIONA, response.peeringOption()); - Assertions.assertEquals("rofyyraiai", response.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("ewq", response.optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "fpilloirmvxdbktu", response.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions.assertEquals("cj", response.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("y", response.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("cok", response.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("bcztamkyrkwsthp", response.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("ocffx", response.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("nodqqzjbfyrosw", response.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("qdf", response.optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(1525302870, response.optionAProperties().mtu()); - Assertions.assertEquals(1012452621, response.optionAProperties().vlanId()); - Assertions.assertEquals(5552466204827853231L, response.optionAProperties().peerAsn()); - Assertions.assertEquals(1412875484, response.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(399962735, response.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("dvcgowrdtddd", response.optionAProperties().ingressAclId()); - Assertions.assertEquals("zd", response.optionAProperties().egressAclId()); - Assertions.assertEquals("lypztuskpn", response.importRoutePolicyId()); - Assertions.assertEquals("ocl", response.exportRoutePolicyId()); - Assertions.assertEquals("jzaqbodswazburs", response.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("ffudbkvunn", response.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("asnzlaw", response.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("qsnixxwdqzurv", response.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("szk", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksGetWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksGetWithResponseMockTests.java deleted file mode 100644 index 1ca43ceb327e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksGetWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetwork; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -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 ExternalNetworksGetWithResponseMockTests { - @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\":{\"networkToNetworkInterconnectId\":\"wfpo\",\"peeringOption\":\"OptionB\",\"optionBProperties\":{\"importRouteTargets\":[\"zzwncs\",\"gfxvchmuby\",\"uqhgnmsvjfgrpryy\"],\"exportRouteTargets\":[\"bajxj\",\"bvyrkbuatxkznl\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"xogkevdayvxzkxi\",\"mz\",\"r\"],\"importIpv6RouteTargets\":[\"alrjwaez\",\"lybspsbomt\",\"epzimfc\"],\"exportIpv4RouteTargets\":[\"iwe\",\"pasckpgb\",\"lyxbwslxg\"],\"exportIpv6RouteTargets\":[\"toejtqv\",\"ctm\",\"idkxz\"]}},\"optionAProperties\":{\"mtu\":391685838,\"vlanId\":619844367,\"fabricASN\":4813601493528917126,\"peerASN\":2386005604905100544,\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":538812984,\"multiplier\":1215668659},\"ingressAclId\":\"err\",\"egressAclId\":\"fmfvmjjfzi\",\"primaryIpv4Prefix\":\"lbiqq\",\"primaryIpv6Prefix\":\"arxknfvbsym\",\"secondaryIpv4Prefix\":\"bahdbtjm\",\"secondaryIpv6Prefix\":\"zonrklbizrxh\"},\"configurationState\":\"Rejected\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"RMA\",\"importRoutePolicyId\":\"oqovvcxgqt\",\"exportRoutePolicyId\":\"ir\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"g\",\"importIpv6RoutePolicyId\":\"tucujtjuzvyjxu\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"quoqhqrcsk\",\"exportIpv6RoutePolicyId\":\"qfhlrvuvd\"},\"annotation\":\"vyjcdpncvfyeqyod\"},\"id\":\"ijcsapqhipajs\",\"name\":\"ivnmev\",\"type\":\"jb\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExternalNetwork response = - manager - .externalNetworks() - .getWithResponse("exccwldgfq", "ywmwtacrscfc", "crvjcull", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PeeringOption.OPTIONB, response.peeringOption()); - Assertions.assertEquals("zzwncs", response.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("bajxj", response.optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "xogkevdayvxzkxi", response.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("alrjwaez", response.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("iwe", response.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("toejtqv", response.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("lbiqq", response.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("arxknfvbsym", response.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("bahdbtjm", response.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("zonrklbizrxh", response.optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(391685838, response.optionAProperties().mtu()); - Assertions.assertEquals(619844367, response.optionAProperties().vlanId()); - Assertions.assertEquals(2386005604905100544L, response.optionAProperties().peerAsn()); - Assertions.assertEquals(538812984, response.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1215668659, response.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("err", response.optionAProperties().ingressAclId()); - Assertions.assertEquals("fmfvmjjfzi", response.optionAProperties().egressAclId()); - Assertions.assertEquals("oqovvcxgqt", response.importRoutePolicyId()); - Assertions.assertEquals("ir", response.exportRoutePolicyId()); - Assertions.assertEquals("g", response.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("tucujtjuzvyjxu", response.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("quoqhqrcsk", response.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("qfhlrvuvd", response.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("vyjcdpncvfyeqyod", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksListByL3IsolationDomainMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksListByL3IsolationDomainMockTests.java deleted file mode 100644 index e37dae73e396..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksListByL3IsolationDomainMockTests.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetwork; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -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 ExternalNetworksListByL3IsolationDomainMockTests { - @Test - public void testListByL3IsolationDomain() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"networkToNetworkInterconnectId\":\"gctygbbmu\",\"peeringOption\":\"OptionB\",\"optionBProperties\":{\"importRouteTargets\":[\"crsm\",\"ojmxwc\",\"umnru\",\"q\"],\"exportRouteTargets\":[\"qjftvltj\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"vpkbz\",\"tnowpajfhxsmu\"],\"importIpv6RouteTargets\":[\"adzglm\",\"uzpsuhs\",\"pxm\"],\"exportIpv4RouteTargets\":[\"hfrerkqpyfjxkb\"],\"exportIpv6RouteTargets\":[\"buq\",\"mxbdjkmn\"]}},\"optionAProperties\":{\"mtu\":1668571308,\"vlanId\":735928963,\"fabricASN\":2048786040696358626,\"peerASN\":8143716610874917650,\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":1291322883,\"multiplier\":818358311},\"ingressAclId\":\"btycvl\",\"egressAclId\":\"sgiikh\",\"primaryIpv4Prefix\":\"thypepxshmrd\",\"primaryIpv6Prefix\":\"csdvkymktc\",\"secondaryIpv4Prefix\":\"ivoxgzegnglafnf\",\"secondaryIpv6Prefix\":\"zaghddc\"},\"configurationState\":\"Failed\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"Enabled\",\"importRoutePolicyId\":\"rutuh\",\"exportRoutePolicyId\":\"mgxlssolqyp\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"lxo\",\"importIpv6RoutePolicyId\":\"rkqvrv\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"jc\",\"exportIpv6RoutePolicyId\":\"fcm\"},\"annotation\":\"jpj\"},\"id\":\"kjd\",\"name\":\"uod\",\"type\":\"cg\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .externalNetworks() - .listByL3IsolationDomain("uwrfgpjfvqwk", "eodvlmdzgvcykz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PeeringOption.OPTIONB, response.iterator().next().peeringOption()); - Assertions.assertEquals("crsm", response.iterator().next().optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("qjftvltj", response.iterator().next().optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "vpkbz", response.iterator().next().optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "adzglm", - response.iterator().next().optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions - .assertEquals( - "hfrerkqpyfjxkb", - response.iterator().next().optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "buq", response.iterator().next().optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("thypepxshmrd", response.iterator().next().optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("csdvkymktc", response.iterator().next().optionAProperties().primaryIpv6Prefix()); - Assertions - .assertEquals("ivoxgzegnglafnf", response.iterator().next().optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("zaghddc", response.iterator().next().optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(1668571308, response.iterator().next().optionAProperties().mtu()); - Assertions.assertEquals(735928963, response.iterator().next().optionAProperties().vlanId()); - Assertions.assertEquals(8143716610874917650L, response.iterator().next().optionAProperties().peerAsn()); - Assertions - .assertEquals( - 1291322883, response.iterator().next().optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals(818358311, response.iterator().next().optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("btycvl", response.iterator().next().optionAProperties().ingressAclId()); - Assertions.assertEquals("sgiikh", response.iterator().next().optionAProperties().egressAclId()); - Assertions.assertEquals("rutuh", response.iterator().next().importRoutePolicyId()); - Assertions.assertEquals("mgxlssolqyp", response.iterator().next().exportRoutePolicyId()); - Assertions.assertEquals("lxo", response.iterator().next().importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("rkqvrv", response.iterator().next().importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("jc", response.iterator().next().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("fcm", response.iterator().next().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("jpj", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksListTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksListTests.java deleted file mode 100644 index b44c5ad3fc62..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksListTests.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkInner; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworksList; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExternalNetworksListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalNetworksList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"networkToNetworkInterconnectId\":\"wjxildfkcefeyg\",\"peeringOption\":\"OptionA\",\"optionBProperties\":{\"importRouteTargets\":[\"isf\",\"naybdjnxu\",\"entq\"],\"exportRouteTargets\":[\"why\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"ulwivqtowlhlsy\"],\"importIpv6RouteTargets\":[\"bajasqubfajcy\",\"hjqwmchqoh\",\"fxcpupukiym\"],\"exportIpv4RouteTargets\":[\"wdlvwtiwsmosaon\",\"qnamppultassa\"],\"exportIpv6RouteTargets\":[\"wnaze\",\"jb\",\"aj\",\"cyizy\"]}},\"optionAProperties\":{\"mtu\":189759629,\"vlanId\":450716443,\"fabricASN\":3845239989402943033,\"peerASN\":5873155808619890798,\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":1751656917,\"multiplier\":990264400},\"ingressAclId\":\"lvgecpwgoljtz\",\"egressAclId\":\"mxsdobygoog\",\"primaryIpv4Prefix\":\"apjxvazyjfucsao\",\"primaryIpv6Prefix\":\"nosdkvi\",\"secondaryIpv4Prefix\":\"asgmatrnzpd\",\"secondaryIpv6Prefix\":\"daaktuj\"},\"configurationState\":\"ErrorProvisioning\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"Enabled\",\"importRoutePolicyId\":\"fpqdow\",\"exportRoutePolicyId\":\"pnw\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"fvpctfji\",\"importIpv6RoutePolicyId\":\"ff\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"uhznwhvuldbk\",\"exportIpv6RoutePolicyId\":\"jjkj\"},\"annotation\":\"awgazmxjqifh\"},\"id\":\"jjsbcmlzaahzbhur\",\"name\":\"olk\",\"type\":\"lirh\"},{\"properties\":{\"networkToNetworkInterconnectId\":\"ojusuzgfjzcva\",\"peeringOption\":\"OptionA\",\"optionBProperties\":{\"importRouteTargets\":[\"lahfxwccokdxk\",\"kmkcz\"],\"exportRouteTargets\":[\"h\",\"oq\",\"qshavlj\",\"k\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"olnthb\",\"nkgzukwdr\",\"zkjthfceyjn\"],\"importIpv6RouteTargets\":[\"lfuyfjbpfiddhlr\",\"fz\",\"qyjmqrfuioc\"],\"exportIpv4RouteTargets\":[\"lqkrs\"],\"exportIpv6RouteTargets\":[\"hxuddqm\",\"tffisjmr\",\"khmwdmd\"]}},\"optionAProperties\":{\"mtu\":265964449,\"vlanId\":2087425437,\"fabricASN\":655413510150403056,\"peerASN\":4600830996687692127,\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":1605627169,\"multiplier\":1087757375},\"ingressAclId\":\"qqdlcvmyolcay\",\"egressAclId\":\"chtvsnvlaqd\",\"primaryIpv4Prefix\":\"yzawatu\",\"primaryIpv6Prefix\":\"kokb\",\"secondaryIpv4Prefix\":\"othymgobl\",\"secondaryIpv6Prefix\":\"snwgwimaa\"},\"configurationState\":\"Succeeded\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Disabled\",\"importRoutePolicyId\":\"obcyanrfvqtvk\",\"exportRoutePolicyId\":\"voogxkfna\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"ymhcctopuo\",\"importIpv6RoutePolicyId\":\"rnskby\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"hczygxvhajpxe\",\"exportIpv6RoutePolicyId\":\"qnwhscozawmvg\"},\"annotation\":\"mpk\"},\"id\":\"pwirfljfewxqouo\",\"name\":\"ud\",\"type\":\"mckaprh\"}],\"nextLink\":\"qiijgenc\"}") - .toObject(ExternalNetworksList.class); - Assertions.assertEquals(PeeringOption.OPTIONA, model.value().get(0).peeringOption()); - Assertions.assertEquals("isf", model.value().get(0).optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("why", model.value().get(0).optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "ulwivqtowlhlsy", - model.value().get(0).optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "bajasqubfajcy", - model.value().get(0).optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions - .assertEquals( - "wdlvwtiwsmosaon", - model.value().get(0).optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "wnaze", model.value().get(0).optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("apjxvazyjfucsao", model.value().get(0).optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("nosdkvi", model.value().get(0).optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("asgmatrnzpd", model.value().get(0).optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("daaktuj", model.value().get(0).optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(189759629, model.value().get(0).optionAProperties().mtu()); - Assertions.assertEquals(450716443, model.value().get(0).optionAProperties().vlanId()); - Assertions.assertEquals(5873155808619890798L, model.value().get(0).optionAProperties().peerAsn()); - Assertions - .assertEquals( - 1751656917, model.value().get(0).optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(990264400, model.value().get(0).optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("lvgecpwgoljtz", model.value().get(0).optionAProperties().ingressAclId()); - Assertions.assertEquals("mxsdobygoog", model.value().get(0).optionAProperties().egressAclId()); - Assertions.assertEquals("fpqdow", model.value().get(0).importRoutePolicyId()); - Assertions.assertEquals("pnw", model.value().get(0).exportRoutePolicyId()); - Assertions.assertEquals("fvpctfji", model.value().get(0).importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("ff", model.value().get(0).importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("uhznwhvuldbk", model.value().get(0).exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("jjkj", model.value().get(0).exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("awgazmxjqifh", model.value().get(0).annotation()); - Assertions.assertEquals("qiijgenc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalNetworksList model = - new ExternalNetworksList() - .withValue( - Arrays - .asList( - new ExternalNetworkInner() - .withPeeringOption(PeeringOption.OPTIONA) - .withOptionBProperties( - new L3OptionBProperties() - .withImportRouteTargets(Arrays.asList("isf", "naybdjnxu", "entq")) - .withExportRouteTargets(Arrays.asList("why")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("ulwivqtowlhlsy")) - .withImportIpv6RouteTargets( - Arrays.asList("bajasqubfajcy", "hjqwmchqoh", "fxcpupukiym")) - .withExportIpv4RouteTargets( - Arrays.asList("wdlvwtiwsmosaon", "qnamppultassa")) - .withExportIpv6RouteTargets( - Arrays.asList("wnaze", "jb", "aj", "cyizy")))) - .withOptionAProperties( - new ExternalNetworkPropertiesOptionAProperties() - .withPrimaryIpv4Prefix("apjxvazyjfucsao") - .withPrimaryIpv6Prefix("nosdkvi") - .withSecondaryIpv4Prefix("asgmatrnzpd") - .withSecondaryIpv6Prefix("daaktuj") - .withMtu(189759629) - .withVlanId(450716443) - .withPeerAsn(5873155808619890798L) - .withBfdConfiguration( - new BfdConfiguration() - .withIntervalInMilliSeconds(1751656917) - .withMultiplier(990264400)) - .withIngressAclId("lvgecpwgoljtz") - .withEgressAclId("mxsdobygoog")) - .withImportRoutePolicyId("fpqdow") - .withExportRoutePolicyId("pnw") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("fvpctfji") - .withImportIpv6RoutePolicyId("ff")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("uhznwhvuldbk") - .withExportIpv6RoutePolicyId("jjkj")) - .withAnnotation("awgazmxjqifh"), - new ExternalNetworkInner() - .withPeeringOption(PeeringOption.OPTIONA) - .withOptionBProperties( - new L3OptionBProperties() - .withImportRouteTargets(Arrays.asList("lahfxwccokdxk", "kmkcz")) - .withExportRouteTargets(Arrays.asList("h", "oq", "qshavlj", "k")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets( - Arrays.asList("olnthb", "nkgzukwdr", "zkjthfceyjn")) - .withImportIpv6RouteTargets( - Arrays.asList("lfuyfjbpfiddhlr", "fz", "qyjmqrfuioc")) - .withExportIpv4RouteTargets(Arrays.asList("lqkrs")) - .withExportIpv6RouteTargets( - Arrays.asList("hxuddqm", "tffisjmr", "khmwdmd")))) - .withOptionAProperties( - new ExternalNetworkPropertiesOptionAProperties() - .withPrimaryIpv4Prefix("yzawatu") - .withPrimaryIpv6Prefix("kokb") - .withSecondaryIpv4Prefix("othymgobl") - .withSecondaryIpv6Prefix("snwgwimaa") - .withMtu(265964449) - .withVlanId(2087425437) - .withPeerAsn(4600830996687692127L) - .withBfdConfiguration( - new BfdConfiguration() - .withIntervalInMilliSeconds(1605627169) - .withMultiplier(1087757375)) - .withIngressAclId("qqdlcvmyolcay") - .withEgressAclId("chtvsnvlaqd")) - .withImportRoutePolicyId("obcyanrfvqtvk") - .withExportRoutePolicyId("voogxkfna") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("ymhcctopuo") - .withImportIpv6RoutePolicyId("rnskby")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("hczygxvhajpxe") - .withExportIpv6RoutePolicyId("qnwhscozawmvg")) - .withAnnotation("mpk"))) - .withNextLink("qiijgenc"); - model = BinaryData.fromObject(model).toObject(ExternalNetworksList.class); - Assertions.assertEquals(PeeringOption.OPTIONA, model.value().get(0).peeringOption()); - Assertions.assertEquals("isf", model.value().get(0).optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("why", model.value().get(0).optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "ulwivqtowlhlsy", - model.value().get(0).optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "bajasqubfajcy", - model.value().get(0).optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions - .assertEquals( - "wdlvwtiwsmosaon", - model.value().get(0).optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "wnaze", model.value().get(0).optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals("apjxvazyjfucsao", model.value().get(0).optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("nosdkvi", model.value().get(0).optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("asgmatrnzpd", model.value().get(0).optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("daaktuj", model.value().get(0).optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals(189759629, model.value().get(0).optionAProperties().mtu()); - Assertions.assertEquals(450716443, model.value().get(0).optionAProperties().vlanId()); - Assertions.assertEquals(5873155808619890798L, model.value().get(0).optionAProperties().peerAsn()); - Assertions - .assertEquals( - 1751656917, model.value().get(0).optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(990264400, model.value().get(0).optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("lvgecpwgoljtz", model.value().get(0).optionAProperties().ingressAclId()); - Assertions.assertEquals("mxsdobygoog", model.value().get(0).optionAProperties().egressAclId()); - Assertions.assertEquals("fpqdow", model.value().get(0).importRoutePolicyId()); - Assertions.assertEquals("pnw", model.value().get(0).exportRoutePolicyId()); - Assertions.assertEquals("fvpctfji", model.value().get(0).importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("ff", model.value().get(0).importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("uhznwhvuldbk", model.value().get(0).exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("jjkj", model.value().get(0).exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("awgazmxjqifh", model.value().get(0).annotation()); - Assertions.assertEquals("qiijgenc", model.nextLink()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateAdministrativeStateMockTests.java deleted file mode 100644 index a1773c35b830..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExternalNetworksUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Succeeded\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .externalNetworks() - .updateAdministrativeState( - "u", - "xnyx", - "mqds", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("n", "qikdipkxsqkuzabr")) - .withState(EnableDisableState.DISABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateStaticRouteBfdAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateStaticRouteBfdAdministrativeStateMockTests.java deleted file mode 100644 index bb1a854ee18f..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateStaticRouteBfdAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExternalNetworksUpdateStaticRouteBfdAdministrativeStateMockTests { - @Test - public void testUpdateStaticRouteBfdAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"ErrorDeprovisioning\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .externalNetworks() - .updateStaticRouteBfdAdministrativeState( - "atajdtacvsynss", - "ylsuioado", - "sjyiehkxgfuzq", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("lxqdsx", "p", "nlbyitfz")) - .withState(EnableDisableState.DISABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ImportRoutePolicyInformationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ImportRoutePolicyInformationTests.java deleted file mode 100644 index 35fdbb6e5783..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ImportRoutePolicyInformationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicyInformation; -import org.junit.jupiter.api.Assertions; - -public final class ImportRoutePolicyInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImportRoutePolicyInformation model = - BinaryData - .fromString("{\"importIpv4RoutePolicyId\":\"pejovt\",\"importIpv6RoutePolicyId\":\"xnhwh\"}") - .toObject(ImportRoutePolicyInformation.class); - Assertions.assertEquals("pejovt", model.importIpv4RoutePolicyId()); - Assertions.assertEquals("xnhwh", model.importIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImportRoutePolicyInformation model = - new ImportRoutePolicyInformation() - .withImportIpv4RoutePolicyId("pejovt") - .withImportIpv6RoutePolicyId("xnhwh"); - model = BinaryData.fromObject(model).toObject(ImportRoutePolicyInformation.class); - Assertions.assertEquals("pejovt", model.importIpv4RoutePolicyId()); - Assertions.assertEquals("xnhwh", model.importIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ImportRoutePolicyTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ImportRoutePolicyTests.java deleted file mode 100644 index 5ed2dcefd24c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ImportRoutePolicyTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import org.junit.jupiter.api.Assertions; - -public final class ImportRoutePolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImportRoutePolicy model = - BinaryData - .fromString("{\"importIpv4RoutePolicyId\":\"haxd\",\"importIpv6RoutePolicyId\":\"zaehpphthd\"}") - .toObject(ImportRoutePolicy.class); - Assertions.assertEquals("haxd", model.importIpv4RoutePolicyId()); - Assertions.assertEquals("zaehpphthd", model.importIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImportRoutePolicy model = - new ImportRoutePolicy().withImportIpv4RoutePolicyId("haxd").withImportIpv6RoutePolicyId("zaehpphthd"); - model = BinaryData.fromObject(model).toObject(ImportRoutePolicy.class); - Assertions.assertEquals("haxd", model.importIpv4RoutePolicyId()); - Assertions.assertEquals("zaehpphthd", model.importIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkInnerTests.java deleted file mode 100644 index 8755ceffad09..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkInnerTests.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkInner; -import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.Extension; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPropertiesBgpConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPropertiesStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.IsMonitoringEnabled; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InternalNetworkInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternalNetworkInner model = - BinaryData - .fromString( - "{\"properties\":{\"vlanId\":618849667,\"bgpConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":844410077,\"multiplier\":518669807},\"defaultRouteOriginate\":\"False\",\"allowAS\":814563749,\"allowASOverride\":\"Enable\",\"fabricASN\":6282947498031082528,\"peerASN\":7342344521942896071,\"ipv4ListenRangePrefixes\":[\"kwhbgxve\",\"lvulnxdmnitmujdt\",\"mcl\",\"ymffhmjpddnyx\"],\"ipv6ListenRangePrefixes\":[\"v\",\"zmzqmzjqrb\",\"pv\",\"mdyfoebojtj\"],\"ipv4NeighborAddress\":[{\"address\":\"aohoqkpjtnq\",\"configurationState\":\"Rejected\"}],\"ipv6NeighborAddress\":[{\"address\":\"kdcwmqsyrilmhx\",\"configurationState\":\"Deprovisioning\"},{\"address\":\"lfylnkkbjpjvlyw\",\"configurationState\":\"Failed\"},{\"address\":\"wob\",\"configurationState\":\"Accepted\"}],\"annotation\":\"lwyjfnqzocrdz\"},\"staticRouteConfiguration\":{\"extension\":\"NPB\",\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":2043111108,\"multiplier\":1214725859},\"ipv4Routes\":[{\"prefix\":\"q\",\"nextHop\":[\"iekoif\",\"vnyttzgi\",\"gyrihlgm\",\"behlqtxnr\"]},{\"prefix\":\"lkndrndpgfjodh\",\"nextHop\":[\"qotwfh\",\"pxwgsa\",\"vcipo\",\"zafczuumljci\"]}],\"ipv6Routes\":[{\"prefix\":\"efy\",\"nextHop\":[\"veitit\"]},{\"prefix\":\"nsxzajlns\",\"nextHop\":[\"wjuyxx\",\"xqvmvuay\",\"uadx\",\"xeqbwp\"]}]},\"configurationState\":\"Accepted\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"Enabled\",\"mtu\":1797006304,\"connectedIPv4Subnets\":[{\"prefix\":\"rnxsluvlzlad\",\"annotation\":\"x\"},{\"prefix\":\"pbqhvfdqqjwkr\",\"annotation\":\"zdanojis\"},{\"prefix\":\"glmvoka\",\"annotation\":\"ztjctibpvbkae\"}],\"connectedIPv6Subnets\":[{\"prefix\":\"mzy\",\"annotation\":\"fwakw\"}],\"importRoutePolicyId\":\"ivmakx\",\"exportRoutePolicyId\":\"so\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"ux\",\"importIpv6RoutePolicyId\":\"bectvtfjmskdch\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"ubavlzwp\",\"exportIpv6RoutePolicyId\":\"mfalkzazmgok\"},\"ingressAclId\":\"gjqafkmkrokzr\",\"egressAclId\":\"qetwpqrtvaozn\",\"isMonitoringEnabled\":\"True\",\"extension\":\"NoExtension\",\"annotation\":\"zeagmceituuge\"},\"id\":\"fpjstlzmb\",\"name\":\"syjdeolctae\",\"type\":\"fsyrledjc\"}") - .toObject(InternalNetworkInner.class); - Assertions.assertEquals(618849667, model.vlanId()); - Assertions.assertEquals("lwyjfnqzocrdz", model.bgpConfiguration().annotation()); - Assertions.assertEquals(844410077, model.bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(518669807, model.bgpConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(814563749, model.bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.ENABLE, model.bgpConfiguration().allowASOverride()); - Assertions.assertEquals(7342344521942896071L, model.bgpConfiguration().peerAsn()); - Assertions.assertEquals("kwhbgxve", model.bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("v", model.bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("aohoqkpjtnq", model.bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("kdcwmqsyrilmhx", model.bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals(2043111108, model.staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1214725859, model.staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("q", model.staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("iekoif", model.staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("efy", model.staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("veitit", model.staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(Extension.NPB, model.staticRouteConfiguration().extension()); - Assertions.assertEquals(1797006304, model.mtu()); - Assertions.assertEquals("x", model.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("rnxsluvlzlad", model.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("fwakw", model.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("mzy", model.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("ivmakx", model.importRoutePolicyId()); - Assertions.assertEquals("so", model.exportRoutePolicyId()); - Assertions.assertEquals("ux", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("bectvtfjmskdch", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("ubavlzwp", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("mfalkzazmgok", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("gjqafkmkrokzr", model.ingressAclId()); - Assertions.assertEquals("qetwpqrtvaozn", model.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.TRUE, model.isMonitoringEnabled()); - Assertions.assertEquals(Extension.NO_EXTENSION, model.extension()); - Assertions.assertEquals("zeagmceituuge", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternalNetworkInner model = - new InternalNetworkInner() - .withVlanId(618849667) - .withBgpConfiguration( - new InternalNetworkPropertiesBgpConfiguration() - .withAnnotation("lwyjfnqzocrdz") - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(844410077).withMultiplier(518669807)) - .withDefaultRouteOriginate(BooleanEnumProperty.FALSE) - .withAllowAS(814563749) - .withAllowASOverride(AllowASOverride.ENABLE) - .withPeerAsn(7342344521942896071L) - .withIpv4ListenRangePrefixes( - Arrays.asList("kwhbgxve", "lvulnxdmnitmujdt", "mcl", "ymffhmjpddnyx")) - .withIpv6ListenRangePrefixes(Arrays.asList("v", "zmzqmzjqrb", "pv", "mdyfoebojtj")) - .withIpv4NeighborAddress(Arrays.asList(new NeighborAddress().withAddress("aohoqkpjtnq"))) - .withIpv6NeighborAddress( - Arrays - .asList( - new NeighborAddress().withAddress("kdcwmqsyrilmhx"), - new NeighborAddress().withAddress("lfylnkkbjpjvlyw"), - new NeighborAddress().withAddress("wob")))) - .withStaticRouteConfiguration( - new InternalNetworkPropertiesStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(2043111108).withMultiplier(1214725859)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("q") - .withNextHop(Arrays.asList("iekoif", "vnyttzgi", "gyrihlgm", "behlqtxnr")), - new StaticRouteProperties() - .withPrefix("lkndrndpgfjodh") - .withNextHop(Arrays.asList("qotwfh", "pxwgsa", "vcipo", "zafczuumljci")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties().withPrefix("efy").withNextHop(Arrays.asList("veitit")), - new StaticRouteProperties() - .withPrefix("nsxzajlns") - .withNextHop(Arrays.asList("wjuyxx", "xqvmvuay", "uadx", "xeqbwp")))) - .withExtension(Extension.NPB)) - .withMtu(1797006304) - .withConnectedIPv4Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("x").withPrefix("rnxsluvlzlad"), - new ConnectedSubnet().withAnnotation("zdanojis").withPrefix("pbqhvfdqqjwkr"), - new ConnectedSubnet().withAnnotation("ztjctibpvbkae").withPrefix("glmvoka"))) - .withConnectedIPv6Subnets( - Arrays.asList(new ConnectedSubnet().withAnnotation("fwakw").withPrefix("mzy"))) - .withImportRoutePolicyId("ivmakx") - .withExportRoutePolicyId("so") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("ux") - .withImportIpv6RoutePolicyId("bectvtfjmskdch")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("ubavlzwp") - .withExportIpv6RoutePolicyId("mfalkzazmgok")) - .withIngressAclId("gjqafkmkrokzr") - .withEgressAclId("qetwpqrtvaozn") - .withIsMonitoringEnabled(IsMonitoringEnabled.TRUE) - .withExtension(Extension.NO_EXTENSION) - .withAnnotation("zeagmceituuge"); - model = BinaryData.fromObject(model).toObject(InternalNetworkInner.class); - Assertions.assertEquals(618849667, model.vlanId()); - Assertions.assertEquals("lwyjfnqzocrdz", model.bgpConfiguration().annotation()); - Assertions.assertEquals(844410077, model.bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(518669807, model.bgpConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(814563749, model.bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.ENABLE, model.bgpConfiguration().allowASOverride()); - Assertions.assertEquals(7342344521942896071L, model.bgpConfiguration().peerAsn()); - Assertions.assertEquals("kwhbgxve", model.bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("v", model.bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("aohoqkpjtnq", model.bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("kdcwmqsyrilmhx", model.bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals(2043111108, model.staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1214725859, model.staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("q", model.staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("iekoif", model.staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("efy", model.staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("veitit", model.staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(Extension.NPB, model.staticRouteConfiguration().extension()); - Assertions.assertEquals(1797006304, model.mtu()); - Assertions.assertEquals("x", model.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("rnxsluvlzlad", model.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("fwakw", model.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("mzy", model.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("ivmakx", model.importRoutePolicyId()); - Assertions.assertEquals("so", model.exportRoutePolicyId()); - Assertions.assertEquals("ux", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("bectvtfjmskdch", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("ubavlzwp", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("mfalkzazmgok", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("gjqafkmkrokzr", model.ingressAclId()); - Assertions.assertEquals("qetwpqrtvaozn", model.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.TRUE, model.isMonitoringEnabled()); - Assertions.assertEquals(Extension.NO_EXTENSION, model.extension()); - Assertions.assertEquals("zeagmceituuge", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPatchPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPatchPropertiesTests.java deleted file mode 100644 index 4fe19c980f7e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPatchPropertiesTests.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkPatchProperties; -import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BgpConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.IsMonitoringEnabled; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InternalNetworkPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternalNetworkPatchProperties model = - BinaryData - .fromString( - "{\"bgpConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":2124233094,\"multiplier\":1925412993},\"defaultRouteOriginate\":\"False\",\"allowAS\":305266096,\"allowASOverride\":\"Disable\",\"fabricASN\":5794864908821693270,\"peerASN\":3811111111100552790,\"ipv4ListenRangePrefixes\":[\"dvrgliegftcvbi\"],\"ipv6ListenRangePrefixes\":[\"ksdwgdnk\",\"fgmwd\",\"c\",\"buvczldbglzoutb\"],\"ipv4NeighborAddress\":[{\"address\":\"zeka\",\"configurationState\":\"ErrorDeprovisioning\"}],\"ipv6NeighborAddress\":[{\"address\":\"snorbjg\",\"configurationState\":\"ErrorProvisioning\"}],\"annotation\":\"otvmrxk\"},\"staticRouteConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":1278252319,\"multiplier\":857060206},\"ipv4Routes\":[{\"prefix\":\"diqayfl\",\"nextHop\":[\"yu\"]},{\"prefix\":\"snuudtelvhyibdr\",\"nextHop\":[\"swhb\",\"ubpyrow\",\"joxztfwfqchvczev\"]}],\"ipv6Routes\":[{\"prefix\":\"cta\",\"nextHop\":[\"yvrtp\",\"pemhzcgkrepdqhqy\",\"wqwemvxqabckmze\",\"xin\"]},{\"prefix\":\"greohtwhlpuzjp\",\"nextHop\":[\"eznzangprbfaxyxz\"]},{\"prefix\":\"bcip\",\"nextHop\":[\"sexroqrndkt\",\"fvo\"]},{\"prefix\":\"feeqgpkrietbgnix\",\"nextHop\":[\"wwzkyf\",\"nwpiwxeiicrm\",\"e\"]}]},\"mtu\":2097526024,\"connectedIPv4Subnets\":[{\"prefix\":\"axxijvskwsdgkjgy\",\"annotation\":\"wrasekw\"},{\"prefix\":\"fcvoinwoqar\",\"annotation\":\"yxqicladv\"},{\"prefix\":\"tdavuqmcbymsfobj\",\"annotation\":\"uvjezcjumvps\"},{\"prefix\":\"mioyo\",\"annotation\":\"l\"}],\"connectedIPv6Subnets\":[{\"prefix\":\"q\",\"annotation\":\"nracli\"},{\"prefix\":\"bfqpspkladyd\",\"annotation\":\"hautw\"},{\"prefix\":\"kexzgpmnmabeddqi\",\"annotation\":\"gdfpfqfpcvst\"},{\"prefix\":\"l\",\"annotation\":\"rvwerfwxbsmtb\"}],\"importRoutePolicyId\":\"jehhci\",\"exportRoutePolicyId\":\"wdv\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"rek\",\"importIpv6RoutePolicyId\":\"sqhtfpw\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"yejuwyqwdqigmghg\",\"exportIpv6RoutePolicyId\":\"z\"},\"ingressAclId\":\"lujkhn\",\"egressAclId\":\"mrnkfmkhcqtwml\",\"isMonitoringEnabled\":\"True\",\"annotation\":\"qtqea\"}") - .toObject(InternalNetworkPatchProperties.class); - Assertions.assertEquals("qtqea", model.annotation()); - Assertions.assertEquals("otvmrxk", model.bgpConfiguration().annotation()); - Assertions.assertEquals(2124233094, model.bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1925412993, model.bgpConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(305266096, model.bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.DISABLE, model.bgpConfiguration().allowASOverride()); - Assertions.assertEquals(3811111111100552790L, model.bgpConfiguration().peerAsn()); - Assertions.assertEquals("dvrgliegftcvbi", model.bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("ksdwgdnk", model.bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("zeka", model.bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("snorbjg", model.bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals(1278252319, model.staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(857060206, model.staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("diqayfl", model.staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("yu", model.staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("cta", model.staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("yvrtp", model.staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(2097526024, model.mtu()); - Assertions.assertEquals("wrasekw", model.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("axxijvskwsdgkjgy", model.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("nracli", model.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("q", model.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("jehhci", model.importRoutePolicyId()); - Assertions.assertEquals("wdv", model.exportRoutePolicyId()); - Assertions.assertEquals("rek", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("sqhtfpw", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("yejuwyqwdqigmghg", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("z", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("lujkhn", model.ingressAclId()); - Assertions.assertEquals("mrnkfmkhcqtwml", model.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.TRUE, model.isMonitoringEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternalNetworkPatchProperties model = - new InternalNetworkPatchProperties() - .withAnnotation("qtqea") - .withBgpConfiguration( - new BgpConfiguration() - .withAnnotation("otvmrxk") - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(2124233094).withMultiplier(1925412993)) - .withDefaultRouteOriginate(BooleanEnumProperty.FALSE) - .withAllowAS(305266096) - .withAllowASOverride(AllowASOverride.DISABLE) - .withPeerAsn(3811111111100552790L) - .withIpv4ListenRangePrefixes(Arrays.asList("dvrgliegftcvbi")) - .withIpv6ListenRangePrefixes(Arrays.asList("ksdwgdnk", "fgmwd", "c", "buvczldbglzoutb")) - .withIpv4NeighborAddress(Arrays.asList(new NeighborAddress().withAddress("zeka"))) - .withIpv6NeighborAddress(Arrays.asList(new NeighborAddress().withAddress("snorbjg")))) - .withStaticRouteConfiguration( - new StaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1278252319).withMultiplier(857060206)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties().withPrefix("diqayfl").withNextHop(Arrays.asList("yu")), - new StaticRouteProperties() - .withPrefix("snuudtelvhyibdr") - .withNextHop(Arrays.asList("swhb", "ubpyrow", "joxztfwfqchvczev")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("cta") - .withNextHop( - Arrays.asList("yvrtp", "pemhzcgkrepdqhqy", "wqwemvxqabckmze", "xin")), - new StaticRouteProperties() - .withPrefix("greohtwhlpuzjp") - .withNextHop(Arrays.asList("eznzangprbfaxyxz")), - new StaticRouteProperties() - .withPrefix("bcip") - .withNextHop(Arrays.asList("sexroqrndkt", "fvo")), - new StaticRouteProperties() - .withPrefix("feeqgpkrietbgnix") - .withNextHop(Arrays.asList("wwzkyf", "nwpiwxeiicrm", "e"))))) - .withMtu(2097526024) - .withConnectedIPv4Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("wrasekw").withPrefix("axxijvskwsdgkjgy"), - new ConnectedSubnet().withAnnotation("yxqicladv").withPrefix("fcvoinwoqar"), - new ConnectedSubnet().withAnnotation("uvjezcjumvps").withPrefix("tdavuqmcbymsfobj"), - new ConnectedSubnet().withAnnotation("l").withPrefix("mioyo"))) - .withConnectedIPv6Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("nracli").withPrefix("q"), - new ConnectedSubnet().withAnnotation("hautw").withPrefix("bfqpspkladyd"), - new ConnectedSubnet().withAnnotation("gdfpfqfpcvst").withPrefix("kexzgpmnmabeddqi"), - new ConnectedSubnet().withAnnotation("rvwerfwxbsmtb").withPrefix("l"))) - .withImportRoutePolicyId("jehhci") - .withExportRoutePolicyId("wdv") - .withImportRoutePolicy( - new ImportRoutePolicy().withImportIpv4RoutePolicyId("rek").withImportIpv6RoutePolicyId("sqhtfpw")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("yejuwyqwdqigmghg") - .withExportIpv6RoutePolicyId("z")) - .withIngressAclId("lujkhn") - .withEgressAclId("mrnkfmkhcqtwml") - .withIsMonitoringEnabled(IsMonitoringEnabled.TRUE); - model = BinaryData.fromObject(model).toObject(InternalNetworkPatchProperties.class); - Assertions.assertEquals("qtqea", model.annotation()); - Assertions.assertEquals("otvmrxk", model.bgpConfiguration().annotation()); - Assertions.assertEquals(2124233094, model.bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1925412993, model.bgpConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(305266096, model.bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.DISABLE, model.bgpConfiguration().allowASOverride()); - Assertions.assertEquals(3811111111100552790L, model.bgpConfiguration().peerAsn()); - Assertions.assertEquals("dvrgliegftcvbi", model.bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("ksdwgdnk", model.bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("zeka", model.bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("snorbjg", model.bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals(1278252319, model.staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(857060206, model.staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("diqayfl", model.staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("yu", model.staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("cta", model.staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("yvrtp", model.staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(2097526024, model.mtu()); - Assertions.assertEquals("wrasekw", model.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("axxijvskwsdgkjgy", model.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("nracli", model.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("q", model.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("jehhci", model.importRoutePolicyId()); - Assertions.assertEquals("wdv", model.exportRoutePolicyId()); - Assertions.assertEquals("rek", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("sqhtfpw", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("yejuwyqwdqigmghg", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("z", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("lujkhn", model.ingressAclId()); - Assertions.assertEquals("mrnkfmkhcqtwml", model.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.TRUE, model.isMonitoringEnabled()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPatchTests.java deleted file mode 100644 index c000de0e7119..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPatchTests.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BgpConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatch; -import com.azure.resourcemanager.managednetworkfabric.models.IsMonitoringEnabled; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InternalNetworkPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternalNetworkPatch model = - BinaryData - .fromString( - "{\"properties\":{\"bgpConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":414318030,\"multiplier\":974829886},\"defaultRouteOriginate\":\"True\",\"allowAS\":956752947,\"allowASOverride\":\"Disable\",\"fabricASN\":2137414702894569914,\"peerASN\":7228662658254212927,\"ipv4ListenRangePrefixes\":[\"facihmbfntu\"],\"ipv6ListenRangePrefixes\":[\"zbxvqxbnuvw\",\"gasgomtmjzwx\",\"qgo\"],\"ipv4NeighborAddress\":[{\"address\":\"wwztj\",\"configurationState\":\"Succeeded\"},{\"address\":\"htgfred\",\"configurationState\":\"ErrorProvisioning\"}],\"ipv6NeighborAddress\":[{\"address\":\"ll\",\"configurationState\":\"Rejected\"},{\"address\":\"ovjowazhpabacom\",\"configurationState\":\"ErrorDeprovisioning\"}],\"annotation\":\"gkw\"},\"staticRouteConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":1575455501,\"multiplier\":523326059},\"ipv4Routes\":[{\"prefix\":\"nmvceb\",\"nextHop\":[\"etqujxcxxq\",\"dcqjkedwqurc\",\"ojmrvvxwjongzse\"]},{\"prefix\":\"qqrsil\",\"nextHop\":[\"hskxx\",\"ansbvriaqg\"]},{\"prefix\":\"tojrulfucte\",\"nextHop\":[\"thcfj\",\"hxlyubqjrostvrje\"]}],\"ipv6Routes\":[{\"prefix\":\"z\",\"nextHop\":[\"eqrztrxalxrdh\",\"bsrwrsnrhpqat\"]},{\"prefix\":\"wk\",\"nextHop\":[\"yanxkvvcs\",\"msvuvdjkqxetq\",\"mlivrjjxnwx\",\"chp\"]}]},\"mtu\":1643020543,\"connectedIPv4Subnets\":[{\"prefix\":\"hzlxpgfquw\",\"annotation\":\"w\"}],\"connectedIPv6Subnets\":[{\"prefix\":\"elwcerwkwb\",\"annotation\":\"xljtxbusqtbxxn\"},{\"prefix\":\"uisdzhgbdgz\",\"annotation\":\"gsecnadbuwqrgx\"}],\"importRoutePolicyId\":\"lmqiynezoel\",\"exportRoutePolicyId\":\"kki\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"mtum\",\"importIpv6RoutePolicyId\":\"ymdjfua\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"qvqpilrg\",\"exportIpv6RoutePolicyId\":\"canlduwzorxs\"},\"ingressAclId\":\"x\",\"egressAclId\":\"klxymxkqvfqepdxc\",\"isMonitoringEnabled\":\"False\",\"annotation\":\"bwyvpjbowcpjqdu\"}}") - .toObject(InternalNetworkPatch.class); - Assertions.assertEquals("gkw", model.bgpConfiguration().annotation()); - Assertions.assertEquals(414318030, model.bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(974829886, model.bgpConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(956752947, model.bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.DISABLE, model.bgpConfiguration().allowASOverride()); - Assertions.assertEquals(7228662658254212927L, model.bgpConfiguration().peerAsn()); - Assertions.assertEquals("facihmbfntu", model.bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("zbxvqxbnuvw", model.bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("wwztj", model.bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("ll", model.bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals(1575455501, model.staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(523326059, model.staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("nmvceb", model.staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("etqujxcxxq", model.staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("z", model.staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("eqrztrxalxrdh", model.staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(1643020543, model.mtu()); - Assertions.assertEquals("w", model.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("hzlxpgfquw", model.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("xljtxbusqtbxxn", model.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("elwcerwkwb", model.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("lmqiynezoel", model.importRoutePolicyId()); - Assertions.assertEquals("kki", model.exportRoutePolicyId()); - Assertions.assertEquals("mtum", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("ymdjfua", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("qvqpilrg", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("canlduwzorxs", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("x", model.ingressAclId()); - Assertions.assertEquals("klxymxkqvfqepdxc", model.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.FALSE, model.isMonitoringEnabled()); - Assertions.assertEquals("bwyvpjbowcpjqdu", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternalNetworkPatch model = - new InternalNetworkPatch() - .withBgpConfiguration( - new BgpConfiguration() - .withAnnotation("gkw") - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(414318030).withMultiplier(974829886)) - .withDefaultRouteOriginate(BooleanEnumProperty.TRUE) - .withAllowAS(956752947) - .withAllowASOverride(AllowASOverride.DISABLE) - .withPeerAsn(7228662658254212927L) - .withIpv4ListenRangePrefixes(Arrays.asList("facihmbfntu")) - .withIpv6ListenRangePrefixes(Arrays.asList("zbxvqxbnuvw", "gasgomtmjzwx", "qgo")) - .withIpv4NeighborAddress( - Arrays - .asList( - new NeighborAddress().withAddress("wwztj"), - new NeighborAddress().withAddress("htgfred"))) - .withIpv6NeighborAddress( - Arrays - .asList( - new NeighborAddress().withAddress("ll"), - new NeighborAddress().withAddress("ovjowazhpabacom")))) - .withStaticRouteConfiguration( - new StaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1575455501).withMultiplier(523326059)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("nmvceb") - .withNextHop(Arrays.asList("etqujxcxxq", "dcqjkedwqurc", "ojmrvvxwjongzse")), - new StaticRouteProperties() - .withPrefix("qqrsil") - .withNextHop(Arrays.asList("hskxx", "ansbvriaqg")), - new StaticRouteProperties() - .withPrefix("tojrulfucte") - .withNextHop(Arrays.asList("thcfj", "hxlyubqjrostvrje")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("z") - .withNextHop(Arrays.asList("eqrztrxalxrdh", "bsrwrsnrhpqat")), - new StaticRouteProperties() - .withPrefix("wk") - .withNextHop( - Arrays.asList("yanxkvvcs", "msvuvdjkqxetq", "mlivrjjxnwx", "chp"))))) - .withMtu(1643020543) - .withConnectedIPv4Subnets( - Arrays.asList(new ConnectedSubnet().withAnnotation("w").withPrefix("hzlxpgfquw"))) - .withConnectedIPv6Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("xljtxbusqtbxxn").withPrefix("elwcerwkwb"), - new ConnectedSubnet().withAnnotation("gsecnadbuwqrgx").withPrefix("uisdzhgbdgz"))) - .withImportRoutePolicyId("lmqiynezoel") - .withExportRoutePolicyId("kki") - .withImportRoutePolicy( - new ImportRoutePolicy().withImportIpv4RoutePolicyId("mtum").withImportIpv6RoutePolicyId("ymdjfua")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("qvqpilrg") - .withExportIpv6RoutePolicyId("canlduwzorxs")) - .withIngressAclId("x") - .withEgressAclId("klxymxkqvfqepdxc") - .withIsMonitoringEnabled(IsMonitoringEnabled.FALSE) - .withAnnotation("bwyvpjbowcpjqdu"); - model = BinaryData.fromObject(model).toObject(InternalNetworkPatch.class); - Assertions.assertEquals("gkw", model.bgpConfiguration().annotation()); - Assertions.assertEquals(414318030, model.bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(974829886, model.bgpConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(956752947, model.bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.DISABLE, model.bgpConfiguration().allowASOverride()); - Assertions.assertEquals(7228662658254212927L, model.bgpConfiguration().peerAsn()); - Assertions.assertEquals("facihmbfntu", model.bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("zbxvqxbnuvw", model.bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("wwztj", model.bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("ll", model.bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals(1575455501, model.staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(523326059, model.staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("nmvceb", model.staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("etqujxcxxq", model.staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("z", model.staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("eqrztrxalxrdh", model.staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(1643020543, model.mtu()); - Assertions.assertEquals("w", model.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("hzlxpgfquw", model.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("xljtxbusqtbxxn", model.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("elwcerwkwb", model.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("lmqiynezoel", model.importRoutePolicyId()); - Assertions.assertEquals("kki", model.exportRoutePolicyId()); - Assertions.assertEquals("mtum", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("ymdjfua", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("qvqpilrg", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("canlduwzorxs", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("x", model.ingressAclId()); - Assertions.assertEquals("klxymxkqvfqepdxc", model.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.FALSE, model.isMonitoringEnabled()); - Assertions.assertEquals("bwyvpjbowcpjqdu", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPatchablePropertiesTests.java deleted file mode 100644 index a7d19e18206d..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPatchablePropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IsMonitoringEnabled; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InternalNetworkPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternalNetworkPatchableProperties model = - BinaryData - .fromString( - "{\"mtu\":1826528390,\"connectedIPv4Subnets\":[{\"prefix\":\"cayer\",\"annotation\":\"ransyby\"},{\"prefix\":\"polwzrghsrlei\",\"annotation\":\"fscjfn\"},{\"prefix\":\"jwvuag\",\"annotation\":\"wtltngvmreuptrk\"},{\"prefix\":\"zmijajwo\",\"annotation\":\"fsvagh\"}],\"connectedIPv6Subnets\":[{\"prefix\":\"nwlslrcigtzjcvbx\",\"annotation\":\"a\"},{\"prefix\":\"snsso\",\"annotation\":\"xpavid\"},{\"prefix\":\"ievw\",\"annotation\":\"cvvy\"},{\"prefix\":\"zslp\",\"annotation\":\"gcbdsvalpnptw\"}],\"importRoutePolicyId\":\"kx\",\"exportRoutePolicyId\":\"azwu\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"qvn\",\"importIpv6RoutePolicyId\":\"bfe\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"diuhzzgql\",\"exportIpv6RoutePolicyId\":\"aewzgiudjp\"},\"ingressAclId\":\"qhttqhnmhkre\",\"egressAclId\":\"dsuxheqdgcrux\",\"isMonitoringEnabled\":\"False\"}") - .toObject(InternalNetworkPatchableProperties.class); - Assertions.assertEquals(1826528390, model.mtu()); - Assertions.assertEquals("ransyby", model.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("cayer", model.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("a", model.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("nwlslrcigtzjcvbx", model.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("kx", model.importRoutePolicyId()); - Assertions.assertEquals("azwu", model.exportRoutePolicyId()); - Assertions.assertEquals("qvn", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("bfe", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("diuhzzgql", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("aewzgiudjp", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("qhttqhnmhkre", model.ingressAclId()); - Assertions.assertEquals("dsuxheqdgcrux", model.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.FALSE, model.isMonitoringEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternalNetworkPatchableProperties model = - new InternalNetworkPatchableProperties() - .withMtu(1826528390) - .withConnectedIPv4Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("ransyby").withPrefix("cayer"), - new ConnectedSubnet().withAnnotation("fscjfn").withPrefix("polwzrghsrlei"), - new ConnectedSubnet().withAnnotation("wtltngvmreuptrk").withPrefix("jwvuag"), - new ConnectedSubnet().withAnnotation("fsvagh").withPrefix("zmijajwo"))) - .withConnectedIPv6Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("a").withPrefix("nwlslrcigtzjcvbx"), - new ConnectedSubnet().withAnnotation("xpavid").withPrefix("snsso"), - new ConnectedSubnet().withAnnotation("cvvy").withPrefix("ievw"), - new ConnectedSubnet().withAnnotation("gcbdsvalpnptw").withPrefix("zslp"))) - .withImportRoutePolicyId("kx") - .withExportRoutePolicyId("azwu") - .withImportRoutePolicy( - new ImportRoutePolicy().withImportIpv4RoutePolicyId("qvn").withImportIpv6RoutePolicyId("bfe")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("diuhzzgql") - .withExportIpv6RoutePolicyId("aewzgiudjp")) - .withIngressAclId("qhttqhnmhkre") - .withEgressAclId("dsuxheqdgcrux") - .withIsMonitoringEnabled(IsMonitoringEnabled.FALSE); - model = BinaryData.fromObject(model).toObject(InternalNetworkPatchableProperties.class); - Assertions.assertEquals(1826528390, model.mtu()); - Assertions.assertEquals("ransyby", model.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("cayer", model.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("a", model.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("nwlslrcigtzjcvbx", model.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("kx", model.importRoutePolicyId()); - Assertions.assertEquals("azwu", model.exportRoutePolicyId()); - Assertions.assertEquals("qvn", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("bfe", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("diuhzzgql", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("aewzgiudjp", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("qhttqhnmhkre", model.ingressAclId()); - Assertions.assertEquals("dsuxheqdgcrux", model.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.FALSE, model.isMonitoringEnabled()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPropertiesBgpConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPropertiesBgpConfigurationTests.java deleted file mode 100644 index e4d5b361e9ea..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPropertiesBgpConfigurationTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPropertiesBgpConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InternalNetworkPropertiesBgpConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternalNetworkPropertiesBgpConfiguration model = - BinaryData - .fromString( - "{\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":1017981463,\"multiplier\":797231309},\"defaultRouteOriginate\":\"True\",\"allowAS\":654268550,\"allowASOverride\":\"Enable\",\"fabricASN\":212980078870398723,\"peerASN\":570360669816848021,\"ipv4ListenRangePrefixes\":[\"rpejp\",\"ssanbtttkgsuxun\"],\"ipv6ListenRangePrefixes\":[\"gkp\",\"hboyikebhuhks\",\"gwl\",\"kh\"],\"ipv4NeighborAddress\":[{\"address\":\"jy\",\"configurationState\":\"Succeeded\"}],\"ipv6NeighborAddress\":[{\"address\":\"qzufgsyfejyvdwt\",\"configurationState\":\"DeferredControl\"},{\"address\":\"pqa\",\"configurationState\":\"Deprovisioning\"}],\"annotation\":\"ncfgybmxsnxoc\"}") - .toObject(InternalNetworkPropertiesBgpConfiguration.class); - Assertions.assertEquals("ncfgybmxsnxoc", model.annotation()); - Assertions.assertEquals(1017981463, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(797231309, model.bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.defaultRouteOriginate()); - Assertions.assertEquals(654268550, model.allowAS()); - Assertions.assertEquals(AllowASOverride.ENABLE, model.allowASOverride()); - Assertions.assertEquals(570360669816848021L, model.peerAsn()); - Assertions.assertEquals("rpejp", model.ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("gkp", model.ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("jy", model.ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("qzufgsyfejyvdwt", model.ipv6NeighborAddress().get(0).address()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternalNetworkPropertiesBgpConfiguration model = - new InternalNetworkPropertiesBgpConfiguration() - .withAnnotation("ncfgybmxsnxoc") - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1017981463).withMultiplier(797231309)) - .withDefaultRouteOriginate(BooleanEnumProperty.TRUE) - .withAllowAS(654268550) - .withAllowASOverride(AllowASOverride.ENABLE) - .withPeerAsn(570360669816848021L) - .withIpv4ListenRangePrefixes(Arrays.asList("rpejp", "ssanbtttkgsuxun")) - .withIpv6ListenRangePrefixes(Arrays.asList("gkp", "hboyikebhuhks", "gwl", "kh")) - .withIpv4NeighborAddress(Arrays.asList(new NeighborAddress().withAddress("jy"))) - .withIpv6NeighborAddress( - Arrays - .asList( - new NeighborAddress().withAddress("qzufgsyfejyvdwt"), - new NeighborAddress().withAddress("pqa"))); - model = BinaryData.fromObject(model).toObject(InternalNetworkPropertiesBgpConfiguration.class); - Assertions.assertEquals("ncfgybmxsnxoc", model.annotation()); - Assertions.assertEquals(1017981463, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(797231309, model.bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.defaultRouteOriginate()); - Assertions.assertEquals(654268550, model.allowAS()); - Assertions.assertEquals(AllowASOverride.ENABLE, model.allowASOverride()); - Assertions.assertEquals(570360669816848021L, model.peerAsn()); - Assertions.assertEquals("rpejp", model.ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("gkp", model.ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("jy", model.ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("qzufgsyfejyvdwt", model.ipv6NeighborAddress().get(0).address()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPropertiesStaticRouteConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPropertiesStaticRouteConfigurationTests.java deleted file mode 100644 index f6bef25d887d..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPropertiesStaticRouteConfigurationTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.Extension; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPropertiesStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InternalNetworkPropertiesStaticRouteConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternalNetworkPropertiesStaticRouteConfiguration model = - BinaryData - .fromString( - "{\"extension\":\"NoExtension\",\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":1414511629,\"multiplier\":119953679},\"ipv4Routes\":[{\"prefix\":\"g\",\"nextHop\":[\"qvzvlu\"]},{\"prefix\":\"q\",\"nextHop\":[\"ios\",\"scyvaifppuacvf\",\"eowpsfxtjdhsoymh\",\"v\"]},{\"prefix\":\"yqfttehdpboujst\",\"nextHop\":[\"vvdshxcdedsue\",\"ygnxcgjtfrnqukt\",\"fnslnlrxsmy\",\"trwntfmtbgw\"]}],\"ipv6Routes\":[{\"prefix\":\"wnaz\",\"nextHop\":[\"rrdreyzjwhset\",\"wjwzzqseuzuukykc\",\"qhyqqzzdcykey\",\"tewfopazdazgbsq\"]},{\"prefix\":\"pew\",\"nextHop\":[\"fut\"]}]}") - .toObject(InternalNetworkPropertiesStaticRouteConfiguration.class); - Assertions.assertEquals(1414511629, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(119953679, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("g", model.ipv4Routes().get(0).prefix()); - Assertions.assertEquals("qvzvlu", model.ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("wnaz", model.ipv6Routes().get(0).prefix()); - Assertions.assertEquals("rrdreyzjwhset", model.ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(Extension.NO_EXTENSION, model.extension()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternalNetworkPropertiesStaticRouteConfiguration model = - new InternalNetworkPropertiesStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1414511629).withMultiplier(119953679)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties().withPrefix("g").withNextHop(Arrays.asList("qvzvlu")), - new StaticRouteProperties() - .withPrefix("q") - .withNextHop(Arrays.asList("ios", "scyvaifppuacvf", "eowpsfxtjdhsoymh", "v")), - new StaticRouteProperties() - .withPrefix("yqfttehdpboujst") - .withNextHop( - Arrays.asList("vvdshxcdedsue", "ygnxcgjtfrnqukt", "fnslnlrxsmy", "trwntfmtbgw")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("wnaz") - .withNextHop( - Arrays - .asList( - "rrdreyzjwhset", "wjwzzqseuzuukykc", "qhyqqzzdcykey", "tewfopazdazgbsq")), - new StaticRouteProperties().withPrefix("pew").withNextHop(Arrays.asList("fut")))) - .withExtension(Extension.NO_EXTENSION); - model = BinaryData.fromObject(model).toObject(InternalNetworkPropertiesStaticRouteConfiguration.class); - Assertions.assertEquals(1414511629, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(119953679, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("g", model.ipv4Routes().get(0).prefix()); - Assertions.assertEquals("qvzvlu", model.ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("wnaz", model.ipv6Routes().get(0).prefix()); - Assertions.assertEquals("rrdreyzjwhset", model.ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(Extension.NO_EXTENSION, model.extension()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPropertiesTests.java deleted file mode 100644 index 64d0d76789fd..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworkPropertiesTests.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkProperties; -import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.Extension; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPropertiesBgpConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPropertiesStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.IsMonitoringEnabled; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InternalNetworkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternalNetworkProperties model = - BinaryData - .fromString( - "{\"vlanId\":1880463040,\"bgpConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":969630981,\"multiplier\":84398716},\"defaultRouteOriginate\":\"False\",\"allowAS\":891640951,\"allowASOverride\":\"Disable\",\"fabricASN\":9033387095244894570,\"peerASN\":2624787996456648289,\"ipv4ListenRangePrefixes\":[\"xlzsxezppk\",\"waaeskyfjl\"],\"ipv6ListenRangePrefixes\":[\"qtoyrpl\",\"xlaj\"],\"ipv4NeighborAddress\":[{\"address\":\"quevham\",\"configurationState\":\"ErrorDeprovisioning\"},{\"address\":\"w\",\"configurationState\":\"Failed\"},{\"address\":\"ekxpkzwaqxofqo\",\"configurationState\":\"ErrorDeprovisioning\"}],\"ipv6NeighborAddress\":[{\"address\":\"p\",\"configurationState\":\"ErrorProvisioning\"},{\"address\":\"dusztekxby\",\"configurationState\":\"Provisioned\"},{\"address\":\"fepxyihpqadag\",\"configurationState\":\"Accepted\"},{\"address\":\"icxdwyjfo\",\"configurationState\":\"Failed\"}],\"annotation\":\"ovcxjs\"},\"staticRouteConfiguration\":{\"extension\":\"NoExtension\",\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":1455369326,\"multiplier\":1508387956},\"ipv4Routes\":[{\"prefix\":\"uhoduchvlscrdpib\",\"nextHop\":[\"yjdusspysze\",\"bhwlkaaggkrehbfr\"]},{\"prefix\":\"uybffljfiim\",\"nextHop\":[\"oags\",\"taadu\"]},{\"prefix\":\"rexxfavs\",\"nextHop\":[\"udo\",\"zilfmnlikps\",\"msfeypofqpm\"]}],\"ipv6Routes\":[{\"prefix\":\"qgsdr\",\"nextHop\":[\"ttjxophgerhsmvgo\",\"twzmqilrixysfnim\",\"qywwwmhk\"]}]},\"configurationState\":\"Succeeded\",\"provisioningState\":\"Failed\",\"administrativeState\":\"Disabled\",\"mtu\":2066882789,\"connectedIPv4Subnets\":[{\"prefix\":\"lqoin\",\"annotation\":\"duewihapfj\"},{\"prefix\":\"iknj\",\"annotation\":\"qfli\"},{\"prefix\":\"jh\",\"annotation\":\"lbiedfsbw\"}],\"connectedIPv6Subnets\":[{\"prefix\":\"vbvzipbwxgo\",\"annotation\":\"x\"},{\"prefix\":\"pradmskxknpdgzi\",\"annotation\":\"sugswhgsaod\"}],\"importRoutePolicyId\":\"wnbaf\",\"exportRoutePolicyId\":\"to\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"aquvwsxbgnvkervq\",\"importIpv6RoutePolicyId\":\"oadhrsxqvz\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"abdsr\",\"exportIpv6RoutePolicyId\":\"ajglzrsubklr\"},\"ingressAclId\":\"jnltcetjdvqydi\",\"egressAclId\":\"qkwaruwd\",\"isMonitoringEnabled\":\"False\",\"extension\":\"NoExtension\",\"annotation\":\"ebwgjxb\"}") - .toObject(InternalNetworkProperties.class); - Assertions.assertEquals("ebwgjxb", model.annotation()); - Assertions.assertEquals(1880463040, model.vlanId()); - Assertions.assertEquals("ovcxjs", model.bgpConfiguration().annotation()); - Assertions.assertEquals(969630981, model.bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(84398716, model.bgpConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(891640951, model.bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.DISABLE, model.bgpConfiguration().allowASOverride()); - Assertions.assertEquals(2624787996456648289L, model.bgpConfiguration().peerAsn()); - Assertions.assertEquals("xlzsxezppk", model.bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("qtoyrpl", model.bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("quevham", model.bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("p", model.bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals(1455369326, model.staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1508387956, model.staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("uhoduchvlscrdpib", model.staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("yjdusspysze", model.staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("qgsdr", model.staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions - .assertEquals("ttjxophgerhsmvgo", model.staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(Extension.NO_EXTENSION, model.staticRouteConfiguration().extension()); - Assertions.assertEquals(2066882789, model.mtu()); - Assertions.assertEquals("duewihapfj", model.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("lqoin", model.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("x", model.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("vbvzipbwxgo", model.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("wnbaf", model.importRoutePolicyId()); - Assertions.assertEquals("to", model.exportRoutePolicyId()); - Assertions.assertEquals("aquvwsxbgnvkervq", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("oadhrsxqvz", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("abdsr", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("ajglzrsubklr", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("jnltcetjdvqydi", model.ingressAclId()); - Assertions.assertEquals("qkwaruwd", model.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.FALSE, model.isMonitoringEnabled()); - Assertions.assertEquals(Extension.NO_EXTENSION, model.extension()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternalNetworkProperties model = - new InternalNetworkProperties() - .withAnnotation("ebwgjxb") - .withVlanId(1880463040) - .withBgpConfiguration( - new InternalNetworkPropertiesBgpConfiguration() - .withAnnotation("ovcxjs") - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(969630981).withMultiplier(84398716)) - .withDefaultRouteOriginate(BooleanEnumProperty.FALSE) - .withAllowAS(891640951) - .withAllowASOverride(AllowASOverride.DISABLE) - .withPeerAsn(2624787996456648289L) - .withIpv4ListenRangePrefixes(Arrays.asList("xlzsxezppk", "waaeskyfjl")) - .withIpv6ListenRangePrefixes(Arrays.asList("qtoyrpl", "xlaj")) - .withIpv4NeighborAddress( - Arrays - .asList( - new NeighborAddress().withAddress("quevham"), - new NeighborAddress().withAddress("w"), - new NeighborAddress().withAddress("ekxpkzwaqxofqo"))) - .withIpv6NeighborAddress( - Arrays - .asList( - new NeighborAddress().withAddress("p"), - new NeighborAddress().withAddress("dusztekxby"), - new NeighborAddress().withAddress("fepxyihpqadag"), - new NeighborAddress().withAddress("icxdwyjfo")))) - .withStaticRouteConfiguration( - new InternalNetworkPropertiesStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1455369326).withMultiplier(1508387956)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("uhoduchvlscrdpib") - .withNextHop(Arrays.asList("yjdusspysze", "bhwlkaaggkrehbfr")), - new StaticRouteProperties() - .withPrefix("uybffljfiim") - .withNextHop(Arrays.asList("oags", "taadu")), - new StaticRouteProperties() - .withPrefix("rexxfavs") - .withNextHop(Arrays.asList("udo", "zilfmnlikps", "msfeypofqpm")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("qgsdr") - .withNextHop( - Arrays.asList("ttjxophgerhsmvgo", "twzmqilrixysfnim", "qywwwmhk")))) - .withExtension(Extension.NO_EXTENSION)) - .withMtu(2066882789) - .withConnectedIPv4Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("duewihapfj").withPrefix("lqoin"), - new ConnectedSubnet().withAnnotation("qfli").withPrefix("iknj"), - new ConnectedSubnet().withAnnotation("lbiedfsbw").withPrefix("jh"))) - .withConnectedIPv6Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("x").withPrefix("vbvzipbwxgo"), - new ConnectedSubnet().withAnnotation("sugswhgsaod").withPrefix("pradmskxknpdgzi"))) - .withImportRoutePolicyId("wnbaf") - .withExportRoutePolicyId("to") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("aquvwsxbgnvkervq") - .withImportIpv6RoutePolicyId("oadhrsxqvz")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("abdsr") - .withExportIpv6RoutePolicyId("ajglzrsubklr")) - .withIngressAclId("jnltcetjdvqydi") - .withEgressAclId("qkwaruwd") - .withIsMonitoringEnabled(IsMonitoringEnabled.FALSE) - .withExtension(Extension.NO_EXTENSION); - model = BinaryData.fromObject(model).toObject(InternalNetworkProperties.class); - Assertions.assertEquals("ebwgjxb", model.annotation()); - Assertions.assertEquals(1880463040, model.vlanId()); - Assertions.assertEquals("ovcxjs", model.bgpConfiguration().annotation()); - Assertions.assertEquals(969630981, model.bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(84398716, model.bgpConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(891640951, model.bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.DISABLE, model.bgpConfiguration().allowASOverride()); - Assertions.assertEquals(2624787996456648289L, model.bgpConfiguration().peerAsn()); - Assertions.assertEquals("xlzsxezppk", model.bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("qtoyrpl", model.bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("quevham", model.bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("p", model.bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals(1455369326, model.staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1508387956, model.staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("uhoduchvlscrdpib", model.staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("yjdusspysze", model.staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("qgsdr", model.staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions - .assertEquals("ttjxophgerhsmvgo", model.staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(Extension.NO_EXTENSION, model.staticRouteConfiguration().extension()); - Assertions.assertEquals(2066882789, model.mtu()); - Assertions.assertEquals("duewihapfj", model.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("lqoin", model.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("x", model.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("vbvzipbwxgo", model.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("wnbaf", model.importRoutePolicyId()); - Assertions.assertEquals("to", model.exportRoutePolicyId()); - Assertions.assertEquals("aquvwsxbgnvkervq", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("oadhrsxqvz", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("abdsr", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("ajglzrsubklr", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("jnltcetjdvqydi", model.ingressAclId()); - Assertions.assertEquals("qkwaruwd", model.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.FALSE, model.isMonitoringEnabled()); - Assertions.assertEquals(Extension.NO_EXTENSION, model.extension()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksCreateMockTests.java deleted file mode 100644 index 09ca16a6e0a5..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksCreateMockTests.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.Extension; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetwork; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPropertiesBgpConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPropertiesStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.IsMonitoringEnabled; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -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 InternalNetworksCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"vlanId\":1818610195,\"bgpConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":574566752,\"multiplier\":1367524324},\"defaultRouteOriginate\":\"False\",\"allowAS\":1959640018,\"allowASOverride\":\"Disable\",\"fabricASN\":178761878052758363,\"peerASN\":3211289839298869603,\"ipv4ListenRangePrefixes\":[\"kedaxkuyorfj\"],\"ipv6ListenRangePrefixes\":[\"odaweo\"],\"ipv4NeighborAddress\":[{\"address\":\"yihuzsbpwn\",\"configurationState\":\"ErrorProvisioning\"},{\"address\":\"ypazwiimdlzg\",\"configurationState\":\"Rejected\"},{\"address\":\"grlw\",\"configurationState\":\"Deprovisioning\"}],\"ipv6NeighborAddress\":[{\"address\":\"twqade\",\"configurationState\":\"Failed\"},{\"address\":\"xkyxiatfamrna\",\"configurationState\":\"ErrorProvisioning\"},{\"address\":\"xccpr\",\"configurationState\":\"Rejected\"}],\"annotation\":\"ozwhomydxgt\"},\"staticRouteConfiguration\":{\"extension\":\"NoExtension\",\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":1392142414,\"multiplier\":1334408206},\"ipv4Routes\":[{\"prefix\":\"vvketyd\",\"nextHop\":[\"qok\",\"ssgvq\",\"erxrmhrr\",\"qgbbj\"]},{\"prefix\":\"vihylrxsiyzsyium\",\"nextHop\":[\"tlqycfvernnk\",\"pkayqivbig\",\"rqgzetbo\"]},{\"prefix\":\"ztgnmuxppw\",\"nextHop\":[\"fmgrmtgwhz\"]}],\"ipv6Routes\":[{\"prefix\":\"wrjenco\",\"nextHop\":[\"ii\",\"wibdtpljo\",\"majokbxxcdkhxjwt\"]},{\"prefix\":\"ftg\",\"nextHop\":[\"juepmewsj\",\"gbmlbxjhgvtep\"]},{\"prefix\":\"runudmakkshrna\",\"nextHop\":[\"czkwohdigeyuocf\",\"samodwq\",\"a\"]}]},\"configurationState\":\"ErrorProvisioning\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"Disabled\",\"mtu\":192902937,\"connectedIPv4Subnets\":[{\"prefix\":\"rnnbegrafeonmto\",\"annotation\":\"g\"},{\"prefix\":\"ofmazhkqqs\",\"annotation\":\"na\"},{\"prefix\":\"szbwgpmdmwi\",\"annotation\":\"vve\"}],\"connectedIPv6Subnets\":[{\"prefix\":\"hh\",\"annotation\":\"qhdldargkwimtcce\"}],\"importRoutePolicyId\":\"uqu\",\"exportRoutePolicyId\":\"czzc\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"xvbkirgknhfwlajw\",\"importIpv6RoutePolicyId\":\"jydjb\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"pvspewyzhydtk\",\"exportIpv6RoutePolicyId\":\"trsdp\"},\"ingressAclId\":\"iaigarmawokgcn\",\"egressAclId\":\"iccwbqy\",\"isMonitoringEnabled\":\"True\",\"extension\":\"NoExtension\",\"annotation\":\"giynqryo\"},\"id\":\"weofvsxauphzefi\",\"name\":\"eyydx\",\"type\":\"gtiivzkd\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InternalNetwork response = - manager - .internalNetworks() - .define("blnlmpuyypaggpai") - .withExistingL3IsolationDomain("thfwl", "vqacbyfi") - .withVlanId(2101185466) - .withBgpConfiguration( - new InternalNetworkPropertiesBgpConfiguration() - .withAnnotation("ctbxzj") - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1738694664).withMultiplier(426444436)) - .withDefaultRouteOriginate(BooleanEnumProperty.TRUE) - .withAllowAS(47352357) - .withAllowASOverride(AllowASOverride.DISABLE) - .withPeerAsn(996176222973422710L) - .withIpv4ListenRangePrefixes( - Arrays.asList("wukhjdspll", "txrrgkwiyoyhq", "ivxcodwkwoytcach", "sizfuewlf")) - .withIpv6ListenRangePrefixes( - Arrays.asList("ikqcdnzsfiuhgne", "o", "mcrxlyzoaho", "ufakrxjjwnbrmdwt")) - .withIpv4NeighborAddress( - Arrays - .asList( - new NeighborAddress().withAddress("syiaanist"), - new NeighborAddress().withAddress("tclpphcs"))) - .withIpv6NeighborAddress( - Arrays - .asList( - new NeighborAddress().withAddress("anapfaoiz"), - new NeighborAddress().withAddress("pxngzzxqbgq")))) - .withStaticRouteConfiguration( - new InternalNetworkPropertiesStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1104440707).withMultiplier(1297511755)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties().withPrefix("bsk").withNextHop(Arrays.asList("afzsq")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("npxmiwtkqifp") - .withNextHop(Arrays.asList("dukcdnzoxla", "uxtwgbawshram")))) - .withExtension(Extension.NPB)) - .withMtu(63592879) - .withConnectedIPv4Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("vqlauuag").withPrefix("fzto"), - new ConnectedSubnet().withAnnotation("zwjipssvnon").withPrefix("ayfmcerfxfeiqbas"), - new ConnectedSubnet().withAnnotation("pdqqbtok").withPrefix("jcqcjozzjk"), - new ConnectedSubnet().withAnnotation("wettohgpz").withPrefix("ocuzxllbpwa"))) - .withConnectedIPv6Subnets( - Arrays.asList(new ConnectedSubnet().withAnnotation("xpu").withPrefix("vtkzbh"))) - .withImportRoutePolicyId("dmwnfhmjusuqn") - .withExportRoutePolicyId("shv") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("dhekaqnirmidtv") - .withImportIpv6RoutePolicyId("cgszfbqygkxrlfo")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("lpumveybodhrvyk") - .withExportIpv6RoutePolicyId("umwbcu")) - .withIngressAclId("vegpdxts") - .withEgressAclId("jtcooj") - .withIsMonitoringEnabled(IsMonitoringEnabled.FALSE) - .withExtension(Extension.NO_EXTENSION) - .withAnnotation("xuptsliivmlkw") - .create(); - - Assertions.assertEquals(1818610195, response.vlanId()); - Assertions.assertEquals("ozwhomydxgt", response.bgpConfiguration().annotation()); - Assertions.assertEquals(574566752, response.bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1367524324, response.bgpConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, response.bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(1959640018, response.bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.DISABLE, response.bgpConfiguration().allowASOverride()); - Assertions.assertEquals(3211289839298869603L, response.bgpConfiguration().peerAsn()); - Assertions.assertEquals("kedaxkuyorfj", response.bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("odaweo", response.bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("yihuzsbpwn", response.bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("twqade", response.bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals(1392142414, response.staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1334408206, response.staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("vvketyd", response.staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("qok", response.staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("wrjenco", response.staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("ii", response.staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(Extension.NO_EXTENSION, response.staticRouteConfiguration().extension()); - Assertions.assertEquals(192902937, response.mtu()); - Assertions.assertEquals("g", response.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("rnnbegrafeonmto", response.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("qhdldargkwimtcce", response.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("hh", response.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("uqu", response.importRoutePolicyId()); - Assertions.assertEquals("czzc", response.exportRoutePolicyId()); - Assertions.assertEquals("xvbkirgknhfwlajw", response.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("jydjb", response.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("pvspewyzhydtk", response.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("trsdp", response.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("iaigarmawokgcn", response.ingressAclId()); - Assertions.assertEquals("iccwbqy", response.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.TRUE, response.isMonitoringEnabled()); - Assertions.assertEquals(Extension.NO_EXTENSION, response.extension()); - Assertions.assertEquals("giynqryo", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksGetWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksGetWithResponseMockTests.java deleted file mode 100644 index c0abe4d8bd3c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksGetWithResponseMockTests.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.Extension; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetwork; -import com.azure.resourcemanager.managednetworkfabric.models.IsMonitoringEnabled; -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 InternalNetworksGetWithResponseMockTests { - @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\":{\"vlanId\":2051280124,\"bgpConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":1139668415,\"multiplier\":2020896000},\"defaultRouteOriginate\":\"False\",\"allowAS\":676445436,\"allowASOverride\":\"Enable\",\"fabricASN\":1443023715460147904,\"peerASN\":8347088160005961613,\"ipv4ListenRangePrefixes\":[\"y\",\"xxrat\"],\"ipv6ListenRangePrefixes\":[\"eqbrcmmdtsh\",\"umxu\"],\"ipv4NeighborAddress\":[{\"address\":\"ab\",\"configurationState\":\"Succeeded\"}],\"ipv6NeighborAddress\":[{\"address\":\"nmjwkowxqzk\",\"configurationState\":\"ErrorDeprovisioning\"},{\"address\":\"ejh\",\"configurationState\":\"Failed\"}],\"annotation\":\"hrskmpeajzzypav\"},\"staticRouteConfiguration\":{\"extension\":\"NPB\",\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":383750498,\"multiplier\":608994421},\"ipv4Routes\":[{\"prefix\":\"txytja\",\"nextHop\":[\"j\"]},{\"prefix\":\"rjlijkkvbfaehjji\",\"nextHop\":[\"jqxavqmdmracfsf\",\"dralihhss\"]}],\"ipv6Routes\":[{\"prefix\":\"yzhcvlavy\",\"nextHop\":[\"lndxrmyzvti\",\"jtpdru\",\"xaxoyj\",\"h\"]},{\"prefix\":\"twedi\",\"nextHop\":[\"vktecc\",\"fnatntmcaxbqpm\",\"hjikq\",\"nbdqitghnm\"]}]},\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"MAT\",\"mtu\":1697277556,\"connectedIPv4Subnets\":[{\"prefix\":\"grmwyvhdiy\",\"annotation\":\"gqqqgrbrhh\"},{\"prefix\":\"ipgtipaao\",\"annotation\":\"whfm\"},{\"prefix\":\"bweasgypjixd\",\"annotation\":\"badydwqeuwdvcl\"}],\"connectedIPv6Subnets\":[{\"prefix\":\"qdchnzib\",\"annotation\":\"rgsrwxxqkwargc\"},{\"prefix\":\"gd\",\"annotation\":\"sijiqexqwqykm\"},{\"prefix\":\"ugflhdhoxurhc\",\"annotation\":\"kvthwtamvmb\"},{\"prefix\":\"yvxhfmuh\",\"annotation\":\"z\"}],\"importRoutePolicyId\":\"cqic\",\"exportRoutePolicyId\":\"dxvbeqzjdwxt\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"dwneecmytlx\",\"importIpv6RoutePolicyId\":\"jrwvnffaofkvfru\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"fbvhgykzov\",\"exportIpv6RoutePolicyId\":\"vym\"},\"ingressAclId\":\"ay\",\"egressAclId\":\"myrn\",\"isMonitoringEnabled\":\"True\",\"extension\":\"NPB\",\"annotation\":\"fnoxhvo\"},\"id\":\"dgfkrqsjrvpakxr\",\"name\":\"eexweju\",\"type\":\"uvnxbohpzur\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InternalNetwork response = - manager - .internalNetworks() - .getWithResponse("nbnyplu", "ypkfcdfuxi", "zvxotnoilqcdvhy", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(2051280124, response.vlanId()); - Assertions.assertEquals("hrskmpeajzzypav", response.bgpConfiguration().annotation()); - Assertions.assertEquals(1139668415, response.bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(2020896000, response.bgpConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, response.bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(676445436, response.bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.ENABLE, response.bgpConfiguration().allowASOverride()); - Assertions.assertEquals(8347088160005961613L, response.bgpConfiguration().peerAsn()); - Assertions.assertEquals("y", response.bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions.assertEquals("eqbrcmmdtsh", response.bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions.assertEquals("ab", response.bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions.assertEquals("nmjwkowxqzk", response.bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals(383750498, response.staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(608994421, response.staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("txytja", response.staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("j", response.staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("yzhcvlavy", response.staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions - .assertEquals("lndxrmyzvti", response.staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals(Extension.NPB, response.staticRouteConfiguration().extension()); - Assertions.assertEquals(1697277556, response.mtu()); - Assertions.assertEquals("gqqqgrbrhh", response.connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("grmwyvhdiy", response.connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("rgsrwxxqkwargc", response.connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("qdchnzib", response.connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("cqic", response.importRoutePolicyId()); - Assertions.assertEquals("dxvbeqzjdwxt", response.exportRoutePolicyId()); - Assertions.assertEquals("dwneecmytlx", response.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("jrwvnffaofkvfru", response.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("fbvhgykzov", response.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("vym", response.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("ay", response.ingressAclId()); - Assertions.assertEquals("myrn", response.egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.TRUE, response.isMonitoringEnabled()); - Assertions.assertEquals(Extension.NPB, response.extension()); - Assertions.assertEquals("fnoxhvo", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksListByL3IsolationDomainMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksListByL3IsolationDomainMockTests.java deleted file mode 100644 index 0601dcfa893f..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksListByL3IsolationDomainMockTests.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.Extension; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetwork; -import com.azure.resourcemanager.managednetworkfabric.models.IsMonitoringEnabled; -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 InternalNetworksListByL3IsolationDomainMockTests { - @Test - public void testListByL3IsolationDomain() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"vlanId\":2105044840,\"bgpConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":330404211,\"multiplier\":1703864947},\"defaultRouteOriginate\":\"True\",\"allowAS\":1917378904,\"allowASOverride\":\"Disable\",\"fabricASN\":3313779653487434302,\"peerASN\":5038580319715936459,\"ipv4ListenRangePrefixes\":[\"qcwkkgqysyajmm\"],\"ipv6ListenRangePrefixes\":[\"pdcbgrufsdbkuxkd\"],\"ipv4NeighborAddress\":[{\"address\":\"s\",\"configurationState\":\"Accepted\"}],\"ipv6NeighborAddress\":[{\"address\":\"cwbshfihvl\",\"configurationState\":\"Succeeded\"},{\"address\":\"ylaulpuex\",\"configurationState\":\"Provisioned\"},{\"address\":\"ztyecxd\",\"configurationState\":\"Accepted\"}],\"annotation\":\"gnndefyh\"},\"staticRouteConfiguration\":{\"extension\":\"NoExtension\",\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":153975781,\"multiplier\":1733957433},\"ipv4Routes\":[{\"prefix\":\"aprqtfkmvz\",\"nextHop\":[\"pmonxdwf\",\"uhbgftfvqukk\",\"vzenegpd\"]},{\"prefix\":\"rjylw\",\"nextHop\":[\"semjhhxlsu\"]},{\"prefix\":\"ehztbejrdzwy\",\"nextHop\":[\"dp\",\"zwufi\"]},{\"prefix\":\"n\",\"nextHop\":[\"jhmjkykqflkmcy\",\"xmysmkbndnrihpja\",\"hc\"]}],\"ipv6Routes\":[{\"prefix\":\"jn\",\"nextHop\":[\"gnydlkrnpsb\"]},{\"prefix\":\"mrmhkip\",\"nextHop\":[\"rdvdpf\",\"wdxmiaelnp\",\"ieclunddvjlp\",\"jszqjfs\"]},{\"prefix\":\"jvaycxrwknsb\",\"nextHop\":[\"ypbrzwi\",\"pzcyhk\",\"cebtpgvut\"]}]},\"configurationState\":\"Deprovisioning\",\"provisioningState\":\"Updating\",\"administrativeState\":\"Disabled\",\"mtu\":1320949648,\"connectedIPv4Subnets\":[{\"prefix\":\"cowken\",\"annotation\":\"rcifflxqqn\"},{\"prefix\":\"gtcuyuwgnyjd\",\"annotation\":\"jticw\"},{\"prefix\":\"lfz\",\"annotation\":\"ibfmcoxbktu\"}],\"connectedIPv6Subnets\":[{\"prefix\":\"ufpvvdgnmeiomn\",\"annotation\":\"baib\"},{\"prefix\":\"f\",\"annotation\":\"yqzaisfofg\"},{\"prefix\":\"mrkm\",\"annotation\":\"fmyzbuhdn\"},{\"prefix\":\"hcmt\",\"annotation\":\"ptb\"}],\"importRoutePolicyId\":\"onhbl\",\"exportRoutePolicyId\":\"vcnuqfpz\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"bpcwtwtrchkcmru\",\"importIpv6RoutePolicyId\":\"qesqsqmiek\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"wqchfptykkvj\",\"exportIpv6RoutePolicyId\":\"bajcurzy\"},\"ingressAclId\":\"kbgumuejxxpx\",\"egressAclId\":\"zch\",\"isMonitoringEnabled\":\"False\",\"extension\":\"NoExtension\",\"annotation\":\"nrkjkng\"},\"id\":\"sulaybhozls\",\"name\":\"ufnhb\",\"type\":\"cn\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .internalNetworks() - .listByL3IsolationDomain("zoytkbeadyfenro", "oijoxcbpkiwse", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(2105044840, response.iterator().next().vlanId()); - Assertions.assertEquals("gnndefyh", response.iterator().next().bgpConfiguration().annotation()); - Assertions - .assertEquals( - 330404211, response.iterator().next().bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals(1703864947, response.iterator().next().bgpConfiguration().bfdConfiguration().multiplier()); - Assertions - .assertEquals( - BooleanEnumProperty.TRUE, response.iterator().next().bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(1917378904, response.iterator().next().bgpConfiguration().allowAS()); - Assertions - .assertEquals(AllowASOverride.DISABLE, response.iterator().next().bgpConfiguration().allowASOverride()); - Assertions.assertEquals(5038580319715936459L, response.iterator().next().bgpConfiguration().peerAsn()); - Assertions - .assertEquals( - "qcwkkgqysyajmm", response.iterator().next().bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions - .assertEquals( - "pdcbgrufsdbkuxkd", response.iterator().next().bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions - .assertEquals("s", response.iterator().next().bgpConfiguration().ipv4NeighborAddress().get(0).address()); - Assertions - .assertEquals( - "cwbshfihvl", response.iterator().next().bgpConfiguration().ipv6NeighborAddress().get(0).address()); - Assertions - .assertEquals( - 153975781, - response.iterator().next().staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 1733957433, response.iterator().next().staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions - .assertEquals( - "aprqtfkmvz", response.iterator().next().staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals( - "pmonxdwf", response.iterator().next().staticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions - .assertEquals("jn", response.iterator().next().staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions - .assertEquals( - "gnydlkrnpsb", - response.iterator().next().staticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions - .assertEquals(Extension.NO_EXTENSION, response.iterator().next().staticRouteConfiguration().extension()); - Assertions.assertEquals(1320949648, response.iterator().next().mtu()); - Assertions.assertEquals("rcifflxqqn", response.iterator().next().connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("cowken", response.iterator().next().connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("baib", response.iterator().next().connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("ufpvvdgnmeiomn", response.iterator().next().connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("onhbl", response.iterator().next().importRoutePolicyId()); - Assertions.assertEquals("vcnuqfpz", response.iterator().next().exportRoutePolicyId()); - Assertions - .assertEquals("bpcwtwtrchkcmru", response.iterator().next().importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("qesqsqmiek", response.iterator().next().importRoutePolicy().importIpv6RoutePolicyId()); - Assertions - .assertEquals("wqchfptykkvj", response.iterator().next().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("bajcurzy", response.iterator().next().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("kbgumuejxxpx", response.iterator().next().ingressAclId()); - Assertions.assertEquals("zch", response.iterator().next().egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.FALSE, response.iterator().next().isMonitoringEnabled()); - Assertions.assertEquals(Extension.NO_EXTENSION, response.iterator().next().extension()); - Assertions.assertEquals("nrkjkng", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksListTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksListTests.java deleted file mode 100644 index e4bcf861a483..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksListTests.java +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkInner; -import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.Extension; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPropertiesBgpConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPropertiesStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworksList; -import com.azure.resourcemanager.managednetworkfabric.models.IsMonitoringEnabled; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InternalNetworksListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternalNetworksList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"vlanId\":1621268309,\"bgpConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":1775502514,\"multiplier\":1579715380},\"defaultRouteOriginate\":\"True\",\"allowAS\":1297838264,\"allowASOverride\":\"Enable\",\"fabricASN\":4454526690176817035,\"peerASN\":8048036117290127437,\"ipv4ListenRangePrefixes\":[\"tbkewkqynspg\",\"voffbkkwvdxae\"],\"ipv6ListenRangePrefixes\":[\"kmyrljialzbnobr\",\"lpbcjtrpz\"],\"ipv4NeighborAddress\":[{},{},{},{}],\"ipv6NeighborAddress\":[{}],\"annotation\":\"bxnhsqeaeo\"},\"staticRouteConfiguration\":{\"extension\":\"NPB\",\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":1151163794,\"multiplier\":1096882679},\"ipv4Routes\":[{\"prefix\":\"tzarogatmoljiy\",\"nextHop\":[]}],\"ipv6Routes\":[{\"prefix\":\"inmzvfkne\",\"nextHop\":[]}]},\"configurationState\":\"Accepted\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"MAT\",\"mtu\":494194714,\"connectedIPv4Subnets\":[{\"prefix\":\"lugdybnhrxlelf\",\"annotation\":\"k\"},{\"prefix\":\"izcpihtdmiw\",\"annotation\":\"kpty\"},{\"prefix\":\"aydb\",\"annotation\":\"c\"},{\"prefix\":\"ymlcfnzhmhsurlg\",\"annotation\":\"kpmmz\"}],\"connectedIPv6Subnets\":[{\"prefix\":\"auolawiu\",\"annotation\":\"oms\"},{\"prefix\":\"vvjhvvlrlohewjj\",\"annotation\":\"jnkdflqion\"},{\"prefix\":\"waeqkzfzqxjosho\",\"annotation\":\"otryegp\"},{\"prefix\":\"h\",\"annotation\":\"mexznlwkb\"}],\"importRoutePolicyId\":\"kxkhupzerufgj\",\"exportRoutePolicyId\":\"cdr\",\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"cemftzgyykyalu\",\"importIpv6RoutePolicyId\":\"kd\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"httwdowr\",\"exportIpv6RoutePolicyId\":\"fjjnnuxxr\"},\"ingressAclId\":\"mhmnulwemp\",\"egressAclId\":\"ifrhjulrsul\",\"isMonitoringEnabled\":\"True\",\"extension\":\"NPB\",\"annotation\":\"snawmhhgzotfri\"},\"id\":\"gkoekvzwxxyxh\",\"name\":\"ghctxbxmolpcqyde\",\"type\":\"kvskiczdfrjei\"}],\"nextLink\":\"kgqaboo\"}") - .toObject(InternalNetworksList.class); - Assertions.assertEquals(1621268309, model.value().get(0).vlanId()); - Assertions.assertEquals("bxnhsqeaeo", model.value().get(0).bgpConfiguration().annotation()); - Assertions - .assertEquals( - 1775502514, model.value().get(0).bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1579715380, model.value().get(0).bgpConfiguration().bfdConfiguration().multiplier()); - Assertions - .assertEquals(BooleanEnumProperty.TRUE, model.value().get(0).bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(1297838264, model.value().get(0).bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.ENABLE, model.value().get(0).bgpConfiguration().allowASOverride()); - Assertions.assertEquals(8048036117290127437L, model.value().get(0).bgpConfiguration().peerAsn()); - Assertions - .assertEquals("tbkewkqynspg", model.value().get(0).bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions - .assertEquals("kmyrljialzbnobr", model.value().get(0).bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions - .assertEquals( - 1151163794, - model.value().get(0).staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals(1096882679, model.value().get(0).staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions - .assertEquals( - "tzarogatmoljiy", model.value().get(0).staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals("inmzvfkne", model.value().get(0).staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals(Extension.NPB, model.value().get(0).staticRouteConfiguration().extension()); - Assertions.assertEquals(494194714, model.value().get(0).mtu()); - Assertions.assertEquals("k", model.value().get(0).connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("lugdybnhrxlelf", model.value().get(0).connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("oms", model.value().get(0).connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("auolawiu", model.value().get(0).connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("kxkhupzerufgj", model.value().get(0).importRoutePolicyId()); - Assertions.assertEquals("cdr", model.value().get(0).exportRoutePolicyId()); - Assertions.assertEquals("cemftzgyykyalu", model.value().get(0).importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("kd", model.value().get(0).importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("httwdowr", model.value().get(0).exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("fjjnnuxxr", model.value().get(0).exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("mhmnulwemp", model.value().get(0).ingressAclId()); - Assertions.assertEquals("ifrhjulrsul", model.value().get(0).egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.TRUE, model.value().get(0).isMonitoringEnabled()); - Assertions.assertEquals(Extension.NPB, model.value().get(0).extension()); - Assertions.assertEquals("snawmhhgzotfri", model.value().get(0).annotation()); - Assertions.assertEquals("kgqaboo", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternalNetworksList model = - new InternalNetworksList() - .withValue( - Arrays - .asList( - new InternalNetworkInner() - .withVlanId(1621268309) - .withBgpConfiguration( - new InternalNetworkPropertiesBgpConfiguration() - .withAnnotation("bxnhsqeaeo") - .withBfdConfiguration( - new BfdConfiguration() - .withIntervalInMilliSeconds(1775502514) - .withMultiplier(1579715380)) - .withDefaultRouteOriginate(BooleanEnumProperty.TRUE) - .withAllowAS(1297838264) - .withAllowASOverride(AllowASOverride.ENABLE) - .withPeerAsn(8048036117290127437L) - .withIpv4ListenRangePrefixes(Arrays.asList("tbkewkqynspg", "voffbkkwvdxae")) - .withIpv6ListenRangePrefixes(Arrays.asList("kmyrljialzbnobr", "lpbcjtrpz")) - .withIpv4NeighborAddress( - Arrays - .asList( - new NeighborAddress(), - new NeighborAddress(), - new NeighborAddress(), - new NeighborAddress())) - .withIpv6NeighborAddress(Arrays.asList(new NeighborAddress()))) - .withStaticRouteConfiguration( - new InternalNetworkPropertiesStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration() - .withIntervalInMilliSeconds(1151163794) - .withMultiplier(1096882679)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("tzarogatmoljiy") - .withNextHop(Arrays.asList()))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("inmzvfkne") - .withNextHop(Arrays.asList()))) - .withExtension(Extension.NPB)) - .withMtu(494194714) - .withConnectedIPv4Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("k").withPrefix("lugdybnhrxlelf"), - new ConnectedSubnet().withAnnotation("kpty").withPrefix("izcpihtdmiw"), - new ConnectedSubnet().withAnnotation("c").withPrefix("aydb"), - new ConnectedSubnet() - .withAnnotation("kpmmz") - .withPrefix("ymlcfnzhmhsurlg"))) - .withConnectedIPv6Subnets( - Arrays - .asList( - new ConnectedSubnet().withAnnotation("oms").withPrefix("auolawiu"), - new ConnectedSubnet() - .withAnnotation("jnkdflqion") - .withPrefix("vvjhvvlrlohewjj"), - new ConnectedSubnet() - .withAnnotation("otryegp") - .withPrefix("waeqkzfzqxjosho"), - new ConnectedSubnet().withAnnotation("mexznlwkb").withPrefix("h"))) - .withImportRoutePolicyId("kxkhupzerufgj") - .withExportRoutePolicyId("cdr") - .withImportRoutePolicy( - new ImportRoutePolicy() - .withImportIpv4RoutePolicyId("cemftzgyykyalu") - .withImportIpv6RoutePolicyId("kd")) - .withExportRoutePolicy( - new ExportRoutePolicy() - .withExportIpv4RoutePolicyId("httwdowr") - .withExportIpv6RoutePolicyId("fjjnnuxxr")) - .withIngressAclId("mhmnulwemp") - .withEgressAclId("ifrhjulrsul") - .withIsMonitoringEnabled(IsMonitoringEnabled.TRUE) - .withExtension(Extension.NPB) - .withAnnotation("snawmhhgzotfri"))) - .withNextLink("kgqaboo"); - model = BinaryData.fromObject(model).toObject(InternalNetworksList.class); - Assertions.assertEquals(1621268309, model.value().get(0).vlanId()); - Assertions.assertEquals("bxnhsqeaeo", model.value().get(0).bgpConfiguration().annotation()); - Assertions - .assertEquals( - 1775502514, model.value().get(0).bgpConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1579715380, model.value().get(0).bgpConfiguration().bfdConfiguration().multiplier()); - Assertions - .assertEquals(BooleanEnumProperty.TRUE, model.value().get(0).bgpConfiguration().defaultRouteOriginate()); - Assertions.assertEquals(1297838264, model.value().get(0).bgpConfiguration().allowAS()); - Assertions.assertEquals(AllowASOverride.ENABLE, model.value().get(0).bgpConfiguration().allowASOverride()); - Assertions.assertEquals(8048036117290127437L, model.value().get(0).bgpConfiguration().peerAsn()); - Assertions - .assertEquals("tbkewkqynspg", model.value().get(0).bgpConfiguration().ipv4ListenRangePrefixes().get(0)); - Assertions - .assertEquals("kmyrljialzbnobr", model.value().get(0).bgpConfiguration().ipv6ListenRangePrefixes().get(0)); - Assertions - .assertEquals( - 1151163794, - model.value().get(0).staticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals(1096882679, model.value().get(0).staticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions - .assertEquals( - "tzarogatmoljiy", model.value().get(0).staticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals("inmzvfkne", model.value().get(0).staticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals(Extension.NPB, model.value().get(0).staticRouteConfiguration().extension()); - Assertions.assertEquals(494194714, model.value().get(0).mtu()); - Assertions.assertEquals("k", model.value().get(0).connectedIPv4Subnets().get(0).annotation()); - Assertions.assertEquals("lugdybnhrxlelf", model.value().get(0).connectedIPv4Subnets().get(0).prefix()); - Assertions.assertEquals("oms", model.value().get(0).connectedIPv6Subnets().get(0).annotation()); - Assertions.assertEquals("auolawiu", model.value().get(0).connectedIPv6Subnets().get(0).prefix()); - Assertions.assertEquals("kxkhupzerufgj", model.value().get(0).importRoutePolicyId()); - Assertions.assertEquals("cdr", model.value().get(0).exportRoutePolicyId()); - Assertions.assertEquals("cemftzgyykyalu", model.value().get(0).importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("kd", model.value().get(0).importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("httwdowr", model.value().get(0).exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("fjjnnuxxr", model.value().get(0).exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("mhmnulwemp", model.value().get(0).ingressAclId()); - Assertions.assertEquals("ifrhjulrsul", model.value().get(0).egressAclId()); - Assertions.assertEquals(IsMonitoringEnabled.TRUE, model.value().get(0).isMonitoringEnabled()); - Assertions.assertEquals(Extension.NPB, model.value().get(0).extension()); - Assertions.assertEquals("snawmhhgzotfri", model.value().get(0).annotation()); - Assertions.assertEquals("kgqaboo", model.nextLink()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateAdministrativeStateMockTests.java deleted file mode 100644 index fa4182bb3233..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InternalNetworksUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"ErrorDeprovisioning\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .internalNetworks() - .updateAdministrativeState( - "poeeytrslj", - "mzuicsggsxznbp", - "mkqbylbbnjldicq", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("fwl", "nitvkyahfoyfzo", "dyaepre")) - .withState(EnableDisableState.ENABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBgpAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBgpAdministrativeStateMockTests.java deleted file mode 100644 index 56bb4cfaebbf..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBgpAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InternalNetworksUpdateBgpAdministrativeStateMockTests { - @Test - public void testUpdateBgpAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"DeferredControl\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .internalNetworks() - .updateBgpAdministrativeState( - "kfalw", - "eechcayvqbeqp", - "cnusnylfhi", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("ybfby", "rlq")) - .withState(EnableDisableState.DISABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateStaticRouteBfdAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateStaticRouteBfdAdministrativeStateMockTests.java deleted file mode 100644 index 06f1d9b0cbd1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateStaticRouteBfdAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InternalNetworksUpdateStaticRouteBfdAdministrativeStateMockTests { - @Test - public void testUpdateStaticRouteBfdAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"DeferredControl\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .internalNetworks() - .updateStaticRouteBfdAdministrativeState( - "fsnqocybrh", - "giknrlugseiqb", - "oqjfeamzkuxdgpks", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("nvnj", "ldrqqv", "ugusqlx")) - .withState(EnableDisableState.DISABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayInnerTests.java deleted file mode 100644 index 7df975dd28de..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayInnerTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternetGatewayInner; -import com.azure.resourcemanager.managednetworkfabric.models.GatewayType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InternetGatewayInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternetGatewayInner model = - BinaryData - .fromString( - "{\"properties\":{\"ipv4Address\":\"spkxkdt\",\"port\":908846418,\"type\":\"Workload\",\"networkFabricControllerId\":\"dlqvtwknvg\",\"provisioningState\":\"Accepted\",\"internetGatewayRuleId\":\"gtywatmqaqkue\",\"annotation\":\"groeshoyg\"},\"location\":\"byfqxkfaoy\",\"tags\":{\"mtdwcky\":\"qpuvjmv\"},\"id\":\"roejnndl\",\"name\":\"djus\",\"type\":\"br\"}") - .toObject(InternetGatewayInner.class); - Assertions.assertEquals("byfqxkfaoy", model.location()); - Assertions.assertEquals("qpuvjmv", model.tags().get("mtdwcky")); - Assertions.assertEquals(GatewayType.WORKLOAD, model.typePropertiesType()); - Assertions.assertEquals("dlqvtwknvg", model.networkFabricControllerId()); - Assertions.assertEquals("gtywatmqaqkue", model.internetGatewayRuleId()); - Assertions.assertEquals("groeshoyg", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternetGatewayInner model = - new InternetGatewayInner() - .withLocation("byfqxkfaoy") - .withTags(mapOf("mtdwcky", "qpuvjmv")) - .withTypePropertiesType(GatewayType.WORKLOAD) - .withNetworkFabricControllerId("dlqvtwknvg") - .withInternetGatewayRuleId("gtywatmqaqkue") - .withAnnotation("groeshoyg"); - model = BinaryData.fromObject(model).toObject(InternetGatewayInner.class); - Assertions.assertEquals("byfqxkfaoy", model.location()); - Assertions.assertEquals("qpuvjmv", model.tags().get("mtdwcky")); - Assertions.assertEquals(GatewayType.WORKLOAD, model.typePropertiesType()); - Assertions.assertEquals("dlqvtwknvg", model.networkFabricControllerId()); - Assertions.assertEquals("gtywatmqaqkue", model.internetGatewayRuleId()); - Assertions.assertEquals("groeshoyg", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayPatchTests.java deleted file mode 100644 index 0689d735176e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayPatchTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGatewayPatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InternetGatewayPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternetGatewayPatch model = - BinaryData - .fromString( - "{\"properties\":{\"internetGatewayRuleId\":\"tpo\"},\"tags\":{\"r\":\"naz\",\"qalsxkd\":\"hzr\",\"vessm\":\"wqapfgsdp\",\"dqq\":\"hhkuuip\"}}") - .toObject(InternetGatewayPatch.class); - Assertions.assertEquals("naz", model.tags().get("r")); - Assertions.assertEquals("tpo", model.internetGatewayRuleId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternetGatewayPatch model = - new InternetGatewayPatch() - .withTags(mapOf("r", "naz", "qalsxkd", "hzr", "vessm", "wqapfgsdp", "dqq", "hhkuuip")) - .withInternetGatewayRuleId("tpo"); - model = BinaryData.fromObject(model).toObject(InternetGatewayPatch.class); - Assertions.assertEquals("naz", model.tags().get("r")); - Assertions.assertEquals("tpo", model.internetGatewayRuleId()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayPatchablePropertiesTests.java deleted file mode 100644 index 5f78046b244c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayPatchablePropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternetGatewayPatchableProperties; -import org.junit.jupiter.api.Assertions; - -public final class InternetGatewayPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternetGatewayPatchableProperties model = - BinaryData - .fromString("{\"internetGatewayRuleId\":\"tdacarvvlfn\"}") - .toObject(InternetGatewayPatchableProperties.class); - Assertions.assertEquals("tdacarvvlfn", model.internetGatewayRuleId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternetGatewayPatchableProperties model = - new InternetGatewayPatchableProperties().withInternetGatewayRuleId("tdacarvvlfn"); - model = BinaryData.fromObject(model).toObject(InternetGatewayPatchableProperties.class); - Assertions.assertEquals("tdacarvvlfn", model.internetGatewayRuleId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayPropertiesTests.java deleted file mode 100644 index 8bed34e7e0bf..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternetGatewayProperties; -import com.azure.resourcemanager.managednetworkfabric.models.GatewayType; -import org.junit.jupiter.api.Assertions; - -public final class InternetGatewayPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternetGatewayProperties model = - BinaryData - .fromString( - "{\"ipv4Address\":\"qyn\",\"port\":775860156,\"type\":\"Workload\",\"networkFabricControllerId\":\"sfaq\",\"provisioningState\":\"Failed\",\"internetGatewayRuleId\":\"wryshwd\",\"annotation\":\"vbxgkqusyb\"}") - .toObject(InternetGatewayProperties.class); - Assertions.assertEquals("vbxgkqusyb", model.annotation()); - Assertions.assertEquals(GatewayType.WORKLOAD, model.type()); - Assertions.assertEquals("sfaq", model.networkFabricControllerId()); - Assertions.assertEquals("wryshwd", model.internetGatewayRuleId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternetGatewayProperties model = - new InternetGatewayProperties() - .withAnnotation("vbxgkqusyb") - .withType(GatewayType.WORKLOAD) - .withNetworkFabricControllerId("sfaq") - .withInternetGatewayRuleId("wryshwd"); - model = BinaryData.fromObject(model).toObject(InternetGatewayProperties.class); - Assertions.assertEquals("vbxgkqusyb", model.annotation()); - Assertions.assertEquals(GatewayType.WORKLOAD, model.type()); - Assertions.assertEquals("sfaq", model.networkFabricControllerId()); - Assertions.assertEquals("wryshwd", model.internetGatewayRuleId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRuleInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRuleInnerTests.java deleted file mode 100644 index 64fa23c5183c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRuleInnerTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternetGatewayRuleInner; -import com.azure.resourcemanager.managednetworkfabric.models.Action; -import com.azure.resourcemanager.managednetworkfabric.models.RuleProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InternetGatewayRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternetGatewayRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"ruleProperties\":{\"action\":\"Allow\",\"addressList\":[\"lc\"]},\"provisioningState\":\"Succeeded\",\"internetGatewayIds\":[\"rhyzdf\",\"rsofpltdbmairrh\",\"hfnrac\",\"npq\"],\"annotation\":\"tuujwouh\"},\"location\":\"wsigrbjbxsj\",\"tags\":{\"vqkjyaznu\":\"i\",\"lv\":\"tggmuwdchozfnkfe\",\"oaiknaqlnuwig\":\"noakiz\"},\"id\":\"yxl\",\"name\":\"kwph\",\"type\":\"xzcwxhmpejt\"}") - .toObject(InternetGatewayRuleInner.class); - Assertions.assertEquals("wsigrbjbxsj", model.location()); - Assertions.assertEquals("i", model.tags().get("vqkjyaznu")); - Assertions.assertEquals(Action.ALLOW, model.ruleProperties().action()); - Assertions.assertEquals("lc", model.ruleProperties().addressList().get(0)); - Assertions.assertEquals("tuujwouh", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternetGatewayRuleInner model = - new InternetGatewayRuleInner() - .withLocation("wsigrbjbxsj") - .withTags(mapOf("vqkjyaznu", "i", "lv", "tggmuwdchozfnkfe", "oaiknaqlnuwig", "noakiz")) - .withRuleProperties(new RuleProperties().withAction(Action.ALLOW).withAddressList(Arrays.asList("lc"))) - .withAnnotation("tuujwouh"); - model = BinaryData.fromObject(model).toObject(InternetGatewayRuleInner.class); - Assertions.assertEquals("wsigrbjbxsj", model.location()); - Assertions.assertEquals("i", model.tags().get("vqkjyaznu")); - Assertions.assertEquals(Action.ALLOW, model.ruleProperties().action()); - Assertions.assertEquals("lc", model.ruleProperties().addressList().get(0)); - Assertions.assertEquals("tuujwouh", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulePatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulePatchTests.java deleted file mode 100644 index 99eca9862fae..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulePatchTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGatewayRulePatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InternetGatewayRulePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternetGatewayRulePatch model = - BinaryData - .fromString("{\"tags\":{\"ly\":\"q\",\"trjbhxykfhyq\":\"hluqwquls\"}}") - .toObject(InternetGatewayRulePatch.class); - Assertions.assertEquals("q", model.tags().get("ly")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternetGatewayRulePatch model = - new InternetGatewayRulePatch().withTags(mapOf("ly", "q", "trjbhxykfhyq", "hluqwquls")); - model = BinaryData.fromObject(model).toObject(InternetGatewayRulePatch.class); - Assertions.assertEquals("q", model.tags().get("ly")); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulePropertiesTests.java deleted file mode 100644 index 02689f33c712..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulePropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternetGatewayRuleProperties; -import com.azure.resourcemanager.managednetworkfabric.models.Action; -import com.azure.resourcemanager.managednetworkfabric.models.RuleProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InternetGatewayRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternetGatewayRuleProperties model = - BinaryData - .fromString( - "{\"ruleProperties\":{\"action\":\"Allow\",\"addressList\":[\"xaonwivkcqh\",\"xhxknlc\",\"rmmkyupiju\"]},\"provisioningState\":\"Accepted\",\"internetGatewayIds\":[\"kakfqfr\"],\"annotation\":\"myildudxjasc\"}") - .toObject(InternetGatewayRuleProperties.class); - Assertions.assertEquals("myildudxjasc", model.annotation()); - Assertions.assertEquals(Action.ALLOW, model.ruleProperties().action()); - Assertions.assertEquals("xaonwivkcqh", model.ruleProperties().addressList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternetGatewayRuleProperties model = - new InternetGatewayRuleProperties() - .withAnnotation("myildudxjasc") - .withRuleProperties( - new RuleProperties() - .withAction(Action.ALLOW) - .withAddressList(Arrays.asList("xaonwivkcqh", "xhxknlc", "rmmkyupiju"))); - model = BinaryData.fromObject(model).toObject(InternetGatewayRuleProperties.class); - Assertions.assertEquals("myildudxjasc", model.annotation()); - Assertions.assertEquals(Action.ALLOW, model.ruleProperties().action()); - Assertions.assertEquals("xaonwivkcqh", model.ruleProperties().addressList().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesCreateMockTests.java deleted file mode 100644 index 84b420364636..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesCreateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.Action; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGatewayRule; -import com.azure.resourcemanager.managednetworkfabric.models.RuleProperties; -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 InternetGatewayRulesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"ruleProperties\":{\"action\":\"Allow\",\"addressList\":[\"ovqdmhcej\",\"tfsmacjak\",\"kqwxqds\"]},\"provisioningState\":\"Succeeded\",\"internetGatewayIds\":[\"wdjox\",\"kbd\",\"sobvcnsb\"],\"annotation\":\"eznl\"},\"location\":\"nfzxtfzqyugt\",\"tags\":{\"lrlcm\":\"cwdyt\"},\"id\":\"bejywwwv\",\"name\":\"hwwkrmqevrh\",\"type\":\"a\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InternetGatewayRule response = - manager - .internetGatewayRules() - .define("gsingmhpavsfg") - .withRegion("fn") - .withExistingResourceGroup("zpyqbwhuecx") - .withRuleProperties( - new RuleProperties() - .withAction(Action.DENY) - .withAddressList(Arrays.asList("qrwwbdrwro", "klj", "zpqhqqsark", "ulfameaasj"))) - .withTags(mapOf("nrtc", "rhnxzmfvmw", "hmbydmvwnb", "rawwhyxf")) - .withAnnotation("k") - .create(); - - Assertions.assertEquals("nfzxtfzqyugt", response.location()); - Assertions.assertEquals("cwdyt", response.tags().get("lrlcm")); - Assertions.assertEquals(Action.ALLOW, response.ruleProperties().action()); - Assertions.assertEquals("ovqdmhcej", response.ruleProperties().addressList().get(0)); - Assertions.assertEquals("eznl", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index bf70f470e685..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.Action; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGatewayRule; -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 InternetGatewayRulesGetByResourceGroupWithResponseMockTests { - @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\":{\"ruleProperties\":{\"action\":\"Deny\",\"addressList\":[\"cbicfecthotb\",\"jwhz\",\"pxjvtwk\",\"jdpayx\"]},\"provisioningState\":\"Deleting\",\"internetGatewayIds\":[\"uzrgq\",\"tjfkgbtqqjobsy\",\"nen\"],\"annotation\":\"njqhdheosx\"},\"location\":\"fudmpfhwyp\",\"tags\":{\"aecct\":\"jtntcwgpdbbg\",\"p\":\"kfspvjrd\"},\"id\":\"vrm\",\"name\":\"rftyp\",\"type\":\"wjwiyyeohgmcmdjm\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InternetGatewayRule response = - manager - .internetGatewayRules() - .getByResourceGroupWithResponse("zyyhmgqaeivjqutx", "bgbzgfhzdzahk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("fudmpfhwyp", response.location()); - Assertions.assertEquals("jtntcwgpdbbg", response.tags().get("aecct")); - Assertions.assertEquals(Action.DENY, response.ruleProperties().action()); - Assertions.assertEquals("cbicfecthotb", response.ruleProperties().addressList().get(0)); - Assertions.assertEquals("njqhdheosx", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesListByResourceGroupMockTests.java deleted file mode 100644 index a0539c11872b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.Action; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGatewayRule; -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 InternetGatewayRulesListByResourceGroupMockTests { - @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\":{\"ruleProperties\":{\"action\":\"Allow\",\"addressList\":[\"zioxbgomvue\",\"r\",\"m\",\"fxnwcgzuoxixtxxx\"]},\"provisioningState\":\"Deleting\",\"internetGatewayIds\":[\"b\",\"nnrnkyj\",\"awpcbso\",\"zehcz\"],\"annotation\":\"ivcohsxv\"},\"location\":\"kjealkdbew\",\"tags\":{\"o\":\"vbmyzuqfdqdktrj\",\"ngjn\":\"szhh\",\"odnkqyipgkmjt\":\"kvzmxlffqg\",\"rfzjlflzagvdavab\":\"azmdzesimeftg\"},\"id\":\"iefcorzbida\",\"name\":\"beznicew\",\"type\":\"fajw\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.internetGatewayRules().listByResourceGroup("phwfnugsl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kjealkdbew", response.iterator().next().location()); - Assertions.assertEquals("vbmyzuqfdqdktrj", response.iterator().next().tags().get("o")); - Assertions.assertEquals(Action.ALLOW, response.iterator().next().ruleProperties().action()); - Assertions.assertEquals("zioxbgomvue", response.iterator().next().ruleProperties().addressList().get(0)); - Assertions.assertEquals("ivcohsxv", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesListMockTests.java deleted file mode 100644 index b2c57a316e2a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.Action; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGatewayRule; -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 InternetGatewayRulesListMockTests { - @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\":{\"ruleProperties\":{\"action\":\"Allow\",\"addressList\":[\"ciobbpwwsrz\",\"qx\"]},\"provisioningState\":\"Updating\",\"internetGatewayIds\":[\"uex\",\"mnteevfg\"],\"annotation\":\"fezraqs\"},\"location\":\"kodkgxq\",\"tags\":{\"glwdzfss\":\"rxgmzz\"},\"id\":\"fegaok\",\"name\":\"ddkkraj\",\"type\":\"yuklxkel\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.internetGatewayRules().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kodkgxq", response.iterator().next().location()); - Assertions.assertEquals("rxgmzz", response.iterator().next().tags().get("glwdzfss")); - Assertions.assertEquals(Action.ALLOW, response.iterator().next().ruleProperties().action()); - Assertions.assertEquals("ciobbpwwsrz", response.iterator().next().ruleProperties().addressList().get(0)); - Assertions.assertEquals("fezraqs", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesListResultTests.java deleted file mode 100644 index 184a3a34de0b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewayRulesListResultTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternetGatewayRuleInner; -import com.azure.resourcemanager.managednetworkfabric.models.Action; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGatewayRulesListResult; -import com.azure.resourcemanager.managednetworkfabric.models.RuleProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InternetGatewayRulesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternetGatewayRulesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"ruleProperties\":{\"action\":\"Allow\",\"addressList\":[\"ugdrftbc\",\"exreu\",\"uowtljvfwhrea\",\"khyxvrqtvbcz\"]},\"provisioningState\":\"Failed\",\"internetGatewayIds\":[\"gglmepjpfsey\",\"g\",\"angpszngafpgyl\"],\"annotation\":\"ecjujcng\"},\"location\":\"dyedmzrgjfo\",\"tags\":{\"kpztrgd\":\"bnoit\"},\"id\":\"x\",\"name\":\"coqra\",\"type\":\"wugyx\"},{\"properties\":{\"ruleProperties\":{\"action\":\"Allow\",\"addressList\":[\"tweialwvskbuhzac\",\"qtyltcoqcujp\",\"sxzakuejkm\",\"bizt\"]},\"provisioningState\":\"Failed\",\"internetGatewayIds\":[\"vovjufycsjmlbe\",\"yeji\",\"iuxegth\"],\"annotation\":\"tudaw\"},\"location\":\"jfel\",\"tags\":{\"ialwc\":\"pptcbgqnzmnhii\",\"ccgzpraoxnyu\":\"gckbb\",\"sgftipwc\":\"fa\",\"hza\":\"byubhiqdxyurnpn\"},\"id\":\"ccnuhiig\",\"name\":\"yl\",\"type\":\"ui\"},{\"properties\":{\"ruleProperties\":{\"action\":\"Allow\",\"addressList\":[\"vatvcrkd\",\"b\"]},\"provisioningState\":\"Deleting\",\"internetGatewayIds\":[\"h\"],\"annotation\":\"yhzlwxaeaovurexd\"},\"location\":\"sbdweaderzmwnt\",\"tags\":{\"jz\":\"gttmvmmagoaqyl\",\"mxitpfinzcpd\":\"jiuazjc\"},\"id\":\"tkrlgjmtbd\",\"name\":\"vcqguefzh\",\"type\":\"mpheqdur\"}],\"nextLink\":\"yujlfyoumpckyecl\"}") - .toObject(InternetGatewayRulesListResult.class); - Assertions.assertEquals("dyedmzrgjfo", model.value().get(0).location()); - Assertions.assertEquals("bnoit", model.value().get(0).tags().get("kpztrgd")); - Assertions.assertEquals(Action.ALLOW, model.value().get(0).ruleProperties().action()); - Assertions.assertEquals("ugdrftbc", model.value().get(0).ruleProperties().addressList().get(0)); - Assertions.assertEquals("ecjujcng", model.value().get(0).annotation()); - Assertions.assertEquals("yujlfyoumpckyecl", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternetGatewayRulesListResult model = - new InternetGatewayRulesListResult() - .withValue( - Arrays - .asList( - new InternetGatewayRuleInner() - .withLocation("dyedmzrgjfo") - .withTags(mapOf("kpztrgd", "bnoit")) - .withRuleProperties( - new RuleProperties() - .withAction(Action.ALLOW) - .withAddressList( - Arrays.asList("ugdrftbc", "exreu", "uowtljvfwhrea", "khyxvrqtvbcz"))) - .withAnnotation("ecjujcng"), - new InternetGatewayRuleInner() - .withLocation("jfel") - .withTags( - mapOf( - "ialwc", - "pptcbgqnzmnhii", - "ccgzpraoxnyu", - "gckbb", - "sgftipwc", - "fa", - "hza", - "byubhiqdxyurnpn")) - .withRuleProperties( - new RuleProperties() - .withAction(Action.ALLOW) - .withAddressList( - Arrays.asList("tweialwvskbuhzac", "qtyltcoqcujp", "sxzakuejkm", "bizt"))) - .withAnnotation("tudaw"), - new InternetGatewayRuleInner() - .withLocation("sbdweaderzmwnt") - .withTags(mapOf("jz", "gttmvmmagoaqyl", "mxitpfinzcpd", "jiuazjc")) - .withRuleProperties( - new RuleProperties() - .withAction(Action.ALLOW) - .withAddressList(Arrays.asList("vatvcrkd", "b"))) - .withAnnotation("yhzlwxaeaovurexd"))) - .withNextLink("yujlfyoumpckyecl"); - model = BinaryData.fromObject(model).toObject(InternetGatewayRulesListResult.class); - Assertions.assertEquals("dyedmzrgjfo", model.value().get(0).location()); - Assertions.assertEquals("bnoit", model.value().get(0).tags().get("kpztrgd")); - Assertions.assertEquals(Action.ALLOW, model.value().get(0).ruleProperties().action()); - Assertions.assertEquals("ugdrftbc", model.value().get(0).ruleProperties().addressList().get(0)); - Assertions.assertEquals("ecjujcng", model.value().get(0).annotation()); - Assertions.assertEquals("yujlfyoumpckyecl", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysCreateMockTests.java deleted file mode 100644 index ee83b20b534a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysCreateMockTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.GatewayType; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGateway; -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 InternetGatewaysCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"ipv4Address\":\"yvsbfsinvabdjul\",\"port\":858540581,\"type\":\"Workload\",\"networkFabricControllerId\":\"tudamkiyaosthul\",\"provisioningState\":\"Succeeded\",\"internetGatewayRuleId\":\"fgspxldlnocsc\",\"annotation\":\"imizlukjbwmg\"},\"location\":\"rlmspppoeszt\",\"tags\":{\"iylgzzu\":\"ryjsk\",\"o\":\"ixpsybqowgvmxw\"},\"id\":\"xdhkoex\",\"name\":\"rhgnakajwscmneev\",\"type\":\"umqeu\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InternetGateway response = - manager - .internetGateways() - .define("vozjezchme") - .withRegion("owqrzvuxn") - .withExistingResourceGroup("mbhukdfpknvk") - .withTypePropertiesType(GatewayType.INFRASTRUCTURE) - .withNetworkFabricControllerId("kwqphfvsf") - .withTags( - mapOf( - "mjdhypngo", - "ohshzultdb", - "zukekytkzvt", - "bdxvrivptbczsuzg", - "inha", - "maatvogpyc", - "khwfjudapbq", - "hbdxsbypl")) - .withInternetGatewayRuleId("wlpxc") - .withAnnotation("hdtezgfctu") - .create(); - - Assertions.assertEquals("rlmspppoeszt", response.location()); - Assertions.assertEquals("ryjsk", response.tags().get("iylgzzu")); - Assertions.assertEquals(GatewayType.WORKLOAD, response.typePropertiesType()); - Assertions.assertEquals("tudamkiyaosthul", response.networkFabricControllerId()); - Assertions.assertEquals("fgspxldlnocsc", response.internetGatewayRuleId()); - Assertions.assertEquals("imizlukjbwmg", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 577dce759541..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.GatewayType; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGateway; -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 InternetGatewaysGetByResourceGroupWithResponseMockTests { - @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\":{\"ipv4Address\":\"u\",\"port\":491610361,\"type\":\"Infrastructure\",\"networkFabricControllerId\":\"vo\",\"provisioningState\":\"Succeeded\",\"internetGatewayRuleId\":\"pwmgwxwukfjv\",\"annotation\":\"laxseisv\"},\"location\":\"gyphheovejkpalec\",\"tags\":{\"s\":\"thrtzpuv\",\"uo\":\"rgrqefn\",\"ehdhjofywwna\":\"louurmuzembqq\"},\"id\":\"oxlorxgsl\",\"name\":\"c\",\"type\":\"u\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InternetGateway response = - manager - .internetGateways() - .getByResourceGroupWithResponse("yoxmyqzyqepg", "bzd", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gyphheovejkpalec", response.location()); - Assertions.assertEquals("thrtzpuv", response.tags().get("s")); - Assertions.assertEquals(GatewayType.INFRASTRUCTURE, response.typePropertiesType()); - Assertions.assertEquals("vo", response.networkFabricControllerId()); - Assertions.assertEquals("pwmgwxwukfjv", response.internetGatewayRuleId()); - Assertions.assertEquals("laxseisv", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysListByResourceGroupMockTests.java deleted file mode 100644 index 4b461de86c16..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.GatewayType; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGateway; -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 InternetGatewaysListByResourceGroupMockTests { - @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\":{\"ipv4Address\":\"pmlutyju\",\"port\":127083264,\"type\":\"Infrastructure\",\"networkFabricControllerId\":\"putocr\",\"provisioningState\":\"Deleting\",\"internetGatewayRuleId\":\"icmdrgcuzjmvkr\",\"annotation\":\"jcqhgcmljzksqim\"},\"location\":\"qjvfio\",\"tags\":{\"dswbsskgq\":\"aqpvhszopeuku\",\"fsjbpwjwz\":\"emosq\",\"khxfpz\":\"gipdzym\",\"ibweua\":\"uudqhadxjvvl\"},\"id\":\"gtxlzncoqxtvytzq\",\"name\":\"yldjvzm\",\"type\":\"yrazzstjvcszb\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.internetGateways().listByResourceGroup("hvpaglyyhrgma", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qjvfio", response.iterator().next().location()); - Assertions.assertEquals("aqpvhszopeuku", response.iterator().next().tags().get("dswbsskgq")); - Assertions.assertEquals(GatewayType.INFRASTRUCTURE, response.iterator().next().typePropertiesType()); - Assertions.assertEquals("putocr", response.iterator().next().networkFabricControllerId()); - Assertions.assertEquals("icmdrgcuzjmvkr", response.iterator().next().internetGatewayRuleId()); - Assertions.assertEquals("jcqhgcmljzksqim", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysListMockTests.java deleted file mode 100644 index 7977ed65861e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.GatewayType; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGateway; -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 InternetGatewaysListMockTests { - @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\":{\"ipv4Address\":\"rlb\",\"port\":1053159639,\"type\":\"Workload\",\"networkFabricControllerId\":\"yolacbibtkeie\",\"provisioningState\":\"Accepted\",\"internetGatewayRuleId\":\"wxdsokrlnr\",\"annotation\":\"y\"},\"location\":\"iiul\",\"tags\":{\"xwwwvunknsgvxhx\":\"iqlnh\"},\"id\":\"meatrtcqyfjvifb\",\"name\":\"ojtehqyo\",\"type\":\"trcoufk\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.internetGateways().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("iiul", response.iterator().next().location()); - Assertions.assertEquals("iqlnh", response.iterator().next().tags().get("xwwwvunknsgvxhx")); - Assertions.assertEquals(GatewayType.WORKLOAD, response.iterator().next().typePropertiesType()); - Assertions.assertEquals("yolacbibtkeie", response.iterator().next().networkFabricControllerId()); - Assertions.assertEquals("wxdsokrlnr", response.iterator().next().internetGatewayRuleId()); - Assertions.assertEquals("y", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysListResultTests.java deleted file mode 100644 index 5d5ee5e0dcf9..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/InternetGatewaysListResultTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternetGatewayInner; -import com.azure.resourcemanager.managednetworkfabric.models.GatewayType; -import com.azure.resourcemanager.managednetworkfabric.models.InternetGatewaysListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InternetGatewaysListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InternetGatewaysListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"ipv4Address\":\"valblhtjqv\",\"port\":1207141724,\"type\":\"Workload\",\"networkFabricControllerId\":\"eh\",\"provisioningState\":\"Updating\",\"internetGatewayRuleId\":\"xhzzyse\",\"annotation\":\"sxivzrrryvei\"},\"location\":\"pskdyzatvfuzk\",\"tags\":{\"qdsmjtg\":\"jvvruxwigsyei\"},\"id\":\"qgdgkkile\",\"name\":\"lkcsmknhwtbbae\",\"type\":\"orvvmqfloygbdgw\"},{\"properties\":{\"ipv4Address\":\"gxdgdhpab\",\"port\":1275825078,\"type\":\"Infrastructure\",\"networkFabricControllerId\":\"jddvjsaqw\",\"provisioningState\":\"Canceled\",\"internetGatewayRuleId\":\"wllcolsr\",\"annotation\":\"apte\"},\"location\":\"excgjokjljnhvl\",\"tags\":{\"eeksnbksdqhjvyk\":\"ek\",\"vnwqjwgo\":\"xeslkhhustcpoqm\",\"bkjbz\":\"nlejjjkxybwf\",\"nsxfwu\":\"ensvkzykjtj\"},\"id\":\"hcdpkupnqrmgj\",\"name\":\"bpkuwxeoio\",\"type\":\"fiz\"},{\"properties\":{\"ipv4Address\":\"vkjzwfbcyaykm\",\"port\":313297047,\"type\":\"Infrastructure\",\"networkFabricControllerId\":\"bfw\",\"provisioningState\":\"Succeeded\",\"internetGatewayRuleId\":\"mdew\",\"annotation\":\"sxkrpl\"},\"location\":\"aze\",\"tags\":{\"qwjhqkbiwetpozyc\":\"viyoypsuhbrnnhjx\"},\"id\":\"qiqyhgfsetzlexbs\",\"name\":\"ledynojpz\",\"type\":\"uwfbzkkdtnhqsy\"}],\"nextLink\":\"jselpkpbafvafh\"}") - .toObject(InternetGatewaysListResult.class); - Assertions.assertEquals("pskdyzatvfuzk", model.value().get(0).location()); - Assertions.assertEquals("jvvruxwigsyei", model.value().get(0).tags().get("qdsmjtg")); - Assertions.assertEquals(GatewayType.WORKLOAD, model.value().get(0).typePropertiesType()); - Assertions.assertEquals("eh", model.value().get(0).networkFabricControllerId()); - Assertions.assertEquals("xhzzyse", model.value().get(0).internetGatewayRuleId()); - Assertions.assertEquals("sxivzrrryvei", model.value().get(0).annotation()); - Assertions.assertEquals("jselpkpbafvafh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InternetGatewaysListResult model = - new InternetGatewaysListResult() - .withValue( - Arrays - .asList( - new InternetGatewayInner() - .withLocation("pskdyzatvfuzk") - .withTags(mapOf("qdsmjtg", "jvvruxwigsyei")) - .withTypePropertiesType(GatewayType.WORKLOAD) - .withNetworkFabricControllerId("eh") - .withInternetGatewayRuleId("xhzzyse") - .withAnnotation("sxivzrrryvei"), - new InternetGatewayInner() - .withLocation("excgjokjljnhvl") - .withTags( - mapOf( - "eeksnbksdqhjvyk", - "ek", - "vnwqjwgo", - "xeslkhhustcpoqm", - "bkjbz", - "nlejjjkxybwf", - "nsxfwu", - "ensvkzykjtj")) - .withTypePropertiesType(GatewayType.INFRASTRUCTURE) - .withNetworkFabricControllerId("jddvjsaqw") - .withInternetGatewayRuleId("wllcolsr") - .withAnnotation("apte"), - new InternetGatewayInner() - .withLocation("aze") - .withTags(mapOf("qwjhqkbiwetpozyc", "viyoypsuhbrnnhjx")) - .withTypePropertiesType(GatewayType.INFRASTRUCTURE) - .withNetworkFabricControllerId("bfw") - .withInternetGatewayRuleId("mdew") - .withAnnotation("sxkrpl"))) - .withNextLink("jselpkpbafvafh"); - model = BinaryData.fromObject(model).toObject(InternetGatewaysListResult.class); - Assertions.assertEquals("pskdyzatvfuzk", model.value().get(0).location()); - Assertions.assertEquals("jvvruxwigsyei", model.value().get(0).tags().get("qdsmjtg")); - Assertions.assertEquals(GatewayType.WORKLOAD, model.value().get(0).typePropertiesType()); - Assertions.assertEquals("eh", model.value().get(0).networkFabricControllerId()); - Assertions.assertEquals("xhzzyse", model.value().get(0).internetGatewayRuleId()); - Assertions.assertEquals("sxivzrrryvei", model.value().get(0).annotation()); - Assertions.assertEquals("jselpkpbafvafh", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesCreateMockTests.java deleted file mode 100644 index a4f164aa284c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesCreateMockTests.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunity; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityRule; -import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; -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 IpCommunitiesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"configurationState\":\"Succeeded\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"RMA\",\"ipCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":1934573662126007624,\"wellKnownCommunities\":[\"NoAdvertise\"],\"communityMembers\":[\"xywabkitnipa\",\"tgvnaqyj\"]},{\"action\":\"Deny\",\"sequenceNumber\":5190929238437453512,\"wellKnownCommunities\":[\"GShut\",\"GShut\",\"LocalAS\",\"NoAdvertise\"],\"communityMembers\":[\"onopf\",\"emiwfhhawbabhzbf\",\"di\"]}],\"annotation\":\"nxydgzfoiqzsus\"},\"location\":\"y\",\"tags\":{\"af\":\"lqeronz\",\"uwdbvytqav\":\"xf\"},\"id\":\"uymkdeuqxlvzpfd\",\"name\":\"axgbiwpgop\",\"type\":\"lktthbmrrmtrxg\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IpCommunity response = - manager - .ipCommunities() - .define("envtol") - .withRegion("gikkmibnmdpi") - .withExistingResourceGroup("zrrwsciclhdw") - .withTags( - mapOf( - "loqavst", - "wtgzwmzhcm", - "bngzldvvd", - "zavkyjjludnmbj", - "pmq", - "optythctoxo", - "sfzsgzgus", - "erwhemvids")) - .withIpCommunityRules( - Arrays - .asList( - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(4795950063400188951L) - .withWellKnownCommunities( - Arrays.asList(WellKnownCommunities.NO_EXPORT, WellKnownCommunities.NO_ADVERTISE)) - .withCommunityMembers(Arrays.asList("h", "wppvihbmwrv", "vdrohu")), - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(4939402553869338194L) - .withWellKnownCommunities(Arrays.asList(WellKnownCommunities.GSHUT)) - .withCommunityMembers(Arrays.asList("xj", "a")), - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(1871939289139657586L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.INTERNET, - WellKnownCommunities.GSHUT, - WellKnownCommunities.LOCAL_AS)) - .withCommunityMembers(Arrays.asList("tixkg", "obmkphvdlorxz")), - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(3690161019255251039L) - .withWellKnownCommunities( - Arrays.asList(WellKnownCommunities.GSHUT, WellKnownCommunities.INTERNET)) - .withCommunityMembers(Arrays.asList("tfcieil", "e")))) - .withAnnotation("tkehldopjsxvbb") - .create(); - - Assertions.assertEquals("y", response.location()); - Assertions.assertEquals("lqeronz", response.tags().get("af")); - Assertions.assertEquals(CommunityActionTypes.PERMIT, response.ipCommunityRules().get(0).action()); - Assertions.assertEquals(1934573662126007624L, response.ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals( - WellKnownCommunities.NO_ADVERTISE, response.ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("xywabkitnipa", response.ipCommunityRules().get(0).communityMembers().get(0)); - Assertions.assertEquals("nxydgzfoiqzsus", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index d12a8c546c7c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunity; -import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; -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 IpCommunitiesGetByResourceGroupWithResponseMockTests { - @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\":{\"configurationState\":\"Accepted\",\"provisioningState\":\"Failed\",\"administrativeState\":\"MAT\",\"ipCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":1698670082647863989,\"wellKnownCommunities\":[\"LocalAS\",\"LocalAS\",\"NoAdvertise\"],\"communityMembers\":[\"loxtvq\",\"b\"]},{\"action\":\"Permit\",\"sequenceNumber\":6180676424023342132,\"wellKnownCommunities\":[\"NoAdvertise\",\"Internet\"],\"communityMembers\":[\"nben\",\"p\",\"vokkyankxvcpt\",\"gfb\"]}],\"annotation\":\"kxasomafe\"},\"location\":\"z\",\"tags\":{\"pautfz\":\"dxp\",\"cyuwenbqvpraw\":\"trcdzytrtffvpkd\",\"dp\":\"oqatdjka\",\"smxfzynfemqy\":\"e\"},\"id\":\"kkp\",\"name\":\"wgssdquupirnb\",\"type\":\"lqyvdsqxkjwdzp\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IpCommunity response = - manager - .ipCommunities() - .getByResourceGroupWithResponse("qfudfyziruqv", "njxiakgyjmzb", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("z", response.location()); - Assertions.assertEquals("dxp", response.tags().get("pautfz")); - Assertions.assertEquals(CommunityActionTypes.PERMIT, response.ipCommunityRules().get(0).action()); - Assertions.assertEquals(1698670082647863989L, response.ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals( - WellKnownCommunities.LOCAL_AS, response.ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("loxtvq", response.ipCommunityRules().get(0).communityMembers().get(0)); - Assertions.assertEquals("kxasomafe", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListByResourceGroupMockTests.java deleted file mode 100644 index baebd86e81dd..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListByResourceGroupMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunity; -import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; -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 IpCommunitiesListByResourceGroupMockTests { - @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\":{\"configurationState\":\"Accepted\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"MAT\",\"ipCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":3384626957394506065,\"wellKnownCommunities\":[\"LocalAS\"],\"communityMembers\":[\"andbp\",\"rrhyjxcqcaczzvwa\",\"ztt\"]}],\"annotation\":\"qyfydql\"},\"location\":\"slgyfybdsvkllrz\",\"tags\":{\"jthprgfwhfzhhr\":\"hkbchcazkg\",\"zq\":\"rmrfyyqjcni\"},\"id\":\"sddcuqddlda\",\"name\":\"yvfzt\",\"type\":\"ew\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.ipCommunities().listByResourceGroup("irzyudrq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("slgyfybdsvkllrz", response.iterator().next().location()); - Assertions.assertEquals("hkbchcazkg", response.iterator().next().tags().get("jthprgfwhfzhhr")); - Assertions - .assertEquals(CommunityActionTypes.PERMIT, response.iterator().next().ipCommunityRules().get(0).action()); - Assertions - .assertEquals(3384626957394506065L, response.iterator().next().ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals( - WellKnownCommunities.LOCAL_AS, - response.iterator().next().ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions - .assertEquals("andbp", response.iterator().next().ipCommunityRules().get(0).communityMembers().get(0)); - Assertions.assertEquals("qyfydql", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListMockTests.java deleted file mode 100644 index 13d1ba56b91b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunity; -import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; -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 IpCommunitiesListMockTests { - @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\":{\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"RMA\",\"ipCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":4970968790910387449,\"wellKnownCommunities\":[\"NoExport\",\"NoAdvertise\",\"NoAdvertise\",\"Internet\"],\"communityMembers\":[\"oyineuaxpmezit\",\"guzlweoyxfoaf\",\"dypzlxlmndhgwhlb\",\"juajzqxavmitnwl\"]}],\"annotation\":\"bujysvdtyyddbhat\"},\"location\":\"btpgnq\",\"tags\":{\"ew\":\"nnr\"},\"id\":\"hciga\",\"name\":\"hmdfspkdn\",\"type\":\"qxzxtert\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.ipCommunities().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("btpgnq", response.iterator().next().location()); - Assertions.assertEquals("nnr", response.iterator().next().tags().get("ew")); - Assertions - .assertEquals(CommunityActionTypes.DENY, response.iterator().next().ipCommunityRules().get(0).action()); - Assertions - .assertEquals(4970968790910387449L, response.iterator().next().ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals( - WellKnownCommunities.NO_EXPORT, - response.iterator().next().ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions - .assertEquals( - "oyineuaxpmezit", response.iterator().next().ipCommunityRules().get(0).communityMembers().get(0)); - Assertions.assertEquals("bujysvdtyyddbhat", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListResultTests.java deleted file mode 100644 index 04cf9ea2abe4..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListResultTests.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityInner; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunitiesListResult; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityRule; -import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IpCommunitiesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpCommunitiesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"RMA\",\"ipCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":1422959044400322772,\"wellKnownCommunities\":[\"NoExport\"],\"communityMembers\":[\"gitsqh\",\"vbrzcdb\",\"nfzndscxmxeat\",\"db\"]},{\"action\":\"Deny\",\"sequenceNumber\":2580805120871115843,\"wellKnownCommunities\":[\"GShut\",\"LocalAS\"],\"communityMembers\":[\"q\",\"naomhjrm\",\"u\",\"maxljalfihcj\"]},{\"action\":\"Deny\",\"sequenceNumber\":2110046772829254579,\"wellKnownCommunities\":[\"GShut\"],\"communityMembers\":[\"exxqcwg\"]},{\"action\":\"Permit\",\"sequenceNumber\":2742032267971865419,\"wellKnownCommunities\":[\"Internet\",\"LocalAS\",\"Internet\"],\"communityMembers\":[\"zwjjzr\",\"tixldzyyfytpqs\"]}],\"annotation\":\"ymmpujivy\"},\"location\":\"kjuvs\",\"tags\":{\"zdbpqv\":\"slzoyov\"},\"id\":\"befgvmxn\",\"name\":\"kcvtl\",\"type\":\"bse\"},{\"properties\":{\"configurationState\":\"Deprovisioning\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Enabled\",\"ipCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":5713743179554383301,\"wellKnownCommunities\":[\"LocalAS\",\"NoAdvertise\",\"NoExport\",\"NoExport\"],\"communityMembers\":[\"cndzfqivjre\",\"ykbbmnwagltbxoe\"]},{\"action\":\"Permit\",\"sequenceNumber\":5100562583239732135,\"wellKnownCommunities\":[\"GShut\",\"Internet\",\"LocalAS\",\"Internet\"],\"communityMembers\":[\"mvqdbpbhfckdvez\",\"rcssbzhddubbnq\",\"b\",\"h\"]}],\"annotation\":\"lehpavawu\"},\"location\":\"qjtiogqgdm\",\"tags\":{\"gspnbonhpczykm\":\"ctteajohi\"},\"id\":\"tp\",\"name\":\"wxqcsehchkhufmpq\",\"type\":\"mqyjgy\"},{\"properties\":{\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"RMA\",\"ipCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":9167016379508265655,\"wellKnownCommunities\":[\"NoAdvertise\",\"Internet\"],\"communityMembers\":[\"hse\",\"wphpzfngqj\",\"lidftujwjj\",\"fwbeqrkuorh\"]},{\"action\":\"Deny\",\"sequenceNumber\":1522843195074318037,\"wellKnownCommunities\":[\"NoAdvertise\",\"GShut\",\"NoExport\"],\"communityMembers\":[\"hazcvjytiqswbqer\",\"w\"]}],\"annotation\":\"ytxtdgu\"},\"location\":\"lbpktg\",\"tags\":{\"swmowegmmuteyxe\":\"youambewr\",\"xlzdesygrijwa\":\"guqigijiitns\",\"fueqfrojs\":\"ufanray\",\"iecafygzmxi\":\"dgrhydkygywezs\"},\"id\":\"qv\",\"name\":\"smaklixqcahy\",\"type\":\"xalybxawoijpo\"}],\"nextLink\":\"blxpkkwjdjodq\"}") - .toObject(IpCommunitiesListResult.class); - Assertions.assertEquals("kjuvs", model.value().get(0).location()); - Assertions.assertEquals("slzoyov", model.value().get(0).tags().get("zdbpqv")); - Assertions.assertEquals(CommunityActionTypes.DENY, model.value().get(0).ipCommunityRules().get(0).action()); - Assertions.assertEquals(1422959044400322772L, model.value().get(0).ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals( - WellKnownCommunities.NO_EXPORT, - model.value().get(0).ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("gitsqh", model.value().get(0).ipCommunityRules().get(0).communityMembers().get(0)); - Assertions.assertEquals("ymmpujivy", model.value().get(0).annotation()); - Assertions.assertEquals("blxpkkwjdjodq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpCommunitiesListResult model = - new IpCommunitiesListResult() - .withValue( - Arrays - .asList( - new IpCommunityInner() - .withLocation("kjuvs") - .withTags(mapOf("zdbpqv", "slzoyov")) - .withIpCommunityRules( - Arrays - .asList( - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(1422959044400322772L) - .withWellKnownCommunities(Arrays.asList(WellKnownCommunities.NO_EXPORT)) - .withCommunityMembers( - Arrays.asList("gitsqh", "vbrzcdb", "nfzndscxmxeat", "db")), - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(2580805120871115843L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.GSHUT, WellKnownCommunities.LOCAL_AS)) - .withCommunityMembers( - Arrays.asList("q", "naomhjrm", "u", "maxljalfihcj")), - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(2110046772829254579L) - .withWellKnownCommunities(Arrays.asList(WellKnownCommunities.GSHUT)) - .withCommunityMembers(Arrays.asList("exxqcwg")), - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(2742032267971865419L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.INTERNET, - WellKnownCommunities.LOCAL_AS, - WellKnownCommunities.INTERNET)) - .withCommunityMembers(Arrays.asList("zwjjzr", "tixldzyyfytpqs")))) - .withAnnotation("ymmpujivy"), - new IpCommunityInner() - .withLocation("qjtiogqgdm") - .withTags(mapOf("gspnbonhpczykm", "ctteajohi")) - .withIpCommunityRules( - Arrays - .asList( - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(5713743179554383301L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.LOCAL_AS, - WellKnownCommunities.NO_ADVERTISE, - WellKnownCommunities.NO_EXPORT, - WellKnownCommunities.NO_EXPORT)) - .withCommunityMembers(Arrays.asList("cndzfqivjre", "ykbbmnwagltbxoe")), - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(5100562583239732135L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.GSHUT, - WellKnownCommunities.INTERNET, - WellKnownCommunities.LOCAL_AS, - WellKnownCommunities.INTERNET)) - .withCommunityMembers( - Arrays.asList("mvqdbpbhfckdvez", "rcssbzhddubbnq", "b", "h")))) - .withAnnotation("lehpavawu"), - new IpCommunityInner() - .withLocation("lbpktg") - .withTags( - mapOf( - "swmowegmmuteyxe", - "youambewr", - "xlzdesygrijwa", - "guqigijiitns", - "fueqfrojs", - "ufanray", - "iecafygzmxi", - "dgrhydkygywezs")) - .withIpCommunityRules( - Arrays - .asList( - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(9167016379508265655L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.NO_ADVERTISE, - WellKnownCommunities.INTERNET)) - .withCommunityMembers( - Arrays.asList("hse", "wphpzfngqj", "lidftujwjj", "fwbeqrkuorh")), - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(1522843195074318037L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.NO_ADVERTISE, - WellKnownCommunities.GSHUT, - WellKnownCommunities.NO_EXPORT)) - .withCommunityMembers(Arrays.asList("hazcvjytiqswbqer", "w")))) - .withAnnotation("ytxtdgu"))) - .withNextLink("blxpkkwjdjodq"); - model = BinaryData.fromObject(model).toObject(IpCommunitiesListResult.class); - Assertions.assertEquals("kjuvs", model.value().get(0).location()); - Assertions.assertEquals("slzoyov", model.value().get(0).tags().get("zdbpqv")); - Assertions.assertEquals(CommunityActionTypes.DENY, model.value().get(0).ipCommunityRules().get(0).action()); - Assertions.assertEquals(1422959044400322772L, model.value().get(0).ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals( - WellKnownCommunities.NO_EXPORT, - model.value().get(0).ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("gitsqh", model.value().get(0).ipCommunityRules().get(0).communityMembers().get(0)); - Assertions.assertEquals("ymmpujivy", model.value().get(0).annotation()); - Assertions.assertEquals("blxpkkwjdjodq", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityAddOperationPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityAddOperationPropertiesTests.java deleted file mode 100644 index d0508ebbaa82..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityAddOperationPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityAddOperationProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpCommunityAddOperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpCommunityAddOperationProperties model = - BinaryData - .fromString("{\"add\":{\"ipCommunityIds\":[\"bkqynlzx\",\"melupjckiehd\",\"vfoy\"]}}") - .toObject(IpCommunityAddOperationProperties.class); - Assertions.assertEquals("bkqynlzx", model.add().ipCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpCommunityAddOperationProperties model = - new IpCommunityAddOperationProperties() - .withAdd(new IpCommunityIdList().withIpCommunityIds(Arrays.asList("bkqynlzx", "melupjckiehd", "vfoy"))); - model = BinaryData.fromObject(model).toObject(IpCommunityAddOperationProperties.class); - Assertions.assertEquals("bkqynlzx", model.add().ipCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityDeleteOperationPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityDeleteOperationPropertiesTests.java deleted file mode 100644 index 40114713514e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityDeleteOperationPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityDeleteOperationProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpCommunityDeleteOperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpCommunityDeleteOperationProperties model = - BinaryData - .fromString("{\"delete\":{\"ipCommunityIds\":[\"ffgmcuanszeervg\"]}}") - .toObject(IpCommunityDeleteOperationProperties.class); - Assertions.assertEquals("ffgmcuanszeervg", model.delete().ipCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpCommunityDeleteOperationProperties model = - new IpCommunityDeleteOperationProperties() - .withDelete(new IpCommunityIdList().withIpCommunityIds(Arrays.asList("ffgmcuanszeervg"))); - model = BinaryData.fromObject(model).toObject(IpCommunityDeleteOperationProperties.class); - Assertions.assertEquals("ffgmcuanszeervg", model.delete().ipCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityIdListTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityIdListTests.java deleted file mode 100644 index fd5c2cba83a1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityIdListTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpCommunityIdListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpCommunityIdList model = - BinaryData - .fromString("{\"ipCommunityIds\":[\"vlqq\",\"yhbceevogir\",\"pwnqtvuxeu\"]}") - .toObject(IpCommunityIdList.class); - Assertions.assertEquals("vlqq", model.ipCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpCommunityIdList model = - new IpCommunityIdList().withIpCommunityIds(Arrays.asList("vlqq", "yhbceevogir", "pwnqtvuxeu")); - model = BinaryData.fromObject(model).toObject(IpCommunityIdList.class); - Assertions.assertEquals("vlqq", model.ipCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityInnerTests.java deleted file mode 100644 index 4e3be03e4c23..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityInnerTests.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityInner; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityRule; -import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IpCommunityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpCommunityInner model = - BinaryData - .fromString( - "{\"properties\":{\"configurationState\":\"Failed\",\"provisioningState\":\"Updating\",\"administrativeState\":\"MAT\",\"ipCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":1037126378625413919,\"wellKnownCommunities\":[\"GShut\",\"NoAdvertise\",\"LocalAS\"],\"communityMembers\":[\"ijo\"]},{\"action\":\"Deny\",\"sequenceNumber\":4159181794530217054,\"wellKnownCommunities\":[\"LocalAS\",\"NoExport\"],\"communityMembers\":[\"yzyzjd\",\"r\",\"jb\",\"xjeaoqaqbzgyh\"]},{\"action\":\"Permit\",\"sequenceNumber\":3671581328871244489,\"wellKnownCommunities\":[\"NoExport\",\"GShut\"],\"communityMembers\":[\"bqamteuliyslpk\",\"vmwfauxxep\",\"ywbo\"]},{\"action\":\"Deny\",\"sequenceNumber\":667749683088481045,\"wellKnownCommunities\":[\"LocalAS\",\"NoExport\",\"LocalAS\",\"NoExport\"],\"communityMembers\":[\"pkzfbojxj\",\"cs\",\"yqwixvcpwnkwywzw\",\"falickduoiqtamty\"]}],\"annotation\":\"kn\"},\"location\":\"wzawnvsbcfhzagxn\",\"tags\":{\"mwrzregzgyufutrw\":\"cvd\",\"hmeott\":\"weryekzk\"},\"id\":\"w\",\"name\":\"yos\",\"type\":\"wwhnhjtfvpn\"}") - .toObject(IpCommunityInner.class); - Assertions.assertEquals("wzawnvsbcfhzagxn", model.location()); - Assertions.assertEquals("cvd", model.tags().get("mwrzregzgyufutrw")); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipCommunityRules().get(0).action()); - Assertions.assertEquals(1037126378625413919L, model.ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals(WellKnownCommunities.GSHUT, model.ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("ijo", model.ipCommunityRules().get(0).communityMembers().get(0)); - Assertions.assertEquals("kn", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpCommunityInner model = - new IpCommunityInner() - .withLocation("wzawnvsbcfhzagxn") - .withTags(mapOf("mwrzregzgyufutrw", "cvd", "hmeott", "weryekzk")) - .withIpCommunityRules( - Arrays - .asList( - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(1037126378625413919L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.GSHUT, - WellKnownCommunities.NO_ADVERTISE, - WellKnownCommunities.LOCAL_AS)) - .withCommunityMembers(Arrays.asList("ijo")), - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(4159181794530217054L) - .withWellKnownCommunities( - Arrays.asList(WellKnownCommunities.LOCAL_AS, WellKnownCommunities.NO_EXPORT)) - .withCommunityMembers(Arrays.asList("yzyzjd", "r", "jb", "xjeaoqaqbzgyh")), - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(3671581328871244489L) - .withWellKnownCommunities( - Arrays.asList(WellKnownCommunities.NO_EXPORT, WellKnownCommunities.GSHUT)) - .withCommunityMembers(Arrays.asList("bqamteuliyslpk", "vmwfauxxep", "ywbo")), - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(667749683088481045L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.LOCAL_AS, - WellKnownCommunities.NO_EXPORT, - WellKnownCommunities.LOCAL_AS, - WellKnownCommunities.NO_EXPORT)) - .withCommunityMembers( - Arrays.asList("pkzfbojxj", "cs", "yqwixvcpwnkwywzw", "falickduoiqtamty")))) - .withAnnotation("kn"); - model = BinaryData.fromObject(model).toObject(IpCommunityInner.class); - Assertions.assertEquals("wzawnvsbcfhzagxn", model.location()); - Assertions.assertEquals("cvd", model.tags().get("mwrzregzgyufutrw")); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipCommunityRules().get(0).action()); - Assertions.assertEquals(1037126378625413919L, model.ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals(WellKnownCommunities.GSHUT, model.ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("ijo", model.ipCommunityRules().get(0).communityMembers().get(0)); - Assertions.assertEquals("kn", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityPatchTests.java deleted file mode 100644 index f3ac87710c7d..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityPatchTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityPatch; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityRule; -import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IpCommunityPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpCommunityPatch model = - BinaryData - .fromString( - "{\"properties\":{\"ipCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":5282438425697483362,\"wellKnownCommunities\":[\"LocalAS\",\"LocalAS\"],\"communityMembers\":[\"gygvfltgvdiho\",\"nkrxwetwkdrcy\",\"ucpcunnuzdqumoen\"]},{\"action\":\"Deny\",\"sequenceNumber\":3818690305014881198,\"wellKnownCommunities\":[\"GShut\",\"Internet\",\"NoAdvertise\",\"Internet\"],\"communityMembers\":[\"knd\",\"elqkaadlkn\",\"foanniyopetx\",\"vcnrly\"]}]},\"tags\":{\"wqpatvbqsdtcj\":\"caephbl\"}}") - .toObject(IpCommunityPatch.class); - Assertions.assertEquals("caephbl", model.tags().get("wqpatvbqsdtcj")); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipCommunityRules().get(0).action()); - Assertions.assertEquals(5282438425697483362L, model.ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals(WellKnownCommunities.LOCAL_AS, model.ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("gygvfltgvdiho", model.ipCommunityRules().get(0).communityMembers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpCommunityPatch model = - new IpCommunityPatch() - .withTags(mapOf("wqpatvbqsdtcj", "caephbl")) - .withIpCommunityRules( - Arrays - .asList( - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(5282438425697483362L) - .withWellKnownCommunities( - Arrays.asList(WellKnownCommunities.LOCAL_AS, WellKnownCommunities.LOCAL_AS)) - .withCommunityMembers( - Arrays.asList("gygvfltgvdiho", "nkrxwetwkdrcy", "ucpcunnuzdqumoen")), - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(3818690305014881198L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.GSHUT, - WellKnownCommunities.INTERNET, - WellKnownCommunities.NO_ADVERTISE, - WellKnownCommunities.INTERNET)) - .withCommunityMembers(Arrays.asList("knd", "elqkaadlkn", "foanniyopetx", "vcnrly")))); - model = BinaryData.fromObject(model).toObject(IpCommunityPatch.class); - Assertions.assertEquals("caephbl", model.tags().get("wqpatvbqsdtcj")); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipCommunityRules().get(0).action()); - Assertions.assertEquals(5282438425697483362L, model.ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals(WellKnownCommunities.LOCAL_AS, model.ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("gygvfltgvdiho", model.ipCommunityRules().get(0).communityMembers().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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityPatchablePropertiesTests.java deleted file mode 100644 index b82242b59371..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityPatchablePropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityRule; -import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpCommunityPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpCommunityPatchableProperties model = - BinaryData - .fromString( - "{\"ipCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":1928417575349186903,\"wellKnownCommunities\":[\"GShut\",\"NoExport\",\"LocalAS\",\"NoExport\"],\"communityMembers\":[\"htuwgmev\",\"afpwzyifrkgwl\"]},{\"action\":\"Permit\",\"sequenceNumber\":1109055211295154941,\"wellKnownCommunities\":[\"Internet\",\"GShut\",\"NoAdvertise\",\"NoExport\"],\"communityMembers\":[\"imsfayorp\",\"avkjog\",\"sl\"]},{\"action\":\"Deny\",\"sequenceNumber\":7242894455052354139,\"wellKnownCommunities\":[\"NoAdvertise\",\"NoAdvertise\",\"GShut\",\"NoAdvertise\"],\"communityMembers\":[\"xa\",\"kqsykvwjtqpke\",\"myltj\"]},{\"action\":\"Permit\",\"sequenceNumber\":6735926581234061180,\"wellKnownCommunities\":[\"Internet\",\"LocalAS\"],\"communityMembers\":[\"cclfgxannn\"]}]}") - .toObject(IpCommunityPatchableProperties.class); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipCommunityRules().get(0).action()); - Assertions.assertEquals(1928417575349186903L, model.ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals(WellKnownCommunities.GSHUT, model.ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("htuwgmev", model.ipCommunityRules().get(0).communityMembers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpCommunityPatchableProperties model = - new IpCommunityPatchableProperties() - .withIpCommunityRules( - Arrays - .asList( - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(1928417575349186903L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.GSHUT, - WellKnownCommunities.NO_EXPORT, - WellKnownCommunities.LOCAL_AS, - WellKnownCommunities.NO_EXPORT)) - .withCommunityMembers(Arrays.asList("htuwgmev", "afpwzyifrkgwl")), - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(1109055211295154941L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.INTERNET, - WellKnownCommunities.GSHUT, - WellKnownCommunities.NO_ADVERTISE, - WellKnownCommunities.NO_EXPORT)) - .withCommunityMembers(Arrays.asList("imsfayorp", "avkjog", "sl")), - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(7242894455052354139L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.NO_ADVERTISE, - WellKnownCommunities.NO_ADVERTISE, - WellKnownCommunities.GSHUT, - WellKnownCommunities.NO_ADVERTISE)) - .withCommunityMembers(Arrays.asList("xa", "kqsykvwjtqpke", "myltj")), - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(6735926581234061180L) - .withWellKnownCommunities( - Arrays.asList(WellKnownCommunities.INTERNET, WellKnownCommunities.LOCAL_AS)) - .withCommunityMembers(Arrays.asList("cclfgxannn")))); - model = BinaryData.fromObject(model).toObject(IpCommunityPatchableProperties.class); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipCommunityRules().get(0).action()); - Assertions.assertEquals(1928417575349186903L, model.ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals(WellKnownCommunities.GSHUT, model.ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("htuwgmev", model.ipCommunityRules().get(0).communityMembers().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityPropertiesTests.java deleted file mode 100644 index ed031a9c2586..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityPropertiesTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityRule; -import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpCommunityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpCommunityProperties model = - BinaryData - .fromString( - "{\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Failed\",\"administrativeState\":\"Enabled\",\"ipCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":7243568569040001370,\"wellKnownCommunities\":[\"NoExport\",\"LocalAS\",\"GShut\",\"NoAdvertise\"],\"communityMembers\":[\"uzpjlxeehux\",\"qhzlray\"]}],\"annotation\":\"zxlskihmxr\"}") - .toObject(IpCommunityProperties.class); - Assertions.assertEquals("zxlskihmxr", model.annotation()); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipCommunityRules().get(0).action()); - Assertions.assertEquals(7243568569040001370L, model.ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals( - WellKnownCommunities.NO_EXPORT, model.ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("uzpjlxeehux", model.ipCommunityRules().get(0).communityMembers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpCommunityProperties model = - new IpCommunityProperties() - .withAnnotation("zxlskihmxr") - .withIpCommunityRules( - Arrays - .asList( - new IpCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(7243568569040001370L) - .withWellKnownCommunities( - Arrays - .asList( - WellKnownCommunities.NO_EXPORT, - WellKnownCommunities.LOCAL_AS, - WellKnownCommunities.GSHUT, - WellKnownCommunities.NO_ADVERTISE)) - .withCommunityMembers(Arrays.asList("uzpjlxeehux", "qhzlray")))); - model = BinaryData.fromObject(model).toObject(IpCommunityProperties.class); - Assertions.assertEquals("zxlskihmxr", model.annotation()); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipCommunityRules().get(0).action()); - Assertions.assertEquals(7243568569040001370L, model.ipCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals( - WellKnownCommunities.NO_EXPORT, model.ipCommunityRules().get(0).wellKnownCommunities().get(0)); - Assertions.assertEquals("uzpjlxeehux", model.ipCommunityRules().get(0).communityMembers().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityRuleTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityRuleTests.java deleted file mode 100644 index f12dd46bff3b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityRuleTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityRule; -import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpCommunityRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpCommunityRule model = - BinaryData - .fromString( - "{\"action\":\"Permit\",\"sequenceNumber\":931334095588425258,\"wellKnownCommunities\":[\"GShut\",\"NoExport\"],\"communityMembers\":[\"xigpxvkqmaupxvpi\",\"dfaifyzyzeyuube\"]}") - .toObject(IpCommunityRule.class); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.action()); - Assertions.assertEquals(931334095588425258L, model.sequenceNumber()); - Assertions.assertEquals(WellKnownCommunities.GSHUT, model.wellKnownCommunities().get(0)); - Assertions.assertEquals("xigpxvkqmaupxvpi", model.communityMembers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpCommunityRule model = - new IpCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(931334095588425258L) - .withWellKnownCommunities(Arrays.asList(WellKnownCommunities.GSHUT, WellKnownCommunities.NO_EXPORT)) - .withCommunityMembers(Arrays.asList("xigpxvkqmaupxvpi", "dfaifyzyzeyuube")); - model = BinaryData.fromObject(model).toObject(IpCommunityRule.class); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.action()); - Assertions.assertEquals(931334095588425258L, model.sequenceNumber()); - Assertions.assertEquals(WellKnownCommunities.GSHUT, model.wellKnownCommunities().get(0)); - Assertions.assertEquals("xigpxvkqmaupxvpi", model.communityMembers().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitySetOperationPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitySetOperationPropertiesTests.java deleted file mode 100644 index 54c367869ac4..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitySetOperationPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunitySetOperationProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpCommunitySetOperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpCommunitySetOperationProperties model = - BinaryData - .fromString("{\"set\":{\"ipCommunityIds\":[\"ap\",\"bcqpfusekij\",\"minenkbivpy\"]}}") - .toObject(IpCommunitySetOperationProperties.class); - Assertions.assertEquals("ap", model.set().ipCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpCommunitySetOperationProperties model = - new IpCommunitySetOperationProperties() - .withSet(new IpCommunityIdList().withIpCommunityIds(Arrays.asList("ap", "bcqpfusekij", "minenkbivpy"))); - model = BinaryData.fromObject(model).toObject(IpCommunitySetOperationProperties.class); - Assertions.assertEquals("ap", model.set().ipCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesCreateMockTests.java deleted file mode 100644 index e98eeb940c37..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesCreateMockTests.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunity; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityRule; -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 IpExtendedCommunitiesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"configurationState\":\"ErrorDeprovisioning\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"Enabled\",\"ipExtendedCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":3441323160807993650,\"routeTargets\":[\"lqwzkny\",\"j\"]}],\"annotation\":\"svclfjycl\"},\"location\":\"ldlfflleirmtx\",\"tags\":{\"cryvidbzdylbvj\":\"fildcgbfouzfbp\",\"rzsqm\":\"tgngwnxjftecg\"},\"id\":\"dq\",\"name\":\"akzbyqha\",\"type\":\"t\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IpExtendedCommunity response = - manager - .ipExtendedCommunities() - .define("cnuqhqpvtw") - .withRegion("tejobjzrl") - .withExistingResourceGroup("vkbuxlepg") - .withIpExtendedCommunityRules( - Arrays - .asList( - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(4571737221481443797L) - .withRouteTargets(Arrays.asList("ntbfytnhdnihu", "zjuzvw", "bzdtorbiwnyfzdpx")))) - .withTags(mapOf("nzalgm", "d", "uudvbgvzlzjsb", "upjhltyl")) - .withAnnotation("sucr") - .create(); - - Assertions.assertEquals("ldlfflleirmtx", response.location()); - Assertions.assertEquals("fildcgbfouzfbp", response.tags().get("cryvidbzdylbvj")); - Assertions.assertEquals(CommunityActionTypes.DENY, response.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(3441323160807993650L, response.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("lqwzkny", response.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - Assertions.assertEquals("svclfjycl", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index aa95f5013930..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunity; -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 IpExtendedCommunitiesGetByResourceGroupWithResponseMockTests { - @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\":{\"configurationState\":\"Rejected\",\"provisioningState\":\"Failed\",\"administrativeState\":\"Disabled\",\"ipExtendedCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":6028044034409859067,\"routeTargets\":[\"ijtickzovguzp\",\"pxhhboigzxkop\",\"lrzhtocjzfppexu\"]},{\"action\":\"Permit\",\"sequenceNumber\":8525602463707733170,\"routeTargets\":[\"nkjwgiitvjcmimb\",\"swskbbbj\",\"yp\"]}],\"annotation\":\"odaq\"},\"location\":\"kp\",\"tags\":{\"brtvtgolmlplgtla\":\"fsobggvalcrqaxl\",\"oysxaqq\":\"yxhxj\"},\"id\":\"hdfhfaob\",\"name\":\"njc\",\"type\":\"bozvc\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IpExtendedCommunity response = - manager - .ipExtendedCommunities() - .getByResourceGroupWithResponse("mpdvrjzwa", "pe", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kp", response.location()); - Assertions.assertEquals("fsobggvalcrqaxl", response.tags().get("brtvtgolmlplgtla")); - Assertions.assertEquals(CommunityActionTypes.PERMIT, response.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(6028044034409859067L, response.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("ijtickzovguzp", response.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - Assertions.assertEquals("odaq", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListByResourceGroupMockTests.java deleted file mode 100644 index 1e8950f8d92d..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunity; -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 IpExtendedCommunitiesListByResourceGroupMockTests { - @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\":{\"configurationState\":\"Provisioned\",\"provisioningState\":\"Updating\",\"administrativeState\":\"RMA\",\"ipExtendedCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":3554242738223001924,\"routeTargets\":[\"njuvtz\",\"j\",\"dlxbaeyocpkv\",\"tjfdzfmnpbdrc\"]}],\"annotation\":\"jxnnnoz\"},\"location\":\"h\",\"tags\":{\"amqobqehs\":\"u\",\"syzfeoctrzjw\":\"sht\"},\"id\":\"zwckzebmbvwdxgyy\",\"name\":\"mxqzl\",\"type\":\"l\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.ipExtendedCommunities().listByResourceGroup("qwssyd", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("h", response.iterator().next().location()); - Assertions.assertEquals("u", response.iterator().next().tags().get("amqobqehs")); - Assertions - .assertEquals( - CommunityActionTypes.PERMIT, response.iterator().next().ipExtendedCommunityRules().get(0).action()); - Assertions - .assertEquals( - 3554242738223001924L, response.iterator().next().ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals("njuvtz", response.iterator().next().ipExtendedCommunityRules().get(0).routeTargets().get(0)); - Assertions.assertEquals("jxnnnoz", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListMockTests.java deleted file mode 100644 index e22fc75b01a6..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunity; -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 IpExtendedCommunitiesListMockTests { - @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\":{\"configurationState\":\"Accepted\",\"provisioningState\":\"Updating\",\"administrativeState\":\"RMA\",\"ipExtendedCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":4789727866315544593,\"routeTargets\":[\"gdkvviilyeshoxf\"]},{\"action\":\"Deny\",\"sequenceNumber\":4281146841382395738,\"routeTargets\":[\"upbusxyugoz\",\"plxzg\"]}],\"annotation\":\"mnotiixk\"},\"location\":\"ygbgi\",\"tags\":{\"httyizo\":\"yshybb\",\"hzzcarciuo\":\"zsurqcojasf\",\"sgnspu\":\"yipdthjfvnh\"},\"id\":\"felfchnuf\",\"name\":\"sjgbfbbach\",\"type\":\"xczzunfnbphcee\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.ipExtendedCommunities().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ygbgi", response.iterator().next().location()); - Assertions.assertEquals("yshybb", response.iterator().next().tags().get("httyizo")); - Assertions - .assertEquals( - CommunityActionTypes.PERMIT, response.iterator().next().ipExtendedCommunityRules().get(0).action()); - Assertions - .assertEquals( - 4789727866315544593L, response.iterator().next().ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals( - "gdkvviilyeshoxf", response.iterator().next().ipExtendedCommunityRules().get(0).routeTargets().get(0)); - Assertions.assertEquals("mnotiixk", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityAddOperationPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityAddOperationPropertiesTests.java deleted file mode 100644 index 8dc35d6f0396..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityAddOperationPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityAddOperationProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunityAddOperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunityAddOperationProperties model = - BinaryData - .fromString("{\"add\":{\"ipExtendedCommunityIds\":[\"iiv\",\"qk\"]}}") - .toObject(IpExtendedCommunityAddOperationProperties.class); - Assertions.assertEquals("iiv", model.add().ipExtendedCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunityAddOperationProperties model = - new IpExtendedCommunityAddOperationProperties() - .withAdd(new IpExtendedCommunityIdList().withIpExtendedCommunityIds(Arrays.asList("iiv", "qk"))); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunityAddOperationProperties.class); - Assertions.assertEquals("iiv", model.add().ipExtendedCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityDeleteOperationPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityDeleteOperationPropertiesTests.java deleted file mode 100644 index 63811e403b96..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityDeleteOperationPropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityDeleteOperationProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunityDeleteOperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunityDeleteOperationProperties model = - BinaryData - .fromString( - "{\"delete\":{\"ipExtendedCommunityIds\":[\"rvewojoqfx\",\"etx\",\"dqiuspguzljvgji\",\"zq\"]}}") - .toObject(IpExtendedCommunityDeleteOperationProperties.class); - Assertions.assertEquals("rvewojoqfx", model.delete().ipExtendedCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunityDeleteOperationProperties model = - new IpExtendedCommunityDeleteOperationProperties() - .withDelete( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("rvewojoqfx", "etx", "dqiuspguzljvgji", "zq"))); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunityDeleteOperationProperties.class); - Assertions.assertEquals("rvewojoqfx", model.delete().ipExtendedCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityIdListTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityIdListTests.java deleted file mode 100644 index 823a4c9fc965..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityIdListTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunityIdListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunityIdList model = - BinaryData - .fromString("{\"ipExtendedCommunityIds\":[\"ssijuaxxfd\",\"ypkcpwsrqnn\",\"ju\"]}") - .toObject(IpExtendedCommunityIdList.class); - Assertions.assertEquals("ssijuaxxfd", model.ipExtendedCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunityIdList model = - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("ssijuaxxfd", "ypkcpwsrqnn", "ju")); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunityIdList.class); - Assertions.assertEquals("ssijuaxxfd", model.ipExtendedCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityInnerTests.java deleted file mode 100644 index 92eb178de737..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityInnerTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpExtendedCommunityInner; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityRule; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunityInner model = - BinaryData - .fromString( - "{\"properties\":{\"configurationState\":\"Rejected\",\"provisioningState\":\"Updating\",\"administrativeState\":\"Enabled\",\"ipExtendedCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":3106144557754641608,\"routeTargets\":[\"llizhce\",\"moqodka\",\"ppyi\"]}],\"annotation\":\"gqladywrxwhyd\"},\"location\":\"uvvadswzsnu\",\"tags\":{\"ouvblgmo\":\"lowuowhlxlnwyr\",\"ih\":\"zkltrfowtdvrfmv\",\"hdxlw\":\"vjdrqcrjidhftuk\"},\"id\":\"ojbf\",\"name\":\"zd\",\"type\":\"fnjyix\"}") - .toObject(IpExtendedCommunityInner.class); - Assertions.assertEquals("uvvadswzsnu", model.location()); - Assertions.assertEquals("lowuowhlxlnwyr", model.tags().get("ouvblgmo")); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(3106144557754641608L, model.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("llizhce", model.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - Assertions.assertEquals("gqladywrxwhyd", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunityInner model = - new IpExtendedCommunityInner() - .withLocation("uvvadswzsnu") - .withTags(mapOf("ouvblgmo", "lowuowhlxlnwyr", "ih", "zkltrfowtdvrfmv", "hdxlw", "vjdrqcrjidhftuk")) - .withIpExtendedCommunityRules( - Arrays - .asList( - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(3106144557754641608L) - .withRouteTargets(Arrays.asList("llizhce", "moqodka", "ppyi")))) - .withAnnotation("gqladywrxwhyd"); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunityInner.class); - Assertions.assertEquals("uvvadswzsnu", model.location()); - Assertions.assertEquals("lowuowhlxlnwyr", model.tags().get("ouvblgmo")); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(3106144557754641608L, model.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("llizhce", model.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - Assertions.assertEquals("gqladywrxwhyd", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityListResultTests.java deleted file mode 100644 index 739b30db990b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityListResultTests.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpExtendedCommunityInner; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityListResult; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityRule; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunityListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunityListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"configurationState\":\"ErrorDeprovisioning\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"Disabled\",\"ipExtendedCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":2785122180998227471,\"routeTargets\":[\"bhtmeplvuk\",\"obrl\",\"pgsn\",\"agnchjhgemuowaky\"]}],\"annotation\":\"lhjym\"},\"location\":\"gqtagd\",\"tags\":{\"vtfycnlbvgjcodk\":\"ssoljom\"},\"id\":\"gjiiytssiki\",\"name\":\"bcufqbvntn\",\"type\":\"gmqsorhcekxg\"},{\"properties\":{\"configurationState\":\"ErrorProvisioning\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Disabled\",\"ipExtendedCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":3699712802375943107,\"routeTargets\":[\"doksqdtiwlwxlbon\"]},{\"action\":\"Permit\",\"sequenceNumber\":9209057098528955798,\"routeTargets\":[\"qicqchygt\",\"xbyja\",\"epubdp\",\"xyqvg\"]},{\"action\":\"Permit\",\"sequenceNumber\":6297136657290435513,\"routeTargets\":[\"etvohkxdxuwsaifm\"]},{\"action\":\"Deny\",\"sequenceNumber\":4631038867223712223,\"routeTargets\":[\"bzlehgc\"]}],\"annotation\":\"bcknjolgj\"},\"location\":\"xpvelszerqzevxo\",\"tags\":{\"qwaafrqulhm\":\"ntxwaljglzob\",\"afjrqpjiyrqjcrg\":\"yqbhd\"},\"id\":\"xwmzwdfkbnrz\",\"name\":\"rpdltbq\",\"type\":\"tqjfgxxsaet\"},{\"properties\":{\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Updating\",\"administrativeState\":\"Enabled\",\"ipExtendedCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":938718071879661634,\"routeTargets\":[\"qilzdc\"]},{\"action\":\"Deny\",\"sequenceNumber\":3957593252486957917,\"routeTargets\":[\"edxn\",\"ucaifpaurwwgilf\",\"qqa\",\"dmkxwxdcvjwcy\"]},{\"action\":\"Permit\",\"sequenceNumber\":638144041261070745,\"routeTargets\":[\"ciqchxrtuicd\",\"iw\"]}],\"annotation\":\"m\"},\"location\":\"zhzzwvywrg\",\"tags\":{\"pxncakiqao\":\"ydg\",\"lmf\":\"djrkclamggl\",\"ykglt\":\"jdoq\",\"tlgflwfgz\":\"gxhqfgqkayejs\"},\"id\":\"iucijjcea\",\"name\":\"lijjjrtvam\",\"type\":\"a\"},{\"properties\":{\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"MAT\",\"ipExtendedCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":6921489313242944838,\"routeTargets\":[\"yvkunmign\",\"hi\",\"kgqogjw\",\"indedvabbx\"]},{\"action\":\"Deny\",\"sequenceNumber\":6106682011514466217,\"routeTargets\":[\"eilbjywfcf\"]},{\"action\":\"Permit\",\"sequenceNumber\":2338776550669139701,\"routeTargets\":[\"zi\",\"vwypusuvjsl\"]}],\"annotation\":\"wci\"},\"location\":\"jsllfryvd\",\"tags\":{\"gfbktyjmf\":\"adqacfrgnawba\"},\"id\":\"zlfsyqkfrbzgowo\",\"name\":\"qmje\",\"type\":\"jcx\"}],\"nextLink\":\"qg\"}") - .toObject(IpExtendedCommunityListResult.class); - Assertions.assertEquals("gqtagd", model.value().get(0).location()); - Assertions.assertEquals("ssoljom", model.value().get(0).tags().get("vtfycnlbvgjcodk")); - Assertions - .assertEquals(CommunityActionTypes.DENY, model.value().get(0).ipExtendedCommunityRules().get(0).action()); - Assertions - .assertEquals( - 2785122180998227471L, model.value().get(0).ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals("bhtmeplvuk", model.value().get(0).ipExtendedCommunityRules().get(0).routeTargets().get(0)); - Assertions.assertEquals("lhjym", model.value().get(0).annotation()); - Assertions.assertEquals("qg", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunityListResult model = - new IpExtendedCommunityListResult() - .withValue( - Arrays - .asList( - new IpExtendedCommunityInner() - .withLocation("gqtagd") - .withTags(mapOf("vtfycnlbvgjcodk", "ssoljom")) - .withIpExtendedCommunityRules( - Arrays - .asList( - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(2785122180998227471L) - .withRouteTargets( - Arrays.asList("bhtmeplvuk", "obrl", "pgsn", "agnchjhgemuowaky")))) - .withAnnotation("lhjym"), - new IpExtendedCommunityInner() - .withLocation("xpvelszerqzevxo") - .withTags(mapOf("qwaafrqulhm", "ntxwaljglzob", "afjrqpjiyrqjcrg", "yqbhd")) - .withIpExtendedCommunityRules( - Arrays - .asList( - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(3699712802375943107L) - .withRouteTargets(Arrays.asList("doksqdtiwlwxlbon")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(9209057098528955798L) - .withRouteTargets( - Arrays.asList("qicqchygt", "xbyja", "epubdp", "xyqvg")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(6297136657290435513L) - .withRouteTargets(Arrays.asList("etvohkxdxuwsaifm")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(4631038867223712223L) - .withRouteTargets(Arrays.asList("bzlehgc")))) - .withAnnotation("bcknjolgj"), - new IpExtendedCommunityInner() - .withLocation("zhzzwvywrg") - .withTags( - mapOf( - "pxncakiqao", - "ydg", - "lmf", - "djrkclamggl", - "ykglt", - "jdoq", - "tlgflwfgz", - "gxhqfgqkayejs")) - .withIpExtendedCommunityRules( - Arrays - .asList( - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(938718071879661634L) - .withRouteTargets(Arrays.asList("qilzdc")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(3957593252486957917L) - .withRouteTargets( - Arrays.asList("edxn", "ucaifpaurwwgilf", "qqa", "dmkxwxdcvjwcy")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(638144041261070745L) - .withRouteTargets(Arrays.asList("ciqchxrtuicd", "iw")))) - .withAnnotation("m"), - new IpExtendedCommunityInner() - .withLocation("jsllfryvd") - .withTags(mapOf("gfbktyjmf", "adqacfrgnawba")) - .withIpExtendedCommunityRules( - Arrays - .asList( - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(6921489313242944838L) - .withRouteTargets( - Arrays.asList("yvkunmign", "hi", "kgqogjw", "indedvabbx")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(6106682011514466217L) - .withRouteTargets(Arrays.asList("eilbjywfcf")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(2338776550669139701L) - .withRouteTargets(Arrays.asList("zi", "vwypusuvjsl")))) - .withAnnotation("wci"))) - .withNextLink("qg"); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunityListResult.class); - Assertions.assertEquals("gqtagd", model.value().get(0).location()); - Assertions.assertEquals("ssoljom", model.value().get(0).tags().get("vtfycnlbvgjcodk")); - Assertions - .assertEquals(CommunityActionTypes.DENY, model.value().get(0).ipExtendedCommunityRules().get(0).action()); - Assertions - .assertEquals( - 2785122180998227471L, model.value().get(0).ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions - .assertEquals("bhtmeplvuk", model.value().get(0).ipExtendedCommunityRules().get(0).routeTargets().get(0)); - Assertions.assertEquals("lhjym", model.value().get(0).annotation()); - Assertions.assertEquals("qg", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPatchPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPatchPropertiesTests.java deleted file mode 100644 index 5c4a2747a590..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPatchPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpExtendedCommunityPatchProperties; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunityPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunityPatchProperties model = - BinaryData - .fromString( - "{\"annotation\":\"njevhdlmydidw\",\"ipExtendedCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":1554871438908340167,\"routeTargets\":[\"tjfdoesxxhmw\"]},{\"action\":\"Permit\",\"sequenceNumber\":338603123120374807,\"routeTargets\":[\"yo\"]}]}") - .toObject(IpExtendedCommunityPatchProperties.class); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(1554871438908340167L, model.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("tjfdoesxxhmw", model.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - Assertions.assertEquals("njevhdlmydidw", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunityPatchProperties model = - new IpExtendedCommunityPatchProperties() - .withIpExtendedCommunityRules( - Arrays - .asList( - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(1554871438908340167L) - .withRouteTargets(Arrays.asList("tjfdoesxxhmw")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(338603123120374807L) - .withRouteTargets(Arrays.asList("yo")))) - .withAnnotation("njevhdlmydidw"); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunityPatchProperties.class); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(1554871438908340167L, model.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("tjfdoesxxhmw", model.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - Assertions.assertEquals("njevhdlmydidw", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPatchTests.java deleted file mode 100644 index 6b0a636772bc..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPatchTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityPatch; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityRule; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunityPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunityPatch model = - BinaryData - .fromString( - "{\"properties\":{\"annotation\":\"kiofkbt\",\"ipExtendedCommunityRules\":[{\"action\":\"Deny\",\"sequenceNumber\":1656288056476844717,\"routeTargets\":[\"nldpvcbhhezyquwu\",\"qxutrpbrruyuua\",\"vlm\"]},{\"action\":\"Permit\",\"sequenceNumber\":9171918442354377344,\"routeTargets\":[\"lbmxlbnwtpcpah\"]}]},\"tags\":{\"hngxnoqrxtd\":\"rvxhmtfhocnxzcm\"}}") - .toObject(IpExtendedCommunityPatch.class); - Assertions.assertEquals("rvxhmtfhocnxzcm", model.tags().get("hngxnoqrxtd")); - Assertions.assertEquals("kiofkbt", model.annotation()); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(1656288056476844717L, model.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("nldpvcbhhezyquwu", model.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunityPatch model = - new IpExtendedCommunityPatch() - .withTags(mapOf("hngxnoqrxtd", "rvxhmtfhocnxzcm")) - .withAnnotation("kiofkbt") - .withIpExtendedCommunityRules( - Arrays - .asList( - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(1656288056476844717L) - .withRouteTargets(Arrays.asList("nldpvcbhhezyquwu", "qxutrpbrruyuua", "vlm")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(9171918442354377344L) - .withRouteTargets(Arrays.asList("lbmxlbnwtpcpah")))); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunityPatch.class); - Assertions.assertEquals("rvxhmtfhocnxzcm", model.tags().get("hngxnoqrxtd")); - Assertions.assertEquals("kiofkbt", model.annotation()); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(1656288056476844717L, model.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("nldpvcbhhezyquwu", model.ipExtendedCommunityRules().get(0).routeTargets().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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPatchablePropertiesTests.java deleted file mode 100644 index fdc0a984163c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPatchablePropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunityPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunityPatchableProperties model = - BinaryData - .fromString( - "{\"ipExtendedCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":7966062914032266112,\"routeTargets\":[\"wsocnequygdjbo\",\"grmtqjk\",\"evadrmmwiu\",\"wvcmj\"]},{\"action\":\"Deny\",\"sequenceNumber\":3681628322400604286,\"routeTargets\":[\"disczskos\",\"oqiqazugamx\",\"krrcoiisbamnpp\"]},{\"action\":\"Permit\",\"sequenceNumber\":331720497172605252,\"routeTargets\":[\"ztdsbeza\"]},{\"action\":\"Deny\",\"sequenceNumber\":613655016592782503,\"routeTargets\":[\"zxuizhyhnepkpe\",\"iarxqiubxdukec\"]}]}") - .toObject(IpExtendedCommunityPatchableProperties.class); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(7966062914032266112L, model.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("wsocnequygdjbo", model.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunityPatchableProperties model = - new IpExtendedCommunityPatchableProperties() - .withIpExtendedCommunityRules( - Arrays - .asList( - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(7966062914032266112L) - .withRouteTargets(Arrays.asList("wsocnequygdjbo", "grmtqjk", "evadrmmwiu", "wvcmj")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(3681628322400604286L) - .withRouteTargets(Arrays.asList("disczskos", "oqiqazugamx", "krrcoiisbamnpp")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(331720497172605252L) - .withRouteTargets(Arrays.asList("ztdsbeza")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(613655016592782503L) - .withRouteTargets(Arrays.asList("zxuizhyhnepkpe", "iarxqiubxdukec")))); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunityPatchableProperties.class); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(7966062914032266112L, model.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("wsocnequygdjbo", model.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPropertiesTests.java deleted file mode 100644 index 99d52d585dd9..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpExtendedCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunityProperties model = - BinaryData - .fromString( - "{\"configurationState\":\"Deprovisioning\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"MAT\",\"ipExtendedCommunityRules\":[{\"action\":\"Permit\",\"sequenceNumber\":71110697464047174,\"routeTargets\":[\"oum\",\"znv\",\"l\"]},{\"action\":\"Permit\",\"sequenceNumber\":5729494135721513095,\"routeTargets\":[\"zgfxonjtpusl\",\"ywpvt\",\"otz\",\"pdbollg\"]}],\"annotation\":\"fqiu\"}") - .toObject(IpExtendedCommunityProperties.class); - Assertions.assertEquals("fqiu", model.annotation()); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(71110697464047174L, model.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("oum", model.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunityProperties model = - new IpExtendedCommunityProperties() - .withAnnotation("fqiu") - .withIpExtendedCommunityRules( - Arrays - .asList( - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(71110697464047174L) - .withRouteTargets(Arrays.asList("oum", "znv", "l")), - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(5729494135721513095L) - .withRouteTargets(Arrays.asList("zgfxonjtpusl", "ywpvt", "otz", "pdbollg")))); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunityProperties.class); - Assertions.assertEquals("fqiu", model.annotation()); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipExtendedCommunityRules().get(0).action()); - Assertions.assertEquals(71110697464047174L, model.ipExtendedCommunityRules().get(0).sequenceNumber()); - Assertions.assertEquals("oum", model.ipExtendedCommunityRules().get(0).routeTargets().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityRuleTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityRuleTests.java deleted file mode 100644 index 5d17e4cad46c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunityRuleTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunityRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunityRule model = - BinaryData - .fromString( - "{\"action\":\"Permit\",\"sequenceNumber\":411122355974604115,\"routeTargets\":[\"v\",\"hctmmkosz\",\"dblnsntrp\"]}") - .toObject(IpExtendedCommunityRule.class); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.action()); - Assertions.assertEquals(411122355974604115L, model.sequenceNumber()); - Assertions.assertEquals("v", model.routeTargets().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunityRule model = - new IpExtendedCommunityRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(411122355974604115L) - .withRouteTargets(Arrays.asList("v", "hctmmkosz", "dblnsntrp")); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunityRule.class); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.action()); - Assertions.assertEquals(411122355974604115L, model.sequenceNumber()); - Assertions.assertEquals("v", model.routeTargets().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitySetOperationPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitySetOperationPropertiesTests.java deleted file mode 100644 index e3b1f9222047..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitySetOperationPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunitySetOperationProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpExtendedCommunitySetOperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpExtendedCommunitySetOperationProperties model = - BinaryData - .fromString("{\"set\":{\"ipExtendedCommunityIds\":[\"sazm\",\"sisfqqhcmec\",\"gsbfeiirpnjy\"]}}") - .toObject(IpExtendedCommunitySetOperationProperties.class); - Assertions.assertEquals("sazm", model.set().ipExtendedCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpExtendedCommunitySetOperationProperties model = - new IpExtendedCommunitySetOperationProperties() - .withSet( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("sazm", "sisfqqhcmec", "gsbfeiirpnjy"))); - model = BinaryData.fromObject(model).toObject(IpExtendedCommunitySetOperationProperties.class); - Assertions.assertEquals("sazm", model.set().ipExtendedCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpGroupPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpGroupPropertiesTests.java deleted file mode 100644 index 24b7e86c4b2f..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpGroupPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpGroupProperties model = - BinaryData - .fromString("{\"name\":\"ihclafzv\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"rsqqwztcm\",\"qkc\"]}") - .toObject(IpGroupProperties.class); - Assertions.assertEquals("ihclafzv", model.name()); - Assertions.assertEquals(IpAddressType.IPV4, model.ipAddressType()); - Assertions.assertEquals("rsqqwztcm", model.ipPrefixes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpGroupProperties model = - new IpGroupProperties() - .withName("ihclafzv") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("rsqqwztcm", "qkc")); - model = BinaryData.fromObject(model).toObject(IpGroupProperties.class); - Assertions.assertEquals("ihclafzv", model.name()); - Assertions.assertEquals(IpAddressType.IPV4, model.ipAddressType()); - Assertions.assertEquals("rsqqwztcm", model.ipPrefixes().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpMatchConditionTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpMatchConditionTests.java deleted file mode 100644 index 4abf0f30e260..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpMatchConditionTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpMatchConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpMatchCondition model = - BinaryData - .fromString( - "{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"hcvsqltnzoi\"],\"ipGroupNames\":[\"xgnxfyqonmpqoxwd\",\"fdbxiqxeiiqbim\"]}") - .toObject(IpMatchCondition.class); - Assertions.assertEquals(SourceDestinationType.SOURCE_IP, model.type()); - Assertions.assertEquals(PrefixType.PREFIX, model.prefixType()); - Assertions.assertEquals("hcvsqltnzoi", model.ipPrefixValues().get(0)); - Assertions.assertEquals("xgnxfyqonmpqoxwd", model.ipGroupNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpMatchCondition model = - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("hcvsqltnzoi")) - .withIpGroupNames(Arrays.asList("xgnxfyqonmpqoxwd", "fdbxiqxeiiqbim")); - model = BinaryData.fromObject(model).toObject(IpMatchCondition.class); - Assertions.assertEquals(SourceDestinationType.SOURCE_IP, model.type()); - Assertions.assertEquals(PrefixType.PREFIX, model.prefixType()); - Assertions.assertEquals("hcvsqltnzoi", model.ipPrefixValues().get(0)); - Assertions.assertEquals("xgnxfyqonmpqoxwd", model.ipGroupNames().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixInnerTests.java deleted file mode 100644 index 6d73c571b3fb..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixInnerTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixInner; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixRule; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IpPrefixInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpPrefixInner model = - BinaryData - .fromString( - "{\"properties\":{\"configurationState\":\"ErrorProvisioning\",\"provisioningState\":\"Updating\",\"administrativeState\":\"MAT\",\"ipPrefixRules\":[{\"action\":\"Deny\",\"sequenceNumber\":583976656188902941,\"networkPrefix\":\"jceagb\",\"condition\":\"EqualTo\",\"subnetMaskLength\":\"sumywzashxgonoyj\"}],\"annotation\":\"ipubyznclkfk\"},\"location\":\"bgvopemt\",\"tags\":{\"vn\":\"ujlyegq\",\"lxdbfvabmvms\":\"gflqqbtnyjp\",\"uhvajmailfemjjza\":\"baevwjcnkottl\"},\"id\":\"zwjiqullq\",\"name\":\"bdmvrscmqerndbr\",\"type\":\"yeofltfnnxrkad\"}") - .toObject(IpPrefixInner.class); - Assertions.assertEquals("bgvopemt", model.location()); - Assertions.assertEquals("ujlyegq", model.tags().get("vn")); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipPrefixRules().get(0).action()); - Assertions.assertEquals(583976656188902941L, model.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("jceagb", model.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.EQUAL_TO, model.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("sumywzashxgonoyj", model.ipPrefixRules().get(0).subnetMaskLength()); - Assertions.assertEquals("ipubyznclkfk", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpPrefixInner model = - new IpPrefixInner() - .withLocation("bgvopemt") - .withTags(mapOf("vn", "ujlyegq", "lxdbfvabmvms", "gflqqbtnyjp", "uhvajmailfemjjza", "baevwjcnkottl")) - .withIpPrefixRules( - Arrays - .asList( - new IpPrefixRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(583976656188902941L) - .withNetworkPrefix("jceagb") - .withCondition(Condition.EQUAL_TO) - .withSubnetMaskLength("sumywzashxgonoyj"))) - .withAnnotation("ipubyznclkfk"); - model = BinaryData.fromObject(model).toObject(IpPrefixInner.class); - Assertions.assertEquals("bgvopemt", model.location()); - Assertions.assertEquals("ujlyegq", model.tags().get("vn")); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipPrefixRules().get(0).action()); - Assertions.assertEquals(583976656188902941L, model.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("jceagb", model.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.EQUAL_TO, model.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("sumywzashxgonoyj", model.ipPrefixRules().get(0).subnetMaskLength()); - Assertions.assertEquals("ipubyznclkfk", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPatchPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPatchPropertiesTests.java deleted file mode 100644 index 32ae790d718f..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPatchPropertiesTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixPatchProperties; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpPrefixPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpPrefixPatchProperties model = - BinaryData - .fromString( - "{\"ipPrefixRules\":[{\"action\":\"Permit\",\"sequenceNumber\":7178657558999191056,\"networkPrefix\":\"sbede\",\"condition\":\"GreaterThanOrEqualTo\",\"subnetMaskLength\":\"k\"}],\"annotation\":\"hxvucnu\"}") - .toObject(IpPrefixPatchProperties.class); - Assertions.assertEquals("hxvucnu", model.annotation()); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipPrefixRules().get(0).action()); - Assertions.assertEquals(7178657558999191056L, model.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("sbede", model.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.GREATER_THAN_OR_EQUAL_TO, model.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("k", model.ipPrefixRules().get(0).subnetMaskLength()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpPrefixPatchProperties model = - new IpPrefixPatchProperties() - .withAnnotation("hxvucnu") - .withIpPrefixRules( - Arrays - .asList( - new IpPrefixRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(7178657558999191056L) - .withNetworkPrefix("sbede") - .withCondition(Condition.GREATER_THAN_OR_EQUAL_TO) - .withSubnetMaskLength("k"))); - model = BinaryData.fromObject(model).toObject(IpPrefixPatchProperties.class); - Assertions.assertEquals("hxvucnu", model.annotation()); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipPrefixRules().get(0).action()); - Assertions.assertEquals(7178657558999191056L, model.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("sbede", model.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.GREATER_THAN_OR_EQUAL_TO, model.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("k", model.ipPrefixRules().get(0).subnetMaskLength()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPatchTests.java deleted file mode 100644 index f4498bb13eaf..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPatchTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixPatch; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixRule; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IpPrefixPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpPrefixPatch model = - BinaryData - .fromString( - "{\"properties\":{\"ipPrefixRules\":[{\"action\":\"Deny\",\"sequenceNumber\":6160965554069396867,\"networkPrefix\":\"meikj\",\"condition\":\"GreaterThanOrEqualTo\",\"subnetMaskLength\":\"acnmwpfsuqtaaz\"},{\"action\":\"Deny\",\"sequenceNumber\":6514356220844610771,\"networkPrefix\":\"yxoyfp\",\"condition\":\"EqualTo\",\"subnetMaskLength\":\"qezxlhdj\"}],\"annotation\":\"dcadwvpsozjiihjr\"},\"tags\":{\"xwdvwnj\":\"mrzoep\",\"nmx\":\"gv\",\"ibtyibuyvpirfqjp\":\"ursqf\"}}") - .toObject(IpPrefixPatch.class); - Assertions.assertEquals("mrzoep", model.tags().get("xwdvwnj")); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipPrefixRules().get(0).action()); - Assertions.assertEquals(6160965554069396867L, model.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("meikj", model.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.GREATER_THAN_OR_EQUAL_TO, model.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("acnmwpfsuqtaaz", model.ipPrefixRules().get(0).subnetMaskLength()); - Assertions.assertEquals("dcadwvpsozjiihjr", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpPrefixPatch model = - new IpPrefixPatch() - .withTags(mapOf("xwdvwnj", "mrzoep", "nmx", "gv", "ibtyibuyvpirfqjp", "ursqf")) - .withIpPrefixRules( - Arrays - .asList( - new IpPrefixRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(6160965554069396867L) - .withNetworkPrefix("meikj") - .withCondition(Condition.GREATER_THAN_OR_EQUAL_TO) - .withSubnetMaskLength("acnmwpfsuqtaaz"), - new IpPrefixRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(6514356220844610771L) - .withNetworkPrefix("yxoyfp") - .withCondition(Condition.EQUAL_TO) - .withSubnetMaskLength("qezxlhdj"))) - .withAnnotation("dcadwvpsozjiihjr"); - model = BinaryData.fromObject(model).toObject(IpPrefixPatch.class); - Assertions.assertEquals("mrzoep", model.tags().get("xwdvwnj")); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipPrefixRules().get(0).action()); - Assertions.assertEquals(6160965554069396867L, model.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("meikj", model.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.GREATER_THAN_OR_EQUAL_TO, model.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("acnmwpfsuqtaaz", model.ipPrefixRules().get(0).subnetMaskLength()); - Assertions.assertEquals("dcadwvpsozjiihjr", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPatchablePropertiesTests.java deleted file mode 100644 index 481f121fb9fd..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPatchablePropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpPrefixPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpPrefixPatchableProperties model = - BinaryData - .fromString( - "{\"ipPrefixRules\":[{\"action\":\"Permit\",\"sequenceNumber\":7278434712251922443,\"networkPrefix\":\"uyrsrziuctix\",\"condition\":\"EqualTo\",\"subnetMaskLength\":\"uifr\"},{\"action\":\"Permit\",\"sequenceNumber\":7782918375893447021,\"networkPrefix\":\"apezkiswqjmdghs\",\"condition\":\"LesserThanOrEqualTo\",\"subnetMaskLength\":\"ybjufptb\"},{\"action\":\"Permit\",\"sequenceNumber\":906815829871548771,\"networkPrefix\":\"nciuiyqvldaswvpp\",\"condition\":\"LesserThanOrEqualTo\",\"subnetMaskLength\":\"zlgcndhzxrrf\"}]}") - .toObject(IpPrefixPatchableProperties.class); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipPrefixRules().get(0).action()); - Assertions.assertEquals(7278434712251922443L, model.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("uyrsrziuctix", model.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.EQUAL_TO, model.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("uifr", model.ipPrefixRules().get(0).subnetMaskLength()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpPrefixPatchableProperties model = - new IpPrefixPatchableProperties() - .withIpPrefixRules( - Arrays - .asList( - new IpPrefixRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(7278434712251922443L) - .withNetworkPrefix("uyrsrziuctix") - .withCondition(Condition.EQUAL_TO) - .withSubnetMaskLength("uifr"), - new IpPrefixRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(7782918375893447021L) - .withNetworkPrefix("apezkiswqjmdghs") - .withCondition(Condition.LESSER_THAN_OR_EQUAL_TO) - .withSubnetMaskLength("ybjufptb"), - new IpPrefixRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(906815829871548771L) - .withNetworkPrefix("nciuiyqvldaswvpp") - .withCondition(Condition.LESSER_THAN_OR_EQUAL_TO) - .withSubnetMaskLength("zlgcndhzxrrf"))); - model = BinaryData.fromObject(model).toObject(IpPrefixPatchableProperties.class); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.ipPrefixRules().get(0).action()); - Assertions.assertEquals(7278434712251922443L, model.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("uyrsrziuctix", model.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.EQUAL_TO, model.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("uifr", model.ipPrefixRules().get(0).subnetMaskLength()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPropertiesTests.java deleted file mode 100644 index 28935d957571..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixPropertiesTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixProperties; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IpPrefixPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpPrefixProperties model = - BinaryData - .fromString( - "{\"configurationState\":\"Failed\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"Enabled\",\"ipPrefixRules\":[{\"action\":\"Deny\",\"sequenceNumber\":1091451108549371592,\"networkPrefix\":\"ipfohykfkx\",\"condition\":\"Range\",\"subnetMaskLength\":\"r\"}],\"annotation\":\"iutgnjizbeewoiy\"}") - .toObject(IpPrefixProperties.class); - Assertions.assertEquals("iutgnjizbeewoiy", model.annotation()); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipPrefixRules().get(0).action()); - Assertions.assertEquals(1091451108549371592L, model.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("ipfohykfkx", model.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.RANGE, model.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("r", model.ipPrefixRules().get(0).subnetMaskLength()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpPrefixProperties model = - new IpPrefixProperties() - .withAnnotation("iutgnjizbeewoiy") - .withIpPrefixRules( - Arrays - .asList( - new IpPrefixRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(1091451108549371592L) - .withNetworkPrefix("ipfohykfkx") - .withCondition(Condition.RANGE) - .withSubnetMaskLength("r"))); - model = BinaryData.fromObject(model).toObject(IpPrefixProperties.class); - Assertions.assertEquals("iutgnjizbeewoiy", model.annotation()); - Assertions.assertEquals(CommunityActionTypes.DENY, model.ipPrefixRules().get(0).action()); - Assertions.assertEquals(1091451108549371592L, model.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("ipfohykfkx", model.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.RANGE, model.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("r", model.ipPrefixRules().get(0).subnetMaskLength()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixRuleTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixRuleTests.java deleted file mode 100644 index d7fb472531ca..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixRuleTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixRule; -import org.junit.jupiter.api.Assertions; - -public final class IpPrefixRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpPrefixRule model = - BinaryData - .fromString( - "{\"action\":\"Deny\",\"sequenceNumber\":9177404831605341592,\"networkPrefix\":\"hkhg\",\"condition\":\"GreaterThanOrEqualTo\",\"subnetMaskLength\":\"wwkpphefsb\"}") - .toObject(IpPrefixRule.class); - Assertions.assertEquals(CommunityActionTypes.DENY, model.action()); - Assertions.assertEquals(9177404831605341592L, model.sequenceNumber()); - Assertions.assertEquals("hkhg", model.networkPrefix()); - Assertions.assertEquals(Condition.GREATER_THAN_OR_EQUAL_TO, model.condition()); - Assertions.assertEquals("wwkpphefsb", model.subnetMaskLength()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpPrefixRule model = - new IpPrefixRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(9177404831605341592L) - .withNetworkPrefix("hkhg") - .withCondition(Condition.GREATER_THAN_OR_EQUAL_TO) - .withSubnetMaskLength("wwkpphefsb"); - model = BinaryData.fromObject(model).toObject(IpPrefixRule.class); - Assertions.assertEquals(CommunityActionTypes.DENY, model.action()); - Assertions.assertEquals(9177404831605341592L, model.sequenceNumber()); - Assertions.assertEquals("hkhg", model.networkPrefix()); - Assertions.assertEquals(Condition.GREATER_THAN_OR_EQUAL_TO, model.condition()); - Assertions.assertEquals("wwkpphefsb", model.subnetMaskLength()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesCreateMockTests.java deleted file mode 100644 index e5f067e4eeb5..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesCreateMockTests.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefix; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixRule; -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 IpPrefixesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"configurationState\":\"Provisioned\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"MAT\",\"ipPrefixRules\":[{\"action\":\"Permit\",\"sequenceNumber\":4449803466898573862,\"networkPrefix\":\"qgqs\",\"condition\":\"Range\",\"subnetMaskLength\":\"efeombo\"},{\"action\":\"Permit\",\"sequenceNumber\":6001894924580740479,\"networkPrefix\":\"fuakqsjymcfvvzc\",\"condition\":\"EqualTo\",\"subnetMaskLength\":\"qktcktnbpk\"},{\"action\":\"Permit\",\"sequenceNumber\":1226746474122202062,\"networkPrefix\":\"lncmlzvvrm\",\"condition\":\"GreaterThanOrEqualTo\",\"subnetMaskLength\":\"qsacjqz\"},{\"action\":\"Permit\",\"sequenceNumber\":3498512871956945291,\"networkPrefix\":\"wcbawapndmtq\",\"condition\":\"EqualTo\",\"subnetMaskLength\":\"zvagqxfblsx\"}],\"annotation\":\"qgtodgklle\"},\"location\":\"i\",\"tags\":{\"b\":\"sr\",\"gqbmxbpqcnxske\":\"nasgfyxhsx\",\"lfpiuuf\":\"ojvmazu\",\"givbhmn\":\"pdncokq\"},\"id\":\"mjlyhbjf\",\"name\":\"m\",\"type\":\"ibgwcduy\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IpPrefix response = - manager - .ipPrefixes() - .define("gdmfvybfmpot") - .withRegion("vtkmx") - .withExistingResourceGroup("mazkmqfw") - .withTags(mapOf("v", "shnugfbpeigkf", "gtdjhtbarptxurs", "vriqtuzwbkqcgz", "oc", "oyyumhzps")) - .withIpPrefixRules( - Arrays - .asList( - new IpPrefixRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(8899164326683510311L) - .withNetworkPrefix("codbqeo") - .withCondition(Condition.RANGE) - .withSubnetMaskLength("xxbjhsp"), - new IpPrefixRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(2386191404567686629L) - .withNetworkPrefix("xrwqlwdflgqrplz") - .withCondition(Condition.RANGE) - .withSubnetMaskLength("dbboffgxtaelx"))) - .withAnnotation("fcyatbxdwr") - .create(); - - Assertions.assertEquals("i", response.location()); - Assertions.assertEquals("sr", response.tags().get("b")); - Assertions.assertEquals(CommunityActionTypes.PERMIT, response.ipPrefixRules().get(0).action()); - Assertions.assertEquals(4449803466898573862L, response.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("qgqs", response.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.RANGE, response.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("efeombo", response.ipPrefixRules().get(0).subnetMaskLength()); - Assertions.assertEquals("qgtodgklle", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index af079f8ef291..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefix; -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 IpPrefixesGetByResourceGroupWithResponseMockTests { - @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\":{\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"MAT\",\"ipPrefixRules\":[{\"action\":\"Deny\",\"sequenceNumber\":8817700520598631993,\"networkPrefix\":\"pgmncrvtp\",\"condition\":\"Range\",\"subnetMaskLength\":\"omppz\"},{\"action\":\"Permit\",\"sequenceNumber\":2044196694941419396,\"networkPrefix\":\"meuhplfcmpuaiu\",\"condition\":\"GreaterThanOrEqualTo\",\"subnetMaskLength\":\"q\"},{\"action\":\"Permit\",\"sequenceNumber\":173221501836853357,\"networkPrefix\":\"p\",\"condition\":\"EqualTo\",\"subnetMaskLength\":\"iccu\"},{\"action\":\"Deny\",\"sequenceNumber\":7374618817808870053,\"networkPrefix\":\"unlakgixhqj\",\"condition\":\"Range\",\"subnetMaskLength\":\"wb\"}],\"annotation\":\"iwtwfgoc\"},\"location\":\"lvemnnzugabk\",\"tags\":{\"bftswcd\":\"syweohlmtsnvon\",\"lgzwkopxdkb\":\"pnseptvdticca\"},\"id\":\"woqhgppwxn\",\"name\":\"kfzrxxf\",\"type\":\"duvqzjnnuww\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IpPrefix response = - manager - .ipPrefixes() - .getByResourceGroupWithResponse("xoyxuuco", "usyrux", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("lvemnnzugabk", response.location()); - Assertions.assertEquals("syweohlmtsnvon", response.tags().get("bftswcd")); - Assertions.assertEquals(CommunityActionTypes.DENY, response.ipPrefixRules().get(0).action()); - Assertions.assertEquals(8817700520598631993L, response.ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("pgmncrvtp", response.ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.RANGE, response.ipPrefixRules().get(0).condition()); - Assertions.assertEquals("omppz", response.ipPrefixRules().get(0).subnetMaskLength()); - Assertions.assertEquals("iwtwfgoc", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListByResourceGroupMockTests.java deleted file mode 100644 index 5938567ae16b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefix; -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 IpPrefixesListByResourceGroupMockTests { - @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\":{\"configurationState\":\"Failed\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"MAT\",\"ipPrefixRules\":[{\"action\":\"Permit\",\"sequenceNumber\":5376347157026383231,\"networkPrefix\":\"urxrjwyz\",\"condition\":\"GreaterThanOrEqualTo\",\"subnetMaskLength\":\"tqmlzuwtbdzqa\"}],\"annotation\":\"kmpebfhlgeehb\"},\"location\":\"gplnl\",\"tags\":{\"afm\":\"eszunb\",\"vequzytapgzdhz\":\"ubukqmierzrnob\",\"v\":\"jecdsysxnku\"},\"id\":\"nlsevzcrrwnkk\",\"name\":\"dwqymxsfqe\",\"type\":\"xdqeluvmsaq\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.ipPrefixes().listByResourceGroup("jzrfx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gplnl", response.iterator().next().location()); - Assertions.assertEquals("eszunb", response.iterator().next().tags().get("afm")); - Assertions - .assertEquals(CommunityActionTypes.PERMIT, response.iterator().next().ipPrefixRules().get(0).action()); - Assertions - .assertEquals(5376347157026383231L, response.iterator().next().ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("urxrjwyz", response.iterator().next().ipPrefixRules().get(0).networkPrefix()); - Assertions - .assertEquals( - Condition.GREATER_THAN_OR_EQUAL_TO, response.iterator().next().ipPrefixRules().get(0).condition()); - Assertions.assertEquals("tqmlzuwtbdzqa", response.iterator().next().ipPrefixRules().get(0).subnetMaskLength()); - Assertions.assertEquals("kmpebfhlgeehb", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListMockTests.java deleted file mode 100644 index 8d159d8cf465..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefix; -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 IpPrefixesListMockTests { - @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\":{\"configurationState\":\"ErrorProvisioning\",\"provisioningState\":\"Updating\",\"administrativeState\":\"Enabled\",\"ipPrefixRules\":[{\"action\":\"Permit\",\"sequenceNumber\":4323285940907635783,\"networkPrefix\":\"vzfznfgpb\",\"condition\":\"Range\",\"subnetMaskLength\":\"pympdjieask\"}],\"annotation\":\"qclnfusrgnoskkhb\"},\"location\":\"phlyyuahvyeikb\",\"tags\":{\"jnohafwm\":\"rurgbqaucpck\",\"xtugpeamet\":\"pgjl\",\"m\":\"dwxf\"},\"id\":\"xccfegsav\",\"name\":\"ghoucvka\",\"type\":\"dhoo\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.ipPrefixes().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("phlyyuahvyeikb", response.iterator().next().location()); - Assertions.assertEquals("rurgbqaucpck", response.iterator().next().tags().get("jnohafwm")); - Assertions - .assertEquals(CommunityActionTypes.PERMIT, response.iterator().next().ipPrefixRules().get(0).action()); - Assertions - .assertEquals(4323285940907635783L, response.iterator().next().ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("vzfznfgpb", response.iterator().next().ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.RANGE, response.iterator().next().ipPrefixRules().get(0).condition()); - Assertions.assertEquals("pympdjieask", response.iterator().next().ipPrefixRules().get(0).subnetMaskLength()); - Assertions.assertEquals("qclnfusrgnoskkhb", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListResultTests.java deleted file mode 100644 index 3e98d6589792..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListResultTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixInner; -import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; -import com.azure.resourcemanager.managednetworkfabric.models.Condition; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixRule; -import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixesListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IpPrefixesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpPrefixesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"MAT\",\"ipPrefixRules\":[{\"action\":\"Permit\",\"sequenceNumber\":4132053011483254842,\"networkPrefix\":\"jsvkskmqozzkivy\",\"condition\":\"EqualTo\",\"subnetMaskLength\":\"iizjixlqfhefkwa\"},{\"action\":\"Deny\",\"sequenceNumber\":3579630685360942512,\"networkPrefix\":\"ron\",\"condition\":\"LesserThanOrEqualTo\",\"subnetMaskLength\":\"gn\"}],\"annotation\":\"xsjxtelexhvuqboz\"},\"location\":\"lzqocark\",\"tags\":{\"ndtsnxawqytll\":\"bc\",\"yckzex\":\"dyz\"},\"id\":\"xak\",\"name\":\"kywymxgaabj\",\"type\":\"dtfohfaog\"},{\"properties\":{\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"MAT\",\"ipPrefixRules\":[{\"action\":\"Permit\",\"sequenceNumber\":118162518124769892,\"networkPrefix\":\"quryk\",\"condition\":\"LesserThanOrEqualTo\",\"subnetMaskLength\":\"ueekcsue\"},{\"action\":\"Permit\",\"sequenceNumber\":4151407068847251052,\"networkPrefix\":\"dac\",\"condition\":\"LesserThanOrEqualTo\",\"subnetMaskLength\":\"ydl\"},{\"action\":\"Deny\",\"sequenceNumber\":130832318700138063,\"networkPrefix\":\"wmhmptyrilkfbnr\",\"condition\":\"Range\",\"subnetMaskLength\":\"ztpb\"},{\"action\":\"Permit\",\"sequenceNumber\":7773880630728112607,\"networkPrefix\":\"txjt\",\"condition\":\"GreaterThanOrEqualTo\",\"subnetMaskLength\":\"swbnfddepldwqjns\"}],\"annotation\":\"ygleexa\"},\"location\":\"mywhsb\",\"tags\":{\"jjzyvoaqajuve\":\"ryc\",\"pfulube\":\"zptdmkrrbh\",\"ununm\":\"gybpmfb\",\"kdschlzvfictnkjj\":\"zkrvfyi\"},\"id\":\"gcwn\",\"name\":\"hbkgfyrt\",\"type\":\"gm\"},{\"properties\":{\"configurationState\":\"Succeeded\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"Enabled\",\"ipPrefixRules\":[{\"action\":\"Deny\",\"sequenceNumber\":5070835468402893482,\"networkPrefix\":\"wtyg\",\"condition\":\"LesserThanOrEqualTo\",\"subnetMaskLength\":\"mseharx\"}],\"annotation\":\"vqnrxtmbpj\"},\"location\":\"nvwjhrsidqpxl\",\"tags\":{\"twmykyut\":\"akftng\",\"wmfjhp\":\"ym\",\"wkqp\":\"cvjqdv\"},\"id\":\"drlefgnaavuag\",\"name\":\"tetaoutnpdctuhs\",\"type\":\"fefyihduyeuyld\"}],\"nextLink\":\"mtybkcgsu\"}") - .toObject(IpPrefixesListResult.class); - Assertions.assertEquals("lzqocark", model.value().get(0).location()); - Assertions.assertEquals("bc", model.value().get(0).tags().get("ndtsnxawqytll")); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.value().get(0).ipPrefixRules().get(0).action()); - Assertions.assertEquals(4132053011483254842L, model.value().get(0).ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("jsvkskmqozzkivy", model.value().get(0).ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.EQUAL_TO, model.value().get(0).ipPrefixRules().get(0).condition()); - Assertions.assertEquals("iizjixlqfhefkwa", model.value().get(0).ipPrefixRules().get(0).subnetMaskLength()); - Assertions.assertEquals("xsjxtelexhvuqboz", model.value().get(0).annotation()); - Assertions.assertEquals("mtybkcgsu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpPrefixesListResult model = - new IpPrefixesListResult() - .withValue( - Arrays - .asList( - new IpPrefixInner() - .withLocation("lzqocark") - .withTags(mapOf("ndtsnxawqytll", "bc", "yckzex", "dyz")) - .withIpPrefixRules( - Arrays - .asList( - new IpPrefixRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(4132053011483254842L) - .withNetworkPrefix("jsvkskmqozzkivy") - .withCondition(Condition.EQUAL_TO) - .withSubnetMaskLength("iizjixlqfhefkwa"), - new IpPrefixRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(3579630685360942512L) - .withNetworkPrefix("ron") - .withCondition(Condition.LESSER_THAN_OR_EQUAL_TO) - .withSubnetMaskLength("gn"))) - .withAnnotation("xsjxtelexhvuqboz"), - new IpPrefixInner() - .withLocation("mywhsb") - .withTags( - mapOf( - "jjzyvoaqajuve", - "ryc", - "pfulube", - "zptdmkrrbh", - "ununm", - "gybpmfb", - "kdschlzvfictnkjj", - "zkrvfyi")) - .withIpPrefixRules( - Arrays - .asList( - new IpPrefixRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(118162518124769892L) - .withNetworkPrefix("quryk") - .withCondition(Condition.LESSER_THAN_OR_EQUAL_TO) - .withSubnetMaskLength("ueekcsue"), - new IpPrefixRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(4151407068847251052L) - .withNetworkPrefix("dac") - .withCondition(Condition.LESSER_THAN_OR_EQUAL_TO) - .withSubnetMaskLength("ydl"), - new IpPrefixRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(130832318700138063L) - .withNetworkPrefix("wmhmptyrilkfbnr") - .withCondition(Condition.RANGE) - .withSubnetMaskLength("ztpb"), - new IpPrefixRule() - .withAction(CommunityActionTypes.PERMIT) - .withSequenceNumber(7773880630728112607L) - .withNetworkPrefix("txjt") - .withCondition(Condition.GREATER_THAN_OR_EQUAL_TO) - .withSubnetMaskLength("swbnfddepldwqjns"))) - .withAnnotation("ygleexa"), - new IpPrefixInner() - .withLocation("nvwjhrsidqpxl") - .withTags(mapOf("twmykyut", "akftng", "wmfjhp", "ym", "wkqp", "cvjqdv")) - .withIpPrefixRules( - Arrays - .asList( - new IpPrefixRule() - .withAction(CommunityActionTypes.DENY) - .withSequenceNumber(5070835468402893482L) - .withNetworkPrefix("wtyg") - .withCondition(Condition.LESSER_THAN_OR_EQUAL_TO) - .withSubnetMaskLength("mseharx"))) - .withAnnotation("vqnrxtmbpj"))) - .withNextLink("mtybkcgsu"); - model = BinaryData.fromObject(model).toObject(IpPrefixesListResult.class); - Assertions.assertEquals("lzqocark", model.value().get(0).location()); - Assertions.assertEquals("bc", model.value().get(0).tags().get("ndtsnxawqytll")); - Assertions.assertEquals(CommunityActionTypes.PERMIT, model.value().get(0).ipPrefixRules().get(0).action()); - Assertions.assertEquals(4132053011483254842L, model.value().get(0).ipPrefixRules().get(0).sequenceNumber()); - Assertions.assertEquals("jsvkskmqozzkivy", model.value().get(0).ipPrefixRules().get(0).networkPrefix()); - Assertions.assertEquals(Condition.EQUAL_TO, model.value().get(0).ipPrefixRules().get(0).condition()); - Assertions.assertEquals("iizjixlqfhefkwa", model.value().get(0).ipPrefixRules().get(0).subnetMaskLength()); - Assertions.assertEquals("xsjxtelexhvuqboz", model.value().get(0).annotation()); - Assertions.assertEquals("mtybkcgsu", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IsolationDomainPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IsolationDomainPropertiesTests.java deleted file mode 100644 index d908f4e81683..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/IsolationDomainPropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.IsolationDomainProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IsolationDomainPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IsolationDomainProperties model = - BinaryData - .fromString("{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"tgbqpfyrv\",\"tvijvwmrgcnz\"]}") - .toObject(IsolationDomainProperties.class); - Assertions.assertEquals(Encapsulation.NONE, model.encapsulation()); - Assertions.assertEquals("tgbqpfyrv", model.neighborGroupIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IsolationDomainProperties model = - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("tgbqpfyrv", "tvijvwmrgcnz")); - model = BinaryData.fromObject(model).toObject(IsolationDomainProperties.class); - Assertions.assertEquals(Encapsulation.NONE, model.encapsulation()); - Assertions.assertEquals("tgbqpfyrv", model.neighborGroupIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainInnerTests.java deleted file mode 100644 index e4a5f2f66692..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainInnerTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L2IsolationDomainInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L2IsolationDomainInner model = - BinaryData - .fromString( - "{\"properties\":{\"networkFabricId\":\"h\",\"vlanId\":1761587011,\"mtu\":765927655,\"configurationState\":\"Rejected\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"RMA\",\"annotation\":\"exlfciatxtjrrl\"},\"location\":\"dskjhhxdlaj\",\"tags\":{\"a\":\"cxscvslxlh\",\"slojfkqidnqt\":\"krmukmyjmkxett\",\"rngl\":\"qxjhqxcsqhtkbtnq\"},\"id\":\"mbiipsnawwlqk\",\"name\":\"nxhhl\",\"type\":\"xricctkwmuqq\"}") - .toObject(L2IsolationDomainInner.class); - Assertions.assertEquals("dskjhhxdlaj", model.location()); - Assertions.assertEquals("cxscvslxlh", model.tags().get("a")); - Assertions.assertEquals("h", model.networkFabricId()); - Assertions.assertEquals(1761587011, model.vlanId()); - Assertions.assertEquals(765927655, model.mtu()); - Assertions.assertEquals("exlfciatxtjrrl", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L2IsolationDomainInner model = - new L2IsolationDomainInner() - .withLocation("dskjhhxdlaj") - .withTags(mapOf("a", "cxscvslxlh", "slojfkqidnqt", "krmukmyjmkxett", "rngl", "qxjhqxcsqhtkbtnq")) - .withNetworkFabricId("h") - .withVlanId(1761587011) - .withMtu(765927655) - .withAnnotation("exlfciatxtjrrl"); - model = BinaryData.fromObject(model).toObject(L2IsolationDomainInner.class); - Assertions.assertEquals("dskjhhxdlaj", model.location()); - Assertions.assertEquals("cxscvslxlh", model.tags().get("a")); - Assertions.assertEquals("h", model.networkFabricId()); - Assertions.assertEquals(1761587011, model.vlanId()); - Assertions.assertEquals(765927655, model.mtu()); - Assertions.assertEquals("exlfciatxtjrrl", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainPatchPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainPatchPropertiesTests.java deleted file mode 100644 index 5588d2ace1f3..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainPatchPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainPatchProperties; -import org.junit.jupiter.api.Assertions; - -public final class L2IsolationDomainPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L2IsolationDomainPatchProperties model = - BinaryData - .fromString("{\"mtu\":1799510846,\"annotation\":\"kwxe\"}") - .toObject(L2IsolationDomainPatchProperties.class); - Assertions.assertEquals("kwxe", model.annotation()); - Assertions.assertEquals(1799510846, model.mtu()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L2IsolationDomainPatchProperties model = - new L2IsolationDomainPatchProperties().withAnnotation("kwxe").withMtu(1799510846); - model = BinaryData.fromObject(model).toObject(L2IsolationDomainPatchProperties.class); - Assertions.assertEquals("kwxe", model.annotation()); - Assertions.assertEquals(1799510846, model.mtu()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainPatchTests.java deleted file mode 100644 index 747cfaf15253..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainPatchTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomainPatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L2IsolationDomainPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L2IsolationDomainPatch model = - BinaryData - .fromString( - "{\"properties\":{\"mtu\":1649679831,\"annotation\":\"jzacvumepjpbibn\"},\"tags\":{\"fexleqirccjcly\":\"hep\",\"vczuodacpune\":\"cgxvrpj\",\"oy\":\"tepdjxqes\",\"aewse\":\"uiylpc\"}}") - .toObject(L2IsolationDomainPatch.class); - Assertions.assertEquals("hep", model.tags().get("fexleqirccjcly")); - Assertions.assertEquals(1649679831, model.mtu()); - Assertions.assertEquals("jzacvumepjpbibn", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L2IsolationDomainPatch model = - new L2IsolationDomainPatch() - .withTags( - mapOf("fexleqirccjcly", "hep", "vczuodacpune", "cgxvrpj", "oy", "tepdjxqes", "aewse", "uiylpc")) - .withMtu(1649679831) - .withAnnotation("jzacvumepjpbibn"); - model = BinaryData.fromObject(model).toObject(L2IsolationDomainPatch.class); - Assertions.assertEquals("hep", model.tags().get("fexleqirccjcly")); - Assertions.assertEquals(1649679831, model.mtu()); - Assertions.assertEquals("jzacvumepjpbibn", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainPropertiesTests.java deleted file mode 100644 index fb7fb11e44a2..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainProperties; -import org.junit.jupiter.api.Assertions; - -public final class L2IsolationDomainPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L2IsolationDomainProperties model = - BinaryData - .fromString( - "{\"networkFabricId\":\"ajxeiygle\",\"vlanId\":216127976,\"mtu\":1327006192,\"configurationState\":\"ErrorDeprovisioning\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"MAT\",\"annotation\":\"rceqnkbrupob\"}") - .toObject(L2IsolationDomainProperties.class); - Assertions.assertEquals("rceqnkbrupob", model.annotation()); - Assertions.assertEquals("ajxeiygle", model.networkFabricId()); - Assertions.assertEquals(216127976, model.vlanId()); - Assertions.assertEquals(1327006192, model.mtu()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L2IsolationDomainProperties model = - new L2IsolationDomainProperties() - .withAnnotation("rceqnkbrupob") - .withNetworkFabricId("ajxeiygle") - .withVlanId(216127976) - .withMtu(1327006192); - model = BinaryData.fromObject(model).toObject(L2IsolationDomainProperties.class); - Assertions.assertEquals("rceqnkbrupob", model.annotation()); - Assertions.assertEquals("ajxeiygle", model.networkFabricId()); - Assertions.assertEquals(216127976, model.vlanId()); - Assertions.assertEquals(1327006192, model.mtu()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCommitConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCommitConfigurationMockTests.java deleted file mode 100644 index b64caa689bae..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCommitConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -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 L2IsolationDomainsCommitConfigurationMockTests { - @Test - public void testCommitConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Failed\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager.l2IsolationDomains().commitConfiguration("ilohlgrjcxh", "fhzns", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateMockTests.java deleted file mode 100644 index b0401480891e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateMockTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomain; -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 L2IsolationDomainsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"networkFabricId\":\"ybnnnlpqdnnska\",\"vlanId\":1332593691,\"mtu\":238736375,\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"Disabled\",\"annotation\":\"dvvmbjernd\"},\"location\":\"ywxqr\",\"tags\":{\"utlkszuxjmrz\":\"tkdeetnnef\",\"n\":\"xwasfwqjzybmfq\",\"wpjbblu\":\"pfcfguamrvamuvkg\",\"hdukcsqvyeegxhu\":\"gctvnspjvsyydj\"},\"id\":\"ojwumfjdymeqv\",\"name\":\"xpfyxdjspnonx\",\"type\":\"mhqpz\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - L2IsolationDomain response = - manager - .l2IsolationDomains() - .define("kgdskwvb") - .withRegion("kryhh") - .withExistingResourceGroup("rchmetvzhuugd") - .withNetworkFabricId("cawwayqtsrn") - .withVlanId(1911194089) - .withTags(mapOf("knooxdjkl", "zhhllx")) - .withMtu(946025458) - .withAnnotation("elued") - .create(); - - Assertions.assertEquals("ywxqr", response.location()); - Assertions.assertEquals("tkdeetnnef", response.tags().get("utlkszuxjmrz")); - Assertions.assertEquals("ybnnnlpqdnnska", response.networkFabricId()); - Assertions.assertEquals(1332593691, response.vlanId()); - Assertions.assertEquals(238736375, response.mtu()); - Assertions.assertEquals("dvvmbjernd", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 5d783bdb3f46..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomain; -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 L2IsolationDomainsGetByResourceGroupWithResponseMockTests { - @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\":{\"networkFabricId\":\"s\",\"vlanId\":959670016,\"mtu\":420780724,\"configurationState\":\"Provisioned\",\"provisioningState\":\"Updating\",\"administrativeState\":\"RMA\",\"annotation\":\"rxjkc\"},\"location\":\"enubrf\",\"tags\":{\"roeqcrjvcjskq\":\"kxnwtz\",\"wapdunhdikatzmtu\":\"fnm\"},\"id\":\"fnhitjkbibxlwz\",\"name\":\"vkcmcuiaunlo\",\"type\":\"in\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - L2IsolationDomain response = - manager - .l2IsolationDomains() - .getByResourceGroupWithResponse("gcaygumqeobrwre", "dgsawhami", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("enubrf", response.location()); - Assertions.assertEquals("kxnwtz", response.tags().get("roeqcrjvcjskq")); - Assertions.assertEquals("s", response.networkFabricId()); - Assertions.assertEquals(959670016, response.vlanId()); - Assertions.assertEquals(420780724, response.mtu()); - Assertions.assertEquals("rxjkc", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListByResourceGroupMockTests.java deleted file mode 100644 index 45cb43a39ca1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomain; -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 L2IsolationDomainsListByResourceGroupMockTests { - @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\":{\"networkFabricId\":\"ylyumb\",\"vlanId\":965402508,\"mtu\":1411400151,\"configurationState\":\"Accepted\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Disabled\",\"annotation\":\"hdkhmemxka\"},\"location\":\"pesnb\",\"tags\":{\"jvwbat\":\"llyfzmnxrmx\",\"kmwfwzlmpxfmdjs\":\"g\",\"cbdnpfcg\":\"ommdzphxulx\"},\"id\":\"dttowqxxc\",\"name\":\"bzxp\",\"type\":\"loovhati\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.l2IsolationDomains().listByResourceGroup("ogbv", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pesnb", response.iterator().next().location()); - Assertions.assertEquals("llyfzmnxrmx", response.iterator().next().tags().get("jvwbat")); - Assertions.assertEquals("ylyumb", response.iterator().next().networkFabricId()); - Assertions.assertEquals(965402508, response.iterator().next().vlanId()); - Assertions.assertEquals(1411400151, response.iterator().next().mtu()); - Assertions.assertEquals("hdkhmemxka", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListMockTests.java deleted file mode 100644 index 176afa3748cc..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomain; -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 L2IsolationDomainsListMockTests { - @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\":{\"networkFabricId\":\"wtc\",\"vlanId\":1538967498,\"mtu\":1596627228,\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"MAT\",\"annotation\":\"t\"},\"location\":\"ql\",\"tags\":{\"gq\":\"i\",\"dpfvlsqmmetwtla\":\"zk\"},\"id\":\"nkjtefbd\",\"name\":\"nuvhgcgrllyyfsm\",\"type\":\"cbx\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.l2IsolationDomains().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ql", response.iterator().next().location()); - Assertions.assertEquals("i", response.iterator().next().tags().get("gq")); - Assertions.assertEquals("wtc", response.iterator().next().networkFabricId()); - Assertions.assertEquals(1538967498, response.iterator().next().vlanId()); - Assertions.assertEquals(1596627228, response.iterator().next().mtu()); - Assertions.assertEquals("t", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListResultTests.java deleted file mode 100644 index 3ef339ba6332..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListResultTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainInner; -import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomainsListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L2IsolationDomainsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L2IsolationDomainsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"networkFabricId\":\"egw\",\"vlanId\":397812436,\"mtu\":1816525505,\"configurationState\":\"Accepted\",\"provisioningState\":\"Updating\",\"administrativeState\":\"MAT\",\"annotation\":\"thaokgkskj\"},\"location\":\"bs\",\"tags\":{\"kpeexpgeumilh\":\"jqf\"},\"id\":\"uitrdexyiono\",\"name\":\"ninbdbzsxcwqqrs\",\"type\":\"pcbbprtugav\"},{\"properties\":{\"networkFabricId\":\"zbcyksiv\",\"vlanId\":284686585,\"mtu\":406980993,\"configurationState\":\"Accepted\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"MAT\",\"annotation\":\"krftsjcwjjxsg\"},\"location\":\"awvifdxke\",\"tags\":{\"xvcmufunlcp\":\"hocjxwkloozrv\"},\"id\":\"xvi\",\"name\":\"yeyng\",\"type\":\"g\"},{\"properties\":{\"networkFabricId\":\"rquv\",\"vlanId\":563018487,\"mtu\":915199284,\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Failed\",\"administrativeState\":\"RMA\",\"annotation\":\"ueljtiahxmfqryar\"},\"location\":\"x\",\"tags\":{\"btl\":\"glcjkayspthzod\",\"kfmkmfdjxyxgbk\":\"jtgblios\",\"l\":\"qvjcteoe\",\"xv\":\"slskkz\"},\"id\":\"nzdpvoco\",\"name\":\"hpcnabxzfsn\",\"type\":\"gyte\"}],\"nextLink\":\"zilmhivzkww\"}") - .toObject(L2IsolationDomainsListResult.class); - Assertions.assertEquals("bs", model.value().get(0).location()); - Assertions.assertEquals("jqf", model.value().get(0).tags().get("kpeexpgeumilh")); - Assertions.assertEquals("egw", model.value().get(0).networkFabricId()); - Assertions.assertEquals(397812436, model.value().get(0).vlanId()); - Assertions.assertEquals(1816525505, model.value().get(0).mtu()); - Assertions.assertEquals("thaokgkskj", model.value().get(0).annotation()); - Assertions.assertEquals("zilmhivzkww", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L2IsolationDomainsListResult model = - new L2IsolationDomainsListResult() - .withValue( - Arrays - .asList( - new L2IsolationDomainInner() - .withLocation("bs") - .withTags(mapOf("kpeexpgeumilh", "jqf")) - .withNetworkFabricId("egw") - .withVlanId(397812436) - .withMtu(1816525505) - .withAnnotation("thaokgkskj"), - new L2IsolationDomainInner() - .withLocation("awvifdxke") - .withTags(mapOf("xvcmufunlcp", "hocjxwkloozrv")) - .withNetworkFabricId("zbcyksiv") - .withVlanId(284686585) - .withMtu(406980993) - .withAnnotation("krftsjcwjjxsg"), - new L2IsolationDomainInner() - .withLocation("x") - .withTags( - mapOf( - "btl", - "glcjkayspthzod", - "kfmkmfdjxyxgbk", - "jtgblios", - "l", - "qvjcteoe", - "xv", - "slskkz")) - .withNetworkFabricId("rquv") - .withVlanId(563018487) - .withMtu(915199284) - .withAnnotation("ueljtiahxmfqryar"))) - .withNextLink("zilmhivzkww"); - model = BinaryData.fromObject(model).toObject(L2IsolationDomainsListResult.class); - Assertions.assertEquals("bs", model.value().get(0).location()); - Assertions.assertEquals("jqf", model.value().get(0).tags().get("kpeexpgeumilh")); - Assertions.assertEquals("egw", model.value().get(0).networkFabricId()); - Assertions.assertEquals(397812436, model.value().get(0).vlanId()); - Assertions.assertEquals(1816525505, model.value().get(0).mtu()); - Assertions.assertEquals("thaokgkskj", model.value().get(0).annotation()); - Assertions.assertEquals("zilmhivzkww", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateAdministrativeStateMockTests.java deleted file mode 100644 index 5bf88aaedabc..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -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 L2IsolationDomainsUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"configurationState\":\"Rejected\",\"successfulDevices\":[\"bpcjesfyvuztns\",\"mshkkgygfohr\"],\"failedDevices\":[\"hlclpkr\",\"r\"]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForDeviceUpdate response = - manager - .l2IsolationDomains() - .updateAdministrativeState( - "fbaoboiahkp", - "svaxmksaxyeedvp", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("dutydvv")) - .withState(EnableDisableState.ENABLE), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bpcjesfyvuztns", response.successfulDevices().get(0)); - Assertions.assertEquals("hlclpkr", response.failedDevices().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsValidateConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsValidateConfigurationMockTests.java deleted file mode 100644 index 1d5687000301..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsValidateConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationResponse; -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 L2IsolationDomainsValidateConfigurationMockTests { - @Test - public void testValidateConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Accepted\",\"url\":\"xtmrmgftj\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateConfigurationResponse response = - manager.l2IsolationDomains().validateConfiguration("mjjviut", "vr", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xtmrmgftj", response.url()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3ExportRoutePolicyTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3ExportRoutePolicyTests.java deleted file mode 100644 index daf451dbb8a8..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3ExportRoutePolicyTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.L3ExportRoutePolicy; -import org.junit.jupiter.api.Assertions; - -public final class L3ExportRoutePolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3ExportRoutePolicy model = - BinaryData - .fromString( - "{\"exportIpv4RoutePolicyId\":\"weuipmpvksmi\",\"exportIpv6RoutePolicyId\":\"sqxtltclkrdpq\"}") - .toObject(L3ExportRoutePolicy.class); - Assertions.assertEquals("weuipmpvksmi", model.exportIpv4RoutePolicyId()); - Assertions.assertEquals("sqxtltclkrdpq", model.exportIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3ExportRoutePolicy model = - new L3ExportRoutePolicy() - .withExportIpv4RoutePolicyId("weuipmpvksmi") - .withExportIpv6RoutePolicyId("sqxtltclkrdpq"); - model = BinaryData.fromObject(model).toObject(L3ExportRoutePolicy.class); - Assertions.assertEquals("weuipmpvksmi", model.exportIpv4RoutePolicyId()); - Assertions.assertEquals("sqxtltclkrdpq", model.exportIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainInnerTests.java deleted file mode 100644 index e717b60f9fb4..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainInnerTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainInner; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRoute; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnetRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L3IsolationDomainInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3IsolationDomainInner model = - BinaryData - .fromString( - "{\"properties\":{\"networkFabricId\":\"ncknrzdajlsk\",\"configurationState\":\"Accepted\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"Enabled\",\"redistributeConnectedSubnets\":\"True\",\"redistributeStaticRoutes\":\"False\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"hxqlehmcgcjeinue\"}],\"ipv6Routes\":[{\"prefix\":\"am\"},{\"prefix\":\"fejvqn\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"bqd\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"fiv\",\"exportIpv6RoutePolicyId\":\"kpysthhzagjf\"}},\"annotation\":\"yrl\"},\"location\":\"enuzejg\",\"tags\":{\"szllrzlsmmdqgmi\":\"eba\"},\"id\":\"zpimcqrhn\",\"name\":\"t\",\"type\":\"inklogxs\"}") - .toObject(L3IsolationDomainInner.class); - Assertions.assertEquals("enuzejg", model.location()); - Assertions.assertEquals("eba", model.tags().get("szllrzlsmmdqgmi")); - Assertions.assertEquals("ncknrzdajlsk", model.networkFabricId()); - Assertions.assertEquals(RedistributeConnectedSubnets.TRUE, model.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, model.redistributeStaticRoutes()); - Assertions.assertEquals("hxqlehmcgcjeinue", model.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("am", model.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("bqd", model.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals("fiv", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals( - "kpysthhzagjf", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("yrl", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3IsolationDomainInner model = - new L3IsolationDomainInner() - .withLocation("enuzejg") - .withTags(mapOf("szllrzlsmmdqgmi", "eba")) - .withNetworkFabricId("ncknrzdajlsk") - .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.TRUE) - .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE) - .withAggregateRouteConfiguration( - new AggregateRouteConfiguration() - .withIpv4Routes(Arrays.asList(new AggregateRoute().withPrefix("hxqlehmcgcjeinue"))) - .withIpv6Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("am"), new AggregateRoute().withPrefix("fejvqn")))) - .withConnectedSubnetRoutePolicy( - new ConnectedSubnetRoutePolicy() - .withExportRoutePolicyId("bqd") - .withExportRoutePolicy( - new L3ExportRoutePolicy() - .withExportIpv4RoutePolicyId("fiv") - .withExportIpv6RoutePolicyId("kpysthhzagjf"))) - .withAnnotation("yrl"); - model = BinaryData.fromObject(model).toObject(L3IsolationDomainInner.class); - Assertions.assertEquals("enuzejg", model.location()); - Assertions.assertEquals("eba", model.tags().get("szllrzlsmmdqgmi")); - Assertions.assertEquals("ncknrzdajlsk", model.networkFabricId()); - Assertions.assertEquals(RedistributeConnectedSubnets.TRUE, model.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, model.redistributeStaticRoutes()); - Assertions.assertEquals("hxqlehmcgcjeinue", model.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("am", model.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("bqd", model.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals("fiv", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals( - "kpysthhzagjf", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("yrl", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPatchPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPatchPropertiesTests.java deleted file mode 100644 index d2d583ee6227..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPatchPropertiesTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainPatchProperties; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRoute; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnetRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class L3IsolationDomainPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3IsolationDomainPatchProperties model = - BinaryData - .fromString( - "{\"redistributeConnectedSubnets\":\"False\",\"redistributeStaticRoutes\":\"False\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"ohdkcprgukx\"},{\"prefix\":\"ztiochluti\"},{\"prefix\":\"mqrud\"},{\"prefix\":\"izcbfzmcrunfhiuc\"}],\"ipv6Routes\":[{\"prefix\":\"bcpaqktkrumzued\"},{\"prefix\":\"yzbfvxovqkx\"},{\"prefix\":\"uxqggvqrnhyhl\"},{\"prefix\":\"cjsqggjhffbxr\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"ijpeuql\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"eqztvxwmwwm\",\"exportIpv6RoutePolicyId\":\"wenawwam\"}},\"annotation\":\"leqioulndh\"}") - .toObject(L3IsolationDomainPatchProperties.class); - Assertions.assertEquals("leqioulndh", model.annotation()); - Assertions.assertEquals(RedistributeConnectedSubnets.FALSE, model.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, model.redistributeStaticRoutes()); - Assertions.assertEquals("ohdkcprgukx", model.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("bcpaqktkrumzued", model.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("ijpeuql", model.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "eqztvxwmwwm", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("wenawwam", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3IsolationDomainPatchProperties model = - new L3IsolationDomainPatchProperties() - .withAnnotation("leqioulndh") - .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.FALSE) - .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE) - .withAggregateRouteConfiguration( - new AggregateRouteConfiguration() - .withIpv4Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("ohdkcprgukx"), - new AggregateRoute().withPrefix("ztiochluti"), - new AggregateRoute().withPrefix("mqrud"), - new AggregateRoute().withPrefix("izcbfzmcrunfhiuc"))) - .withIpv6Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("bcpaqktkrumzued"), - new AggregateRoute().withPrefix("yzbfvxovqkx"), - new AggregateRoute().withPrefix("uxqggvqrnhyhl"), - new AggregateRoute().withPrefix("cjsqggjhffbxr")))) - .withConnectedSubnetRoutePolicy( - new ConnectedSubnetRoutePolicy() - .withExportRoutePolicyId("ijpeuql") - .withExportRoutePolicy( - new L3ExportRoutePolicy() - .withExportIpv4RoutePolicyId("eqztvxwmwwm") - .withExportIpv6RoutePolicyId("wenawwam"))); - model = BinaryData.fromObject(model).toObject(L3IsolationDomainPatchProperties.class); - Assertions.assertEquals("leqioulndh", model.annotation()); - Assertions.assertEquals(RedistributeConnectedSubnets.FALSE, model.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, model.redistributeStaticRoutes()); - Assertions.assertEquals("ohdkcprgukx", model.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("bcpaqktkrumzued", model.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("ijpeuql", model.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "eqztvxwmwwm", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("wenawwam", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPatchTests.java deleted file mode 100644 index 6754e7d9edc7..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPatchTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRoute; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnetRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatch; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L3IsolationDomainPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3IsolationDomainPatch model = - BinaryData - .fromString( - "{\"properties\":{\"redistributeConnectedSubnets\":\"True\",\"redistributeStaticRoutes\":\"False\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"kldgrcwfcmfc\"}],\"ipv6Routes\":[{\"prefix\":\"ajqmat\"},{\"prefix\":\"jti\"},{\"prefix\":\"ln\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"xxgfbbmtlpqagyn\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"rnzcalinc\",\"exportIpv6RoutePolicyId\":\"qxzxaqz\"}},\"annotation\":\"mqimiymqru\"},\"tags\":{\"lanfkgxsya\":\"hfupetasvvoqsbpk\"}}") - .toObject(L3IsolationDomainPatch.class); - Assertions.assertEquals("hfupetasvvoqsbpk", model.tags().get("lanfkgxsya")); - Assertions.assertEquals(RedistributeConnectedSubnets.TRUE, model.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, model.redistributeStaticRoutes()); - Assertions.assertEquals("kldgrcwfcmfc", model.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("ajqmat", model.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("xxgfbbmtlpqagyn", model.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "rnzcalinc", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("qxzxaqz", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("mqimiymqru", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3IsolationDomainPatch model = - new L3IsolationDomainPatch() - .withTags(mapOf("lanfkgxsya", "hfupetasvvoqsbpk")) - .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.TRUE) - .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE) - .withAggregateRouteConfiguration( - new AggregateRouteConfiguration() - .withIpv4Routes(Arrays.asList(new AggregateRoute().withPrefix("kldgrcwfcmfc"))) - .withIpv6Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("ajqmat"), - new AggregateRoute().withPrefix("jti"), - new AggregateRoute().withPrefix("ln")))) - .withConnectedSubnetRoutePolicy( - new ConnectedSubnetRoutePolicy() - .withExportRoutePolicyId("xxgfbbmtlpqagyn") - .withExportRoutePolicy( - new L3ExportRoutePolicy() - .withExportIpv4RoutePolicyId("rnzcalinc") - .withExportIpv6RoutePolicyId("qxzxaqz"))) - .withAnnotation("mqimiymqru"); - model = BinaryData.fromObject(model).toObject(L3IsolationDomainPatch.class); - Assertions.assertEquals("hfupetasvvoqsbpk", model.tags().get("lanfkgxsya")); - Assertions.assertEquals(RedistributeConnectedSubnets.TRUE, model.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, model.redistributeStaticRoutes()); - Assertions.assertEquals("kldgrcwfcmfc", model.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("ajqmat", model.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("xxgfbbmtlpqagyn", model.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "rnzcalinc", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("qxzxaqz", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("mqimiymqru", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPatchablePropertiesTests.java deleted file mode 100644 index 2db794fd9362..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPatchablePropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRoute; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnetRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class L3IsolationDomainPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3IsolationDomainPatchableProperties model = - BinaryData - .fromString( - "{\"redistributeConnectedSubnets\":\"False\",\"redistributeStaticRoutes\":\"True\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"dpkawnsnl\"},{\"prefix\":\"imouxwksqmudmfco\"},{\"prefix\":\"bicziuswswj\"}],\"ipv6Routes\":[{\"prefix\":\"qsj\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"qqvyfscyrfw\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"qvogfuyz\",\"exportIpv6RoutePolicyId\":\"bhli\"}}}") - .toObject(L3IsolationDomainPatchableProperties.class); - Assertions.assertEquals(RedistributeConnectedSubnets.FALSE, model.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.TRUE, model.redistributeStaticRoutes()); - Assertions.assertEquals("dpkawnsnl", model.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("qsj", model.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("qqvyfscyrfw", model.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals("qvogfuyz", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("bhli", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3IsolationDomainPatchableProperties model = - new L3IsolationDomainPatchableProperties() - .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.FALSE) - .withRedistributeStaticRoutes(RedistributeStaticRoutes.TRUE) - .withAggregateRouteConfiguration( - new AggregateRouteConfiguration() - .withIpv4Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("dpkawnsnl"), - new AggregateRoute().withPrefix("imouxwksqmudmfco"), - new AggregateRoute().withPrefix("bicziuswswj"))) - .withIpv6Routes(Arrays.asList(new AggregateRoute().withPrefix("qsj")))) - .withConnectedSubnetRoutePolicy( - new ConnectedSubnetRoutePolicy() - .withExportRoutePolicyId("qqvyfscyrfw") - .withExportRoutePolicy( - new L3ExportRoutePolicy() - .withExportIpv4RoutePolicyId("qvogfuyz") - .withExportIpv6RoutePolicyId("bhli"))); - model = BinaryData.fromObject(model).toObject(L3IsolationDomainPatchableProperties.class); - Assertions.assertEquals(RedistributeConnectedSubnets.FALSE, model.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.TRUE, model.redistributeStaticRoutes()); - Assertions.assertEquals("dpkawnsnl", model.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("qsj", model.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("qqvyfscyrfw", model.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals("qvogfuyz", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("bhli", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPropertiesTests.java deleted file mode 100644 index 91ed447aadcb..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainPropertiesTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainProperties; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRoute; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnetRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class L3IsolationDomainPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3IsolationDomainProperties model = - BinaryData - .fromString( - "{\"networkFabricId\":\"tzarhzvqnsqktc\",\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Failed\",\"administrativeState\":\"Disabled\",\"redistributeConnectedSubnets\":\"True\",\"redistributeStaticRoutes\":\"False\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"glwkzpgajsqj\"},{\"prefix\":\"emqbmfuvqarwzxuq\"},{\"prefix\":\"ebluimmbwx\"},{\"prefix\":\"fgtdmbvx\"}],\"ipv6Routes\":[{\"prefix\":\"aokqk\"},{\"prefix\":\"ud\"},{\"prefix\":\"twaokb\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"ytt\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"nwfrkebsmhpd\",\"exportIpv6RoutePolicyId\":\"dig\"}},\"annotation\":\"olekscbctnanqim\"}") - .toObject(L3IsolationDomainProperties.class); - Assertions.assertEquals("olekscbctnanqim", model.annotation()); - Assertions.assertEquals("tzarhzvqnsqktc", model.networkFabricId()); - Assertions.assertEquals(RedistributeConnectedSubnets.TRUE, model.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, model.redistributeStaticRoutes()); - Assertions.assertEquals("glwkzpgajsqj", model.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("aokqk", model.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("ytt", model.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "nwfrkebsmhpd", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("dig", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3IsolationDomainProperties model = - new L3IsolationDomainProperties() - .withAnnotation("olekscbctnanqim") - .withNetworkFabricId("tzarhzvqnsqktc") - .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.TRUE) - .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE) - .withAggregateRouteConfiguration( - new AggregateRouteConfiguration() - .withIpv4Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("glwkzpgajsqj"), - new AggregateRoute().withPrefix("emqbmfuvqarwzxuq"), - new AggregateRoute().withPrefix("ebluimmbwx"), - new AggregateRoute().withPrefix("fgtdmbvx"))) - .withIpv6Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("aokqk"), - new AggregateRoute().withPrefix("ud"), - new AggregateRoute().withPrefix("twaokb")))) - .withConnectedSubnetRoutePolicy( - new ConnectedSubnetRoutePolicy() - .withExportRoutePolicyId("ytt") - .withExportRoutePolicy( - new L3ExportRoutePolicy() - .withExportIpv4RoutePolicyId("nwfrkebsmhpd") - .withExportIpv6RoutePolicyId("dig"))); - model = BinaryData.fromObject(model).toObject(L3IsolationDomainProperties.class); - Assertions.assertEquals("olekscbctnanqim", model.annotation()); - Assertions.assertEquals("tzarhzvqnsqktc", model.networkFabricId()); - Assertions.assertEquals(RedistributeConnectedSubnets.TRUE, model.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, model.redistributeStaticRoutes()); - Assertions.assertEquals("glwkzpgajsqj", model.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("aokqk", model.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("ytt", model.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "nwfrkebsmhpd", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("dig", model.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCommitConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCommitConfigurationMockTests.java deleted file mode 100644 index a7d3e4cdf36e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCommitConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -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 L3IsolationDomainsCommitConfigurationMockTests { - @Test - public void testCommitConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Provisioned\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager.l3IsolationDomains().commitConfiguration("uupcze", "qn", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateMockTests.java deleted file mode 100644 index d069be012840..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRoute; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnetRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomain; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; -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 L3IsolationDomainsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"networkFabricId\":\"pncjqbgbnoqnowv\",\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"RMA\",\"redistributeConnectedSubnets\":\"True\",\"redistributeStaticRoutes\":\"True\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"rv\"},{\"prefix\":\"polnvgpppdilbdvx\"}],\"ipv6Routes\":[{\"prefix\":\"lz\"},{\"prefix\":\"gapspx\"},{\"prefix\":\"wblscrmzquuz\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"gouxnro\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"hesywyw\",\"exportIpv6RoutePolicyId\":\"gyo\"}},\"annotation\":\"ifrzcwuejmxlfzl\"},\"location\":\"yrgr\",\"tags\":{\"jovlxqtvmvzpniq\":\"hrau\",\"nkgtlh\":\"xmrg\"},\"id\":\"krazkioiyecz\",\"name\":\"vzmsvzngheq\",\"type\":\"hehgvmmnoyz\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - L3IsolationDomain response = - manager - .l3IsolationDomains() - .define("ttjnknpbqgzk") - .withRegion("enmjogxgrg") - .withExistingResourceGroup("ssvgyoggkzt") - .withNetworkFabricId("obc") - .withTags(mapOf("i", "iwbn", "vvmrn", "rs")) - .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.TRUE) - .withRedistributeStaticRoutes(RedistributeStaticRoutes.TRUE) - .withAggregateRouteConfiguration( - new AggregateRouteConfiguration() - .withIpv4Routes( - Arrays - .asList(new AggregateRoute().withPrefix("yu"), new AggregateRoute().withPrefix("pnnh"))) - .withIpv6Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("kffeon"), - new AggregateRoute().withPrefix("nvmujyiqyw"), - new AggregateRoute().withPrefix("pxmliytd")))) - .withConnectedSubnetRoutePolicy( - new ConnectedSubnetRoutePolicy() - .withExportRoutePolicyId("runbkil") - .withExportRoutePolicy( - new L3ExportRoutePolicy() - .withExportIpv4RoutePolicyId("ekbirhyvsyuv") - .withExportIpv6RoutePolicyId("emorszffiukltrv"))) - .withAnnotation("oguoxcsdqox") - .create(); - - Assertions.assertEquals("yrgr", response.location()); - Assertions.assertEquals("hrau", response.tags().get("jovlxqtvmvzpniq")); - Assertions.assertEquals("pncjqbgbnoqnowv", response.networkFabricId()); - Assertions.assertEquals(RedistributeConnectedSubnets.TRUE, response.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.TRUE, response.redistributeStaticRoutes()); - Assertions.assertEquals("rv", response.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("lz", response.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("gouxnro", response.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "hesywyw", response.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("gyo", response.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("ifrzcwuejmxlfzl", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 1dbb94f1eb04..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomain; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; -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 L3IsolationDomainsGetByResourceGroupWithResponseMockTests { - @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\":{\"networkFabricId\":\"vdjlww\",\"configurationState\":\"Accepted\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"MAT\",\"redistributeConnectedSubnets\":\"True\",\"redistributeStaticRoutes\":\"True\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"oyvfwgkz\"},{\"prefix\":\"h\"}],\"ipv6Routes\":[{\"prefix\":\"xjkckwbqwjyfmmkw\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"ooyzhob\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"uepaco\",\"exportIpv6RoutePolicyId\":\"ohex\"}},\"annotation\":\"gukfkbsycbdymb\"},\"location\":\"eenlqtqyvlfb\",\"tags\":{\"sqephtoshqtua\":\"qdvfj\",\"xaeypyqoizf\":\"jwgujrc\",\"omiflrvfeowc\":\"asyddqbwscjwyy\",\"bvau\":\"shwfrhhas\"},\"id\":\"nwwumkbpg\",\"name\":\"ilbwtpwbjlpfwuq\",\"type\":\"rpdgitenyuksli\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - L3IsolationDomain response = - manager - .l3IsolationDomains() - .getByResourceGroupWithResponse("nat", "vgcm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("eenlqtqyvlfb", response.location()); - Assertions.assertEquals("qdvfj", response.tags().get("sqephtoshqtua")); - Assertions.assertEquals("vdjlww", response.networkFabricId()); - Assertions.assertEquals(RedistributeConnectedSubnets.TRUE, response.redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.TRUE, response.redistributeStaticRoutes()); - Assertions.assertEquals("oyvfwgkz", response.aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals("xjkckwbqwjyfmmkw", response.aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("ooyzhob", response.connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "uepaco", response.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("ohex", response.connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("gukfkbsycbdymb", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListByResourceGroupMockTests.java deleted file mode 100644 index 7cd0c94b5a2d..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListByResourceGroupMockTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomain; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; -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 L3IsolationDomainsListByResourceGroupMockTests { - @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\":{\"networkFabricId\":\"amrplanch\",\"configurationState\":\"Provisioned\",\"provisioningState\":\"Failed\",\"administrativeState\":\"RMA\",\"redistributeConnectedSubnets\":\"True\",\"redistributeStaticRoutes\":\"False\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"jzbjwvtuekbbypqs\"},{\"prefix\":\"psbeqieiux\"}],\"ipv6Routes\":[{\"prefix\":\"wndalnjjh\"},{\"prefix\":\"gkjjpcpi\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"yxvtajfjatoid\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"urdgc\",\"exportIpv6RoutePolicyId\":\"anaqvengnp\"}},\"annotation\":\"lrnanbrp\"},\"location\":\"cuxfbageg\",\"tags\":{\"xmdboefnhx\":\"ltckiwxggfagi\",\"qeinv\":\"ah\",\"mokrqdbsgkqyjko\":\"so\",\"dbrbmc\":\"ypcjxhyzzlocjhzp\"},\"id\":\"bofprsmivapesb\",\"name\":\"zllejrwwsfvtghq\",\"type\":\"tmblmf\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.l3IsolationDomains().listByResourceGroup("mpnxg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cuxfbageg", response.iterator().next().location()); - Assertions.assertEquals("ltckiwxggfagi", response.iterator().next().tags().get("xmdboefnhx")); - Assertions.assertEquals("amrplanch", response.iterator().next().networkFabricId()); - Assertions - .assertEquals(RedistributeConnectedSubnets.TRUE, response.iterator().next().redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, response.iterator().next().redistributeStaticRoutes()); - Assertions - .assertEquals( - "jzbjwvtuekbbypqs", - response.iterator().next().aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals( - "wndalnjjh", response.iterator().next().aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions - .assertEquals( - "yxvtajfjatoid", response.iterator().next().connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "urdgc", - response.iterator().next().connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals( - "anaqvengnp", - response.iterator().next().connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("lrnanbrp", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListMockTests.java deleted file mode 100644 index 29faebc2d7bb..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListMockTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomain; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; -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 L3IsolationDomainsListMockTests { - @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\":{\"networkFabricId\":\"leuo\",\"configurationState\":\"Rejected\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"MAT\",\"redistributeConnectedSubnets\":\"False\",\"redistributeStaticRoutes\":\"True\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"jtoudode\"},{\"prefix\":\"wmv\"},{\"prefix\":\"sr\"},{\"prefix\":\"ciexu\"}],\"ipv6Routes\":[{\"prefix\":\"tgtg\"},{\"prefix\":\"bymmcgsksc\"},{\"prefix\":\"sxehaxi\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"jxolknshgwa\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"bhmbglmnlbnat\",\"exportIpv6RoutePolicyId\":\"chzzcdkxort\"}},\"annotation\":\"zvhbujk\"},\"location\":\"ophqwojdzccqtw\",\"tags\":{\"exr\":\"fbsdiicdzfb\"},\"id\":\"nhhmfsnqpv\",\"name\":\"tsh\",\"type\":\"wvrsksdz\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.l3IsolationDomains().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ophqwojdzccqtw", response.iterator().next().location()); - Assertions.assertEquals("fbsdiicdzfb", response.iterator().next().tags().get("exr")); - Assertions.assertEquals("leuo", response.iterator().next().networkFabricId()); - Assertions - .assertEquals( - RedistributeConnectedSubnets.FALSE, response.iterator().next().redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.TRUE, response.iterator().next().redistributeStaticRoutes()); - Assertions - .assertEquals( - "jtoudode", response.iterator().next().aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals( - "tgtg", response.iterator().next().aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions - .assertEquals("jxolknshgwa", response.iterator().next().connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "bhmbglmnlbnat", - response.iterator().next().connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals( - "chzzcdkxort", - response.iterator().next().connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("zvhbujk", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListResultTests.java deleted file mode 100644 index 69ee6fa2c679..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListResultTests.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainInner; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRoute; -import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnetRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3ExportRoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainsListResult; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; -import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class L3IsolationDomainsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3IsolationDomainsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"networkFabricId\":\"eojhtollhsvi\",\"configurationState\":\"Deprovisioning\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"Disabled\",\"redistributeConnectedSubnets\":\"False\",\"redistributeStaticRoutes\":\"False\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"yoan\"},{\"prefix\":\"bcswqagyw\"},{\"prefix\":\"t\"},{\"prefix\":\"igvjrktp\"}],\"ipv6Routes\":[{\"prefix\":\"ukyawoh\"},{\"prefix\":\"mwhqnucsklh\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"sjt\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"bninjgazlsvbzfc\",\"exportIpv6RoutePolicyId\":\"o\"}},\"annotation\":\"dwjcciklhs\"},\"location\":\"krdre\",\"tags\":{\"vdlhydwbdbfgr\":\"lriyehqbe\"},\"id\":\"punytjl\",\"name\":\"esmmpathubtahd\",\"type\":\"an\"},{\"properties\":{\"networkFabricId\":\"iwllbvgwzsffted\",\"configurationState\":\"Deprovisioning\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"Enabled\",\"redistributeConnectedSubnets\":\"False\",\"redistributeStaticRoutes\":\"False\",\"aggregateRouteConfiguration\":{\"ipv4Routes\":[{\"prefix\":\"ogfkbebauzlqb\"},{\"prefix\":\"xxw\"},{\"prefix\":\"f\"},{\"prefix\":\"njzudr\"}],\"ipv6Routes\":[{\"prefix\":\"kgmeb\"}]},\"connectedSubnetRoutePolicy\":{\"exportRoutePolicyId\":\"hczzqrhm\",\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"be\",\"exportIpv6RoutePolicyId\":\"gis\"}},\"annotation\":\"wnykdidjchlrmpw\"},\"location\":\"ofldseacdhz\",\"tags\":{\"ewhfjsrwqrxetf\":\"brfgdrwji\",\"r\":\"cwv\",\"ax\":\"dqntycnawthv\"},\"id\":\"nuyeamcmhud\",\"name\":\"jecehokwc\",\"type\":\"qtwloes\"}],\"nextLink\":\"ggvrbnyrukoilaci\"}") - .toObject(L3IsolationDomainsListResult.class); - Assertions.assertEquals("krdre", model.value().get(0).location()); - Assertions.assertEquals("lriyehqbe", model.value().get(0).tags().get("vdlhydwbdbfgr")); - Assertions.assertEquals("eojhtollhsvi", model.value().get(0).networkFabricId()); - Assertions - .assertEquals(RedistributeConnectedSubnets.FALSE, model.value().get(0).redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, model.value().get(0).redistributeStaticRoutes()); - Assertions - .assertEquals("yoan", model.value().get(0).aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals("ukyawoh", model.value().get(0).aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("sjt", model.value().get(0).connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "bninjgazlsvbzfc", - model.value().get(0).connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals( - "o", model.value().get(0).connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("dwjcciklhs", model.value().get(0).annotation()); - Assertions.assertEquals("ggvrbnyrukoilaci", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3IsolationDomainsListResult model = - new L3IsolationDomainsListResult() - .withValue( - Arrays - .asList( - new L3IsolationDomainInner() - .withLocation("krdre") - .withTags(mapOf("vdlhydwbdbfgr", "lriyehqbe")) - .withNetworkFabricId("eojhtollhsvi") - .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.FALSE) - .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE) - .withAggregateRouteConfiguration( - new AggregateRouteConfiguration() - .withIpv4Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("yoan"), - new AggregateRoute().withPrefix("bcswqagyw"), - new AggregateRoute().withPrefix("t"), - new AggregateRoute().withPrefix("igvjrktp"))) - .withIpv6Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("ukyawoh"), - new AggregateRoute().withPrefix("mwhqnucsklh")))) - .withConnectedSubnetRoutePolicy( - new ConnectedSubnetRoutePolicy() - .withExportRoutePolicyId("sjt") - .withExportRoutePolicy( - new L3ExportRoutePolicy() - .withExportIpv4RoutePolicyId("bninjgazlsvbzfc") - .withExportIpv6RoutePolicyId("o"))) - .withAnnotation("dwjcciklhs"), - new L3IsolationDomainInner() - .withLocation("ofldseacdhz") - .withTags(mapOf("ewhfjsrwqrxetf", "brfgdrwji", "r", "cwv", "ax", "dqntycnawthv")) - .withNetworkFabricId("iwllbvgwzsffted") - .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.FALSE) - .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE) - .withAggregateRouteConfiguration( - new AggregateRouteConfiguration() - .withIpv4Routes( - Arrays - .asList( - new AggregateRoute().withPrefix("ogfkbebauzlqb"), - new AggregateRoute().withPrefix("xxw"), - new AggregateRoute().withPrefix("f"), - new AggregateRoute().withPrefix("njzudr"))) - .withIpv6Routes(Arrays.asList(new AggregateRoute().withPrefix("kgmeb")))) - .withConnectedSubnetRoutePolicy( - new ConnectedSubnetRoutePolicy() - .withExportRoutePolicyId("hczzqrhm") - .withExportRoutePolicy( - new L3ExportRoutePolicy() - .withExportIpv4RoutePolicyId("be") - .withExportIpv6RoutePolicyId("gis"))) - .withAnnotation("wnykdidjchlrmpw"))) - .withNextLink("ggvrbnyrukoilaci"); - model = BinaryData.fromObject(model).toObject(L3IsolationDomainsListResult.class); - Assertions.assertEquals("krdre", model.value().get(0).location()); - Assertions.assertEquals("lriyehqbe", model.value().get(0).tags().get("vdlhydwbdbfgr")); - Assertions.assertEquals("eojhtollhsvi", model.value().get(0).networkFabricId()); - Assertions - .assertEquals(RedistributeConnectedSubnets.FALSE, model.value().get(0).redistributeConnectedSubnets()); - Assertions.assertEquals(RedistributeStaticRoutes.FALSE, model.value().get(0).redistributeStaticRoutes()); - Assertions - .assertEquals("yoan", model.value().get(0).aggregateRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals("ukyawoh", model.value().get(0).aggregateRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("sjt", model.value().get(0).connectedSubnetRoutePolicy().exportRoutePolicyId()); - Assertions - .assertEquals( - "bninjgazlsvbzfc", - model.value().get(0).connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals( - "o", model.value().get(0).connectedSubnetRoutePolicy().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("dwjcciklhs", model.value().get(0).annotation()); - Assertions.assertEquals("ggvrbnyrukoilaci", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateAdministrativeStateMockTests.java deleted file mode 100644 index 6c9f6ccb9247..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -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 L3IsolationDomainsUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"configurationState\":\"Failed\",\"successfulDevices\":[\"ndzktwomlpczlqb\",\"o\",\"zgmrolhsfdd\",\"hxvevwxm\"],\"failedDevices\":[\"axadxgnpyhtu\",\"alpqildnaokexznp\"]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForDeviceUpdate response = - manager - .l3IsolationDomains() - .updateAdministrativeState( - "hwtsyp", - "wfbwoet", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("wxhflgdun", "aypxsazbxs", "xyksznfstmp")) - .withState(EnableDisableState.ENABLE), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ndzktwomlpczlqb", response.successfulDevices().get(0)); - Assertions.assertEquals("axadxgnpyhtu", response.failedDevices().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsValidateConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsValidateConfigurationMockTests.java deleted file mode 100644 index bff83b2151da..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsValidateConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationResponse; -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 L3IsolationDomainsValidateConfigurationMockTests { - @Test - public void testValidateConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Succeeded\",\"url\":\"rmzoujfgt\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateConfigurationResponse response = - manager.l3IsolationDomains().validateConfiguration("tkqjarlazb", "gtz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("rmzoujfgt", response.url()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3OptionAPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3OptionAPropertiesTests.java deleted file mode 100644 index 63801432594d..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3OptionAPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.L3OptionAProperties; -import org.junit.jupiter.api.Assertions; - -public final class L3OptionAPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3OptionAProperties model = - BinaryData - .fromString( - "{\"mtu\":707174583,\"vlanId\":1454825474,\"fabricASN\":5238881792700138972,\"peerASN\":8845842496565245250,\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":1894816551,\"multiplier\":935663672},\"ingressAclId\":\"nasd\",\"egressAclId\":\"enz\"}") - .toObject(L3OptionAProperties.class); - Assertions.assertEquals(707174583, model.mtu()); - Assertions.assertEquals(1454825474, model.vlanId()); - Assertions.assertEquals(8845842496565245250L, model.peerAsn()); - Assertions.assertEquals(1894816551, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(935663672, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("nasd", model.ingressAclId()); - Assertions.assertEquals("enz", model.egressAclId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3OptionAProperties model = - new L3OptionAProperties() - .withMtu(707174583) - .withVlanId(1454825474) - .withPeerAsn(8845842496565245250L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1894816551).withMultiplier(935663672)) - .withIngressAclId("nasd") - .withEgressAclId("enz"); - model = BinaryData.fromObject(model).toObject(L3OptionAProperties.class); - Assertions.assertEquals(707174583, model.mtu()); - Assertions.assertEquals(1454825474, model.vlanId()); - Assertions.assertEquals(8845842496565245250L, model.peerAsn()); - Assertions.assertEquals(1894816551, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(935663672, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("nasd", model.ingressAclId()); - Assertions.assertEquals("enz", model.egressAclId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3OptionBPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3OptionBPropertiesTests.java deleted file mode 100644 index 9750cfbd67da..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/L3OptionBPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.L3OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class L3OptionBPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - L3OptionBProperties model = - BinaryData - .fromString( - "{\"importRouteTargets\":[\"ysemtmesrfsvpin\"],\"exportRouteTargets\":[\"atqtdiswxspvckoj\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"gspftesu\",\"zpvpvdyly\"],\"importIpv6RouteTargets\":[\"vqseus\",\"fjb\",\"xzfxn\",\"mlbmuoswkjm\"],\"exportIpv4RouteTargets\":[\"dcyyyzlwhb\",\"zjnufzrfg\",\"dq\",\"nn\"],\"exportIpv6RouteTargets\":[\"tftedz\",\"ubjtvgjsxmtyjjv\"]}}") - .toObject(L3OptionBProperties.class); - Assertions.assertEquals("ysemtmesrfsvpin", model.importRouteTargets().get(0)); - Assertions.assertEquals("atqtdiswxspvckoj", model.exportRouteTargets().get(0)); - Assertions.assertEquals("gspftesu", model.routeTargets().importIpv4RouteTargets().get(0)); - Assertions.assertEquals("vqseus", model.routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("dcyyyzlwhb", model.routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("tftedz", model.routeTargets().exportIpv6RouteTargets().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - L3OptionBProperties model = - new L3OptionBProperties() - .withImportRouteTargets(Arrays.asList("ysemtmesrfsvpin")) - .withExportRouteTargets(Arrays.asList("atqtdiswxspvckoj")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("gspftesu", "zpvpvdyly")) - .withImportIpv6RouteTargets(Arrays.asList("vqseus", "fjb", "xzfxn", "mlbmuoswkjm")) - .withExportIpv4RouteTargets(Arrays.asList("dcyyyzlwhb", "zjnufzrfg", "dq", "nn")) - .withExportIpv6RouteTargets(Arrays.asList("tftedz", "ubjtvgjsxmtyjjv"))); - model = BinaryData.fromObject(model).toObject(L3OptionBProperties.class); - Assertions.assertEquals("ysemtmesrfsvpin", model.importRouteTargets().get(0)); - Assertions.assertEquals("atqtdiswxspvckoj", model.exportRouteTargets().get(0)); - Assertions.assertEquals("gspftesu", model.routeTargets().importIpv4RouteTargets().get(0)); - Assertions.assertEquals("vqseus", model.routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("dcyyyzlwhb", model.routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("tftedz", model.routeTargets().exportIpv6RouteTargets().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/Layer2ConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/Layer2ConfigurationTests.java deleted file mode 100644 index 0c3010404aba..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/Layer2ConfigurationTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.Layer2Configuration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class Layer2ConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Layer2Configuration model = - BinaryData - .fromString("{\"mtu\":1588341225,\"interfaces\":[\"qebuuxjxhfxfjwp\"]}") - .toObject(Layer2Configuration.class); - Assertions.assertEquals(1588341225, model.mtu()); - Assertions.assertEquals("qebuuxjxhfxfjwp", model.interfaces().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Layer2Configuration model = - new Layer2Configuration().withMtu(1588341225).withInterfaces(Arrays.asList("qebuuxjxhfxfjwp")); - model = BinaryData.fromObject(model).toObject(Layer2Configuration.class); - Assertions.assertEquals(1588341225, model.mtu()); - Assertions.assertEquals("qebuuxjxhfxfjwp", model.interfaces().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/Layer3IpPrefixPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/Layer3IpPrefixPropertiesTests.java deleted file mode 100644 index 53ffbc72ed08..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/Layer3IpPrefixPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.Layer3IpPrefixProperties; -import org.junit.jupiter.api.Assertions; - -public final class Layer3IpPrefixPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Layer3IpPrefixProperties model = - BinaryData - .fromString( - "{\"primaryIpv4Prefix\":\"ypanhxmpdxxzet\",\"primaryIpv6Prefix\":\"zjwotnxlkfhglh\",\"secondaryIpv4Prefix\":\"oxqwecrsnhpcse\",\"secondaryIpv6Prefix\":\"xovppqibukklvzr\"}") - .toObject(Layer3IpPrefixProperties.class); - Assertions.assertEquals("ypanhxmpdxxzet", model.primaryIpv4Prefix()); - Assertions.assertEquals("zjwotnxlkfhglh", model.primaryIpv6Prefix()); - Assertions.assertEquals("oxqwecrsnhpcse", model.secondaryIpv4Prefix()); - Assertions.assertEquals("xovppqibukklvzr", model.secondaryIpv6Prefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Layer3IpPrefixProperties model = - new Layer3IpPrefixProperties() - .withPrimaryIpv4Prefix("ypanhxmpdxxzet") - .withPrimaryIpv6Prefix("zjwotnxlkfhglh") - .withSecondaryIpv4Prefix("oxqwecrsnhpcse") - .withSecondaryIpv6Prefix("xovppqibukklvzr"); - model = BinaryData.fromObject(model).toObject(Layer3IpPrefixProperties.class); - Assertions.assertEquals("ypanhxmpdxxzet", model.primaryIpv4Prefix()); - Assertions.assertEquals("zjwotnxlkfhglh", model.primaryIpv6Prefix()); - Assertions.assertEquals("oxqwecrsnhpcse", model.secondaryIpv4Prefix()); - Assertions.assertEquals("xovppqibukklvzr", model.secondaryIpv6Prefix()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ManagedResourceGroupConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ManagedResourceGroupConfigurationTests.java deleted file mode 100644 index c77086e7eae7..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ManagedResourceGroupConfigurationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ManagedResourceGroupConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class ManagedResourceGroupConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedResourceGroupConfiguration model = - BinaryData - .fromString("{\"name\":\"wafbjzmp\",\"location\":\"guyfazbkocbygvt\"}") - .toObject(ManagedResourceGroupConfiguration.class); - Assertions.assertEquals("wafbjzmp", model.name()); - Assertions.assertEquals("guyfazbkocbygvt", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedResourceGroupConfiguration model = - new ManagedResourceGroupConfiguration().withName("wafbjzmp").withLocation("guyfazbkocbygvt"); - model = BinaryData.fromObject(model).toObject(ManagedResourceGroupConfiguration.class); - Assertions.assertEquals("wafbjzmp", model.name()); - Assertions.assertEquals("guyfazbkocbygvt", model.location()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ManagementNetworkConfigurationPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ManagementNetworkConfigurationPatchablePropertiesTests.java deleted file mode 100644 index c5735686a4d1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ManagementNetworkConfigurationPatchablePropertiesTests.java +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ManagementNetworkConfigurationPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationPatchablePropertiesOptionAProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ManagementNetworkConfigurationPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagementNetworkConfigurationPatchableProperties model = - BinaryData - .fromString( - "{\"infrastructureVpnConfiguration\":{\"networkToNetworkInterconnectId\":\"xiy\",\"peeringOption\":\"OptionB\",\"optionBProperties\":{\"importRouteTargets\":[\"zkbnzxbypfqp\",\"aix\",\"r\"],\"exportRouteTargets\":[\"kderf\",\"swqi\",\"wepwoggg\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"xhtfmcqbsudzpgch\",\"pgfqum\"],\"importIpv6RouteTargets\":[\"xhzghgodkynr\",\"eqavfdbdfmmxj\"],\"exportIpv4RouteTargets\":[\"juopjyyqm\",\"wlhvcwloqdejk\"],\"exportIpv6RouteTargets\":[\"xrwzo\"]}},\"optionAProperties\":{\"primaryIpv4Prefix\":\"msxgamtdtkwpp\",\"primaryIpv6Prefix\":\"uzdprmim\",\"secondaryIpv4Prefix\":\"j\",\"secondaryIpv6Prefix\":\"oqfx\",\"mtu\":611774756,\"vlanId\":340762854,\"peerASN\":8642884475129275171,\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":1174463151,\"multiplier\":1493397500}}},\"workloadVpnConfiguration\":{\"networkToNetworkInterconnectId\":\"amfmxtllfl\",\"peeringOption\":\"OptionA\",\"optionBProperties\":{\"importRouteTargets\":[\"rrfijhgg\",\"bqbgamklilirwdv\",\"fhsdpzouhkt\",\"rxqwqnjxrd\"],\"exportRouteTargets\":[\"t\",\"llygta\",\"czcxdfw\",\"a\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"lxrljphraspifl\"],\"importIpv6RouteTargets\":[\"ixlmdbgic\"],\"exportIpv4RouteTargets\":[\"gs\",\"drjuqbp\",\"tokljmtznpaxw\"],\"exportIpv6RouteTargets\":[\"yyqiprcltungbsol\",\"ckmiig\",\"b\",\"uck\"]}},\"optionAProperties\":{\"primaryIpv4Prefix\":\"s\",\"primaryIpv6Prefix\":\"w\",\"secondaryIpv4Prefix\":\"iqqcq\",\"secondaryIpv6Prefix\":\"clsmal\",\"mtu\":1664987985,\"vlanId\":1369091717,\"peerASN\":6072079351329651797,\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":1895252476,\"multiplier\":1687559611}}}}") - .toObject(ManagementNetworkConfigurationPatchableProperties.class); - Assertions.assertEquals("xiy", model.infrastructureVpnConfiguration().networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONB, model.infrastructureVpnConfiguration().peeringOption()); - Assertions - .assertEquals( - "zkbnzxbypfqp", model.infrastructureVpnConfiguration().optionBProperties().importRouteTargets().get(0)); - Assertions - .assertEquals( - "kderf", model.infrastructureVpnConfiguration().optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "xhtfmcqbsudzpgch", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .importIpv4RouteTargets() - .get(0)); - Assertions - .assertEquals( - "xhzghgodkynr", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .importIpv6RouteTargets() - .get(0)); - Assertions - .assertEquals( - "juopjyyqm", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .exportIpv4RouteTargets() - .get(0)); - Assertions - .assertEquals( - "xrwzo", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .exportIpv6RouteTargets() - .get(0)); - Assertions.assertEquals(611774756, model.infrastructureVpnConfiguration().optionAProperties().mtu()); - Assertions.assertEquals(340762854, model.infrastructureVpnConfiguration().optionAProperties().vlanId()); - Assertions - .assertEquals(8642884475129275171L, model.infrastructureVpnConfiguration().optionAProperties().peerAsn()); - Assertions - .assertEquals( - 1174463151, - model.infrastructureVpnConfiguration().optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 1493397500, model.infrastructureVpnConfiguration().optionAProperties().bfdConfiguration().multiplier()); - Assertions - .assertEquals( - "msxgamtdtkwpp", model.infrastructureVpnConfiguration().optionAProperties().primaryIpv4Prefix()); - Assertions - .assertEquals("uzdprmim", model.infrastructureVpnConfiguration().optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("j", model.infrastructureVpnConfiguration().optionAProperties().secondaryIpv4Prefix()); - Assertions - .assertEquals("oqfx", model.infrastructureVpnConfiguration().optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals("amfmxtllfl", model.workloadVpnConfiguration().networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONA, model.workloadVpnConfiguration().peeringOption()); - Assertions - .assertEquals("rrfijhgg", model.workloadVpnConfiguration().optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("t", model.workloadVpnConfiguration().optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "lxrljphraspifl", - model.workloadVpnConfiguration().optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "ixlmdbgic", - model.workloadVpnConfiguration().optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions - .assertEquals( - "gs", - model.workloadVpnConfiguration().optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "yyqiprcltungbsol", - model.workloadVpnConfiguration().optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals(1664987985, model.workloadVpnConfiguration().optionAProperties().mtu()); - Assertions.assertEquals(1369091717, model.workloadVpnConfiguration().optionAProperties().vlanId()); - Assertions.assertEquals(6072079351329651797L, model.workloadVpnConfiguration().optionAProperties().peerAsn()); - Assertions - .assertEquals( - 1895252476, - model.workloadVpnConfiguration().optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 1687559611, model.workloadVpnConfiguration().optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("s", model.workloadVpnConfiguration().optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("w", model.workloadVpnConfiguration().optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("iqqcq", model.workloadVpnConfiguration().optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("clsmal", model.workloadVpnConfiguration().optionAProperties().secondaryIpv6Prefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagementNetworkConfigurationPatchableProperties model = - new ManagementNetworkConfigurationPatchableProperties() - .withInfrastructureVpnConfiguration( - new VpnConfigurationPatchableProperties() - .withNetworkToNetworkInterconnectId("xiy") - .withPeeringOption(PeeringOption.OPTIONB) - .withOptionBProperties( - new OptionBProperties() - .withImportRouteTargets(Arrays.asList("zkbnzxbypfqp", "aix", "r")) - .withExportRouteTargets(Arrays.asList("kderf", "swqi", "wepwoggg")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("xhtfmcqbsudzpgch", "pgfqum")) - .withImportIpv6RouteTargets(Arrays.asList("xhzghgodkynr", "eqavfdbdfmmxj")) - .withExportIpv4RouteTargets(Arrays.asList("juopjyyqm", "wlhvcwloqdejk")) - .withExportIpv6RouteTargets(Arrays.asList("xrwzo")))) - .withOptionAProperties( - new VpnConfigurationPatchablePropertiesOptionAProperties() - .withMtu(611774756) - .withVlanId(340762854) - .withPeerAsn(8642884475129275171L) - .withBfdConfiguration( - new BfdConfiguration() - .withIntervalInMilliSeconds(1174463151) - .withMultiplier(1493397500)) - .withPrimaryIpv4Prefix("msxgamtdtkwpp") - .withPrimaryIpv6Prefix("uzdprmim") - .withSecondaryIpv4Prefix("j") - .withSecondaryIpv6Prefix("oqfx"))) - .withWorkloadVpnConfiguration( - new VpnConfigurationPatchableProperties() - .withNetworkToNetworkInterconnectId("amfmxtllfl") - .withPeeringOption(PeeringOption.OPTIONA) - .withOptionBProperties( - new OptionBProperties() - .withImportRouteTargets( - Arrays.asList("rrfijhgg", "bqbgamklilirwdv", "fhsdpzouhkt", "rxqwqnjxrd")) - .withExportRouteTargets(Arrays.asList("t", "llygta", "czcxdfw", "a")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("lxrljphraspifl")) - .withImportIpv6RouteTargets(Arrays.asList("ixlmdbgic")) - .withExportIpv4RouteTargets(Arrays.asList("gs", "drjuqbp", "tokljmtznpaxw")) - .withExportIpv6RouteTargets( - Arrays.asList("yyqiprcltungbsol", "ckmiig", "b", "uck")))) - .withOptionAProperties( - new VpnConfigurationPatchablePropertiesOptionAProperties() - .withMtu(1664987985) - .withVlanId(1369091717) - .withPeerAsn(6072079351329651797L) - .withBfdConfiguration( - new BfdConfiguration() - .withIntervalInMilliSeconds(1895252476) - .withMultiplier(1687559611)) - .withPrimaryIpv4Prefix("s") - .withPrimaryIpv6Prefix("w") - .withSecondaryIpv4Prefix("iqqcq") - .withSecondaryIpv6Prefix("clsmal"))); - model = BinaryData.fromObject(model).toObject(ManagementNetworkConfigurationPatchableProperties.class); - Assertions.assertEquals("xiy", model.infrastructureVpnConfiguration().networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONB, model.infrastructureVpnConfiguration().peeringOption()); - Assertions - .assertEquals( - "zkbnzxbypfqp", model.infrastructureVpnConfiguration().optionBProperties().importRouteTargets().get(0)); - Assertions - .assertEquals( - "kderf", model.infrastructureVpnConfiguration().optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "xhtfmcqbsudzpgch", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .importIpv4RouteTargets() - .get(0)); - Assertions - .assertEquals( - "xhzghgodkynr", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .importIpv6RouteTargets() - .get(0)); - Assertions - .assertEquals( - "juopjyyqm", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .exportIpv4RouteTargets() - .get(0)); - Assertions - .assertEquals( - "xrwzo", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .exportIpv6RouteTargets() - .get(0)); - Assertions.assertEquals(611774756, model.infrastructureVpnConfiguration().optionAProperties().mtu()); - Assertions.assertEquals(340762854, model.infrastructureVpnConfiguration().optionAProperties().vlanId()); - Assertions - .assertEquals(8642884475129275171L, model.infrastructureVpnConfiguration().optionAProperties().peerAsn()); - Assertions - .assertEquals( - 1174463151, - model.infrastructureVpnConfiguration().optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 1493397500, model.infrastructureVpnConfiguration().optionAProperties().bfdConfiguration().multiplier()); - Assertions - .assertEquals( - "msxgamtdtkwpp", model.infrastructureVpnConfiguration().optionAProperties().primaryIpv4Prefix()); - Assertions - .assertEquals("uzdprmim", model.infrastructureVpnConfiguration().optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("j", model.infrastructureVpnConfiguration().optionAProperties().secondaryIpv4Prefix()); - Assertions - .assertEquals("oqfx", model.infrastructureVpnConfiguration().optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals("amfmxtllfl", model.workloadVpnConfiguration().networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONA, model.workloadVpnConfiguration().peeringOption()); - Assertions - .assertEquals("rrfijhgg", model.workloadVpnConfiguration().optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("t", model.workloadVpnConfiguration().optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "lxrljphraspifl", - model.workloadVpnConfiguration().optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "ixlmdbgic", - model.workloadVpnConfiguration().optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions - .assertEquals( - "gs", - model.workloadVpnConfiguration().optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "yyqiprcltungbsol", - model.workloadVpnConfiguration().optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals(1664987985, model.workloadVpnConfiguration().optionAProperties().mtu()); - Assertions.assertEquals(1369091717, model.workloadVpnConfiguration().optionAProperties().vlanId()); - Assertions.assertEquals(6072079351329651797L, model.workloadVpnConfiguration().optionAProperties().peerAsn()); - Assertions - .assertEquals( - 1895252476, - model.workloadVpnConfiguration().optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 1687559611, model.workloadVpnConfiguration().optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("s", model.workloadVpnConfiguration().optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("w", model.workloadVpnConfiguration().optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("iqqcq", model.workloadVpnConfiguration().optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("clsmal", model.workloadVpnConfiguration().optionAProperties().secondaryIpv6Prefix()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ManagementNetworkConfigurationPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ManagementNetworkConfigurationPropertiesTests.java deleted file mode 100644 index a572cfab0789..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ManagementNetworkConfigurationPropertiesTests.java +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ManagementNetworkConfigurationProperties; -import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationPropertiesOptionAProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ManagementNetworkConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagementNetworkConfigurationProperties model = - BinaryData - .fromString( - "{\"infrastructureVpnConfiguration\":{\"networkToNetworkInterconnectId\":\"mkwjfbotl\",\"administrativeState\":\"Disabled\",\"peeringOption\":\"OptionA\",\"optionBProperties\":{\"importRouteTargets\":[\"ursuivuxcjk\"],\"exportRouteTargets\":[\"w\",\"z\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"rizfwihvaang\",\"tnhjrfdmfd\",\"bbaex\"],\"importIpv6RouteTargets\":[\"wtgdfkkaui\",\"vmuafmc\",\"fedyuep\",\"vpltidajjvy\"],\"exportIpv4RouteTargets\":[\"cfkumcfjxo\",\"yelsyasvfnk\",\"myg\",\"jekrknfd\"],\"exportIpv6RouteTargets\":[\"jqy\",\"kgtxkrdtulcrcj\",\"k\",\"otcsu\"]}},\"optionAProperties\":{\"primaryIpv4Prefix\":\"oonsvobchkxfp\",\"primaryIpv6Prefix\":\"dyslbklglmnn\",\"secondaryIpv4Prefix\":\"wayqshwyqxrid\",\"secondaryIpv6Prefix\":\"bsaqjm\",\"mtu\":1855919116,\"vlanId\":761443572,\"peerASN\":1689956278909975813,\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":1377813110,\"multiplier\":1139650083}}},\"workloadVpnConfiguration\":{\"networkToNetworkInterconnectId\":\"iizevjykofvez\",\"administrativeState\":\"Enabled\",\"peeringOption\":\"OptionB\",\"optionBProperties\":{\"importRouteTargets\":[\"wqlepjj\"],\"exportRouteTargets\":[\"as\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"ntogffjwajnrt\"],\"importIpv6RouteTargets\":[\"aqkifmxawostfz\",\"nhrkmjqncfvdsc\",\"hemvwfnqqwypvnd\",\"wbgodtggrssg\"],\"exportIpv4RouteTargets\":[\"kainjmuymvecvzt\"],\"exportIpv6RouteTargets\":[\"gmusaictdscnkzzo\",\"nrddclzeqoz\",\"ehlbzqixbnjrqvzy\"]}},\"optionAProperties\":{\"primaryIpv4Prefix\":\"ozonynp\",\"primaryIpv6Prefix\":\"eudpab\",\"secondaryIpv4Prefix\":\"euwzosgyjxvc\",\"secondaryIpv6Prefix\":\"sormrex\",\"mtu\":1882838506,\"vlanId\":158915629,\"peerASN\":8483386639744134100,\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":472275599,\"multiplier\":2139027754}}}}") - .toObject(ManagementNetworkConfigurationProperties.class); - Assertions.assertEquals("mkwjfbotl", model.infrastructureVpnConfiguration().networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONA, model.infrastructureVpnConfiguration().peeringOption()); - Assertions - .assertEquals( - "ursuivuxcjk", model.infrastructureVpnConfiguration().optionBProperties().importRouteTargets().get(0)); - Assertions - .assertEquals("w", model.infrastructureVpnConfiguration().optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "rizfwihvaang", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .importIpv4RouteTargets() - .get(0)); - Assertions - .assertEquals( - "wtgdfkkaui", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .importIpv6RouteTargets() - .get(0)); - Assertions - .assertEquals( - "cfkumcfjxo", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .exportIpv4RouteTargets() - .get(0)); - Assertions - .assertEquals( - "jqy", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .exportIpv6RouteTargets() - .get(0)); - Assertions.assertEquals(1855919116, model.infrastructureVpnConfiguration().optionAProperties().mtu()); - Assertions.assertEquals(761443572, model.infrastructureVpnConfiguration().optionAProperties().vlanId()); - Assertions - .assertEquals(1689956278909975813L, model.infrastructureVpnConfiguration().optionAProperties().peerAsn()); - Assertions - .assertEquals( - 1377813110, - model.infrastructureVpnConfiguration().optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 1139650083, model.infrastructureVpnConfiguration().optionAProperties().bfdConfiguration().multiplier()); - Assertions - .assertEquals( - "oonsvobchkxfp", model.infrastructureVpnConfiguration().optionAProperties().primaryIpv4Prefix()); - Assertions - .assertEquals( - "dyslbklglmnn", model.infrastructureVpnConfiguration().optionAProperties().primaryIpv6Prefix()); - Assertions - .assertEquals( - "wayqshwyqxrid", model.infrastructureVpnConfiguration().optionAProperties().secondaryIpv4Prefix()); - Assertions - .assertEquals("bsaqjm", model.infrastructureVpnConfiguration().optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals("iizevjykofvez", model.workloadVpnConfiguration().networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONB, model.workloadVpnConfiguration().peeringOption()); - Assertions - .assertEquals("wqlepjj", model.workloadVpnConfiguration().optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("as", model.workloadVpnConfiguration().optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "ntogffjwajnrt", - model.workloadVpnConfiguration().optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "aqkifmxawostfz", - model.workloadVpnConfiguration().optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions - .assertEquals( - "kainjmuymvecvzt", - model.workloadVpnConfiguration().optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "gmusaictdscnkzzo", - model.workloadVpnConfiguration().optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals(1882838506, model.workloadVpnConfiguration().optionAProperties().mtu()); - Assertions.assertEquals(158915629, model.workloadVpnConfiguration().optionAProperties().vlanId()); - Assertions.assertEquals(8483386639744134100L, model.workloadVpnConfiguration().optionAProperties().peerAsn()); - Assertions - .assertEquals( - 472275599, - model.workloadVpnConfiguration().optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 2139027754, model.workloadVpnConfiguration().optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("ozonynp", model.workloadVpnConfiguration().optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("eudpab", model.workloadVpnConfiguration().optionAProperties().primaryIpv6Prefix()); - Assertions - .assertEquals("euwzosgyjxvc", model.workloadVpnConfiguration().optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("sormrex", model.workloadVpnConfiguration().optionAProperties().secondaryIpv6Prefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagementNetworkConfigurationProperties model = - new ManagementNetworkConfigurationProperties() - .withInfrastructureVpnConfiguration( - new VpnConfigurationProperties() - .withNetworkToNetworkInterconnectId("mkwjfbotl") - .withPeeringOption(PeeringOption.OPTIONA) - .withOptionBProperties( - new OptionBProperties() - .withImportRouteTargets(Arrays.asList("ursuivuxcjk")) - .withExportRouteTargets(Arrays.asList("w", "z")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets( - Arrays.asList("rizfwihvaang", "tnhjrfdmfd", "bbaex")) - .withImportIpv6RouteTargets( - Arrays.asList("wtgdfkkaui", "vmuafmc", "fedyuep", "vpltidajjvy")) - .withExportIpv4RouteTargets( - Arrays.asList("cfkumcfjxo", "yelsyasvfnk", "myg", "jekrknfd")) - .withExportIpv6RouteTargets( - Arrays.asList("jqy", "kgtxkrdtulcrcj", "k", "otcsu")))) - .withOptionAProperties( - new VpnConfigurationPropertiesOptionAProperties() - .withMtu(1855919116) - .withVlanId(761443572) - .withPeerAsn(1689956278909975813L) - .withBfdConfiguration( - new BfdConfiguration() - .withIntervalInMilliSeconds(1377813110) - .withMultiplier(1139650083)) - .withPrimaryIpv4Prefix("oonsvobchkxfp") - .withPrimaryIpv6Prefix("dyslbklglmnn") - .withSecondaryIpv4Prefix("wayqshwyqxrid") - .withSecondaryIpv6Prefix("bsaqjm"))) - .withWorkloadVpnConfiguration( - new VpnConfigurationProperties() - .withNetworkToNetworkInterconnectId("iizevjykofvez") - .withPeeringOption(PeeringOption.OPTIONB) - .withOptionBProperties( - new OptionBProperties() - .withImportRouteTargets(Arrays.asList("wqlepjj")) - .withExportRouteTargets(Arrays.asList("as")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("ntogffjwajnrt")) - .withImportIpv6RouteTargets( - Arrays - .asList( - "aqkifmxawostfz", - "nhrkmjqncfvdsc", - "hemvwfnqqwypvnd", - "wbgodtggrssg")) - .withExportIpv4RouteTargets(Arrays.asList("kainjmuymvecvzt")) - .withExportIpv6RouteTargets( - Arrays.asList("gmusaictdscnkzzo", "nrddclzeqoz", "ehlbzqixbnjrqvzy")))) - .withOptionAProperties( - new VpnConfigurationPropertiesOptionAProperties() - .withMtu(1882838506) - .withVlanId(158915629) - .withPeerAsn(8483386639744134100L) - .withBfdConfiguration( - new BfdConfiguration() - .withIntervalInMilliSeconds(472275599) - .withMultiplier(2139027754)) - .withPrimaryIpv4Prefix("ozonynp") - .withPrimaryIpv6Prefix("eudpab") - .withSecondaryIpv4Prefix("euwzosgyjxvc") - .withSecondaryIpv6Prefix("sormrex"))); - model = BinaryData.fromObject(model).toObject(ManagementNetworkConfigurationProperties.class); - Assertions.assertEquals("mkwjfbotl", model.infrastructureVpnConfiguration().networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONA, model.infrastructureVpnConfiguration().peeringOption()); - Assertions - .assertEquals( - "ursuivuxcjk", model.infrastructureVpnConfiguration().optionBProperties().importRouteTargets().get(0)); - Assertions - .assertEquals("w", model.infrastructureVpnConfiguration().optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "rizfwihvaang", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .importIpv4RouteTargets() - .get(0)); - Assertions - .assertEquals( - "wtgdfkkaui", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .importIpv6RouteTargets() - .get(0)); - Assertions - .assertEquals( - "cfkumcfjxo", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .exportIpv4RouteTargets() - .get(0)); - Assertions - .assertEquals( - "jqy", - model - .infrastructureVpnConfiguration() - .optionBProperties() - .routeTargets() - .exportIpv6RouteTargets() - .get(0)); - Assertions.assertEquals(1855919116, model.infrastructureVpnConfiguration().optionAProperties().mtu()); - Assertions.assertEquals(761443572, model.infrastructureVpnConfiguration().optionAProperties().vlanId()); - Assertions - .assertEquals(1689956278909975813L, model.infrastructureVpnConfiguration().optionAProperties().peerAsn()); - Assertions - .assertEquals( - 1377813110, - model.infrastructureVpnConfiguration().optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 1139650083, model.infrastructureVpnConfiguration().optionAProperties().bfdConfiguration().multiplier()); - Assertions - .assertEquals( - "oonsvobchkxfp", model.infrastructureVpnConfiguration().optionAProperties().primaryIpv4Prefix()); - Assertions - .assertEquals( - "dyslbklglmnn", model.infrastructureVpnConfiguration().optionAProperties().primaryIpv6Prefix()); - Assertions - .assertEquals( - "wayqshwyqxrid", model.infrastructureVpnConfiguration().optionAProperties().secondaryIpv4Prefix()); - Assertions - .assertEquals("bsaqjm", model.infrastructureVpnConfiguration().optionAProperties().secondaryIpv6Prefix()); - Assertions.assertEquals("iizevjykofvez", model.workloadVpnConfiguration().networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONB, model.workloadVpnConfiguration().peeringOption()); - Assertions - .assertEquals("wqlepjj", model.workloadVpnConfiguration().optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("as", model.workloadVpnConfiguration().optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals( - "ntogffjwajnrt", - model.workloadVpnConfiguration().optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "aqkifmxawostfz", - model.workloadVpnConfiguration().optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions - .assertEquals( - "kainjmuymvecvzt", - model.workloadVpnConfiguration().optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions - .assertEquals( - "gmusaictdscnkzzo", - model.workloadVpnConfiguration().optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals(1882838506, model.workloadVpnConfiguration().optionAProperties().mtu()); - Assertions.assertEquals(158915629, model.workloadVpnConfiguration().optionAProperties().vlanId()); - Assertions.assertEquals(8483386639744134100L, model.workloadVpnConfiguration().optionAProperties().peerAsn()); - Assertions - .assertEquals( - 472275599, - model.workloadVpnConfiguration().optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 2139027754, model.workloadVpnConfiguration().optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("ozonynp", model.workloadVpnConfiguration().optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("eudpab", model.workloadVpnConfiguration().optionAProperties().primaryIpv6Prefix()); - Assertions - .assertEquals("euwzosgyjxvc", model.workloadVpnConfiguration().optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("sormrex", model.workloadVpnConfiguration().optionAProperties().secondaryIpv6Prefix()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborAddressTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborAddressTests.java deleted file mode 100644 index 3242b942e068..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborAddressTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; -import org.junit.jupiter.api.Assertions; - -public final class NeighborAddressTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NeighborAddress model = - BinaryData - .fromString("{\"address\":\"kw\",\"configurationState\":\"Provisioned\"}") - .toObject(NeighborAddress.class); - Assertions.assertEquals("kw", model.address()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NeighborAddress model = new NeighborAddress().withAddress("kw"); - model = BinaryData.fromObject(model).toObject(NeighborAddress.class); - Assertions.assertEquals("kw", model.address()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupDestinationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupDestinationTests.java deleted file mode 100644 index 4db23b71dcc3..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupDestinationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupDestination; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NeighborGroupDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NeighborGroupDestination model = - BinaryData - .fromString("{\"ipv4Addresses\":[\"jbqggweeiwdhdm\"],\"ipv6Addresses\":[\"bf\",\"uscstunmlh\"]}") - .toObject(NeighborGroupDestination.class); - Assertions.assertEquals("jbqggweeiwdhdm", model.ipv4Addresses().get(0)); - Assertions.assertEquals("bf", model.ipv6Addresses().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NeighborGroupDestination model = - new NeighborGroupDestination() - .withIpv4Addresses(Arrays.asList("jbqggweeiwdhdm")) - .withIpv6Addresses(Arrays.asList("bf", "uscstunmlh")); - model = BinaryData.fromObject(model).toObject(NeighborGroupDestination.class); - Assertions.assertEquals("jbqggweeiwdhdm", model.ipv4Addresses().get(0)); - Assertions.assertEquals("bf", model.ipv6Addresses().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupInnerTests.java deleted file mode 100644 index 4d6619cad692..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupInnerTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NeighborGroupInner; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupDestination; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NeighborGroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NeighborGroupInner model = - BinaryData - .fromString( - "{\"properties\":{\"networkTapIds\":[\"oqueqihkkyowltj\",\"uwhldxwhieproqks\",\"fxmcvprstvk\",\"tbfjtdyotnplf\"],\"networkTapRuleIds\":[\"occqrqxw\",\"tjtdrhutfd\",\"a\",\"txop\"],\"provisioningState\":\"Updating\",\"destination\":{\"ipv4Addresses\":[\"k\",\"d\",\"gssz\"],\"ipv6Addresses\":[\"tkbbxuhar\",\"sirncclabvoy\",\"gsuxxczbmyqj\"]},\"annotation\":\"hdsaidj\"},\"location\":\"ormovdxxurntujmo\",\"tags\":{\"d\":\"nwemhdeeljslkyo\",\"jtv\":\"fzjuegrhrhtsl\"},\"id\":\"j\",\"name\":\"xvgjbfi\",\"type\":\"bpnjodf\"}") - .toObject(NeighborGroupInner.class); - Assertions.assertEquals("ormovdxxurntujmo", model.location()); - Assertions.assertEquals("nwemhdeeljslkyo", model.tags().get("d")); - Assertions.assertEquals("k", model.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("tkbbxuhar", model.destination().ipv6Addresses().get(0)); - Assertions.assertEquals("hdsaidj", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NeighborGroupInner model = - new NeighborGroupInner() - .withLocation("ormovdxxurntujmo") - .withTags(mapOf("d", "nwemhdeeljslkyo", "jtv", "fzjuegrhrhtsl")) - .withDestination( - new NeighborGroupDestination() - .withIpv4Addresses(Arrays.asList("k", "d", "gssz")) - .withIpv6Addresses(Arrays.asList("tkbbxuhar", "sirncclabvoy", "gsuxxczbmyqj"))) - .withAnnotation("hdsaidj"); - model = BinaryData.fromObject(model).toObject(NeighborGroupInner.class); - Assertions.assertEquals("ormovdxxurntujmo", model.location()); - Assertions.assertEquals("nwemhdeeljslkyo", model.tags().get("d")); - Assertions.assertEquals("k", model.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("tkbbxuhar", model.destination().ipv6Addresses().get(0)); - Assertions.assertEquals("hdsaidj", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPatchPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPatchPropertiesTests.java deleted file mode 100644 index aa5f390c1344..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPatchPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NeighborGroupPatchProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupDestination; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NeighborGroupPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NeighborGroupPatchProperties model = - BinaryData - .fromString( - "{\"destination\":{\"ipv4Addresses\":[\"peg\",\"wdabalfdxaglzfyt\"],\"ipv6Addresses\":[\"lqhopxouvmrs\"]},\"annotation\":\"likyypzkgxfxfmyr\"}") - .toObject(NeighborGroupPatchProperties.class); - Assertions.assertEquals("likyypzkgxfxfmyr", model.annotation()); - Assertions.assertEquals("peg", model.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("lqhopxouvmrs", model.destination().ipv6Addresses().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NeighborGroupPatchProperties model = - new NeighborGroupPatchProperties() - .withAnnotation("likyypzkgxfxfmyr") - .withDestination( - new NeighborGroupDestination() - .withIpv4Addresses(Arrays.asList("peg", "wdabalfdxaglzfyt")) - .withIpv6Addresses(Arrays.asList("lqhopxouvmrs"))); - model = BinaryData.fromObject(model).toObject(NeighborGroupPatchProperties.class); - Assertions.assertEquals("likyypzkgxfxfmyr", model.annotation()); - Assertions.assertEquals("peg", model.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("lqhopxouvmrs", model.destination().ipv6Addresses().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPatchTests.java deleted file mode 100644 index 509597d4ae10..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPatchTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupDestination; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupPatch; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NeighborGroupPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NeighborGroupPatch model = - BinaryData - .fromString( - "{\"properties\":{\"destination\":{\"ipv4Addresses\":[\"lciichgjs\",\"smvxodgw\",\"f\",\"zsifcuvbdujgcwx\"],\"ipv6Addresses\":[\"bbwjtrdxrizagb\",\"giarksykpgdqxw\",\"b\"]},\"annotation\":\"wiqrxhaclcdosq\"},\"tags\":{\"xkpbqwun\":\"jqgkifmmainwhe\",\"elwgvydjufbnkl\":\"obuizaz\"}}") - .toObject(NeighborGroupPatch.class); - Assertions.assertEquals("jqgkifmmainwhe", model.tags().get("xkpbqwun")); - Assertions.assertEquals("lciichgjs", model.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("bbwjtrdxrizagb", model.destination().ipv6Addresses().get(0)); - Assertions.assertEquals("wiqrxhaclcdosq", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NeighborGroupPatch model = - new NeighborGroupPatch() - .withTags(mapOf("xkpbqwun", "jqgkifmmainwhe", "elwgvydjufbnkl", "obuizaz")) - .withDestination( - new NeighborGroupDestination() - .withIpv4Addresses(Arrays.asList("lciichgjs", "smvxodgw", "f", "zsifcuvbdujgcwx")) - .withIpv6Addresses(Arrays.asList("bbwjtrdxrizagb", "giarksykpgdqxw", "b"))) - .withAnnotation("wiqrxhaclcdosq"); - model = BinaryData.fromObject(model).toObject(NeighborGroupPatch.class); - Assertions.assertEquals("jqgkifmmainwhe", model.tags().get("xkpbqwun")); - Assertions.assertEquals("lciichgjs", model.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("bbwjtrdxrizagb", model.destination().ipv6Addresses().get(0)); - Assertions.assertEquals("wiqrxhaclcdosq", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPatchablePropertiesTests.java deleted file mode 100644 index 484d83066932..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPatchablePropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupDestination; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupPatchableProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NeighborGroupPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NeighborGroupPatchableProperties model = - BinaryData - .fromString( - "{\"destination\":{\"ipv4Addresses\":[\"gfqvmtywhlakx\",\"ejpewpyjlfxampqc\",\"zgeuqxbpiat\"],\"ipv6Addresses\":[\"ujegqdtadra\",\"gddhjkrukizyhgs\",\"tnqsktx\"]}}") - .toObject(NeighborGroupPatchableProperties.class); - Assertions.assertEquals("gfqvmtywhlakx", model.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("ujegqdtadra", model.destination().ipv6Addresses().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NeighborGroupPatchableProperties model = - new NeighborGroupPatchableProperties() - .withDestination( - new NeighborGroupDestination() - .withIpv4Addresses(Arrays.asList("gfqvmtywhlakx", "ejpewpyjlfxampqc", "zgeuqxbpiat")) - .withIpv6Addresses(Arrays.asList("ujegqdtadra", "gddhjkrukizyhgs", "tnqsktx"))); - model = BinaryData.fromObject(model).toObject(NeighborGroupPatchableProperties.class); - Assertions.assertEquals("gfqvmtywhlakx", model.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("ujegqdtadra", model.destination().ipv6Addresses().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPropertiesTests.java deleted file mode 100644 index e8bdc3fcc8cb..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NeighborGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupDestination; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NeighborGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NeighborGroupProperties model = - BinaryData - .fromString( - "{\"networkTapIds\":[\"qqw\",\"tqsmoxsa\",\"uxejgwecywnfyszz\",\"czs\"],\"networkTapRuleIds\":[\"bdnd\"],\"provisioningState\":\"Deleting\",\"destination\":{\"ipv4Addresses\":[\"yvrmkjm\",\"it\",\"chwudlxee\"],\"ipv6Addresses\":[\"pmnoejhqlf\",\"sibz\"]},\"annotation\":\"rfgxkyd\"}") - .toObject(NeighborGroupProperties.class); - Assertions.assertEquals("rfgxkyd", model.annotation()); - Assertions.assertEquals("yvrmkjm", model.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("pmnoejhqlf", model.destination().ipv6Addresses().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NeighborGroupProperties model = - new NeighborGroupProperties() - .withAnnotation("rfgxkyd") - .withDestination( - new NeighborGroupDestination() - .withIpv4Addresses(Arrays.asList("yvrmkjm", "it", "chwudlxee")) - .withIpv6Addresses(Arrays.asList("pmnoejhqlf", "sibz"))); - model = BinaryData.fromObject(model).toObject(NeighborGroupProperties.class); - Assertions.assertEquals("rfgxkyd", model.annotation()); - Assertions.assertEquals("yvrmkjm", model.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("pmnoejhqlf", model.destination().ipv6Addresses().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsCreateMockTests.java deleted file mode 100644 index b7e2bf637752..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsCreateMockTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroup; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupDestination; -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 NeighborGroupsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"networkTapIds\":[\"llitpqvpivr\",\"gqbmolxeomeb\",\"vtvxxfsfo\"],\"networkTapRuleIds\":[\"gihnalpc\",\"edybkbgdwbmi\"],\"provisioningState\":\"Succeeded\",\"destination\":{\"ipv4Addresses\":[\"ywedbpirbzpauzbb\"],\"ipv6Addresses\":[\"cszdwpaveuxgmi\",\"soebdltni\",\"iimerffhgvcymdd\",\"eilhggajfeudb\"]},\"annotation\":\"moljirchhwlzihv\"},\"location\":\"quajpo\",\"tags\":{\"szk\":\"jxyotgvraxhntoiw\",\"sjwrretsluqfgksd\":\"lk\",\"whdq\":\"imioixviobuwbnge\",\"zaffzqodokst\":\"gqamhbmggnqxnex\"},\"id\":\"vomdqxnoyzqipapi\",\"name\":\"ccydbjghunqnttrw\",\"type\":\"cbzvvxd\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NeighborGroup response = - manager - .neighborGroups() - .define("pcroxp") - .withRegion("qneaqkgttbarg") - .withExistingResourceGroup("pfivypmwdza") - .withTags(mapOf("gjjpfyxhsppvj", "nqlsnrgaxoy", "eqeapaseqcppyp", "duouoqtenqsomuo")) - .withDestination( - new NeighborGroupDestination() - .withIpv4Addresses(Arrays.asList("znymwzl", "pkihqhnfubevwa", "xcezxevltfebqo")) - .withIpv6Addresses(Arrays.asList("klqakpstifmftw"))) - .withAnnotation("hmriipzgfofuad") - .create(); - - Assertions.assertEquals("quajpo", response.location()); - Assertions.assertEquals("jxyotgvraxhntoiw", response.tags().get("szk")); - Assertions.assertEquals("ywedbpirbzpauzbb", response.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("cszdwpaveuxgmi", response.destination().ipv6Addresses().get(0)); - Assertions.assertEquals("moljirchhwlzihv", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 31214619a94a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroup; -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 NeighborGroupsGetByResourceGroupWithResponseMockTests { - @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\":{\"networkTapIds\":[\"bksksmqmw\",\"wrmhmifhfu\",\"jyxntmgt\"],\"networkTapRuleIds\":[\"aem\",\"ygcaxjymdqrf\"],\"provisioningState\":\"Accepted\",\"destination\":{\"ipv4Addresses\":[\"cllqgn\",\"ydksvjf\"],\"ipv6Addresses\":[\"dpivjkhc\",\"scoljjhcsg\",\"ooefzsdttbqkaq\"]},\"annotation\":\"wojvxv\"},\"location\":\"hrqxrqghotingzi\",\"tags\":{\"yhpwmdkyfg\":\"yga\",\"pubbkhci\":\"elvyhvvpuqy\",\"mix\":\"cfwoolkugzowg\"},\"id\":\"zaupgblnag\",\"name\":\"npahzhpqsc\",\"type\":\"yileqjzrijebmui\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NeighborGroup response = - manager - .neighborGroups() - .getByResourceGroupWithResponse("swbrnbo", "ishkm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("hrqxrqghotingzi", response.location()); - Assertions.assertEquals("yga", response.tags().get("yhpwmdkyfg")); - Assertions.assertEquals("cllqgn", response.destination().ipv4Addresses().get(0)); - Assertions.assertEquals("dpivjkhc", response.destination().ipv6Addresses().get(0)); - Assertions.assertEquals("wojvxv", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsListByResourceGroupMockTests.java deleted file mode 100644 index 3e42008d53af..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroup; -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 NeighborGroupsListByResourceGroupMockTests { - @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\":{\"networkTapIds\":[\"vbjimzw\"],\"networkTapRuleIds\":[\"mmphvkyezw\"],\"provisioningState\":\"Failed\",\"destination\":{\"ipv4Addresses\":[\"jmjwqdslqreofz\"],\"ipv6Addresses\":[\"ztpyaymhxlnmwa\"]},\"annotation\":\"ymnrtvq\"},\"location\":\"mavyotpcvp\",\"tags\":{\"wtominrufqqa\":\"pkvyqpvzxxzn\"},\"id\":\"ygasfmhb\",\"name\":\"v\",\"type\":\"wkqnatxvuzcc\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.neighborGroups().listByResourceGroup("ngmndwohoeash", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mavyotpcvp", response.iterator().next().location()); - Assertions.assertEquals("pkvyqpvzxxzn", response.iterator().next().tags().get("wtominrufqqa")); - Assertions.assertEquals("jmjwqdslqreofz", response.iterator().next().destination().ipv4Addresses().get(0)); - Assertions.assertEquals("ztpyaymhxlnmwa", response.iterator().next().destination().ipv6Addresses().get(0)); - Assertions.assertEquals("ymnrtvq", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsListMockTests.java deleted file mode 100644 index ac007b8ea174..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroup; -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 NeighborGroupsListMockTests { - @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\":{\"networkTapIds\":[\"rybytcaqpj\",\"hlc\",\"nrvxyyh\",\"sis\"],\"networkTapRuleIds\":[\"frpan\",\"eqiwduukaamimkj\",\"cxysjdfxvksi\"],\"provisioningState\":\"Canceled\",\"destination\":{\"ipv4Addresses\":[\"ndexijo\",\"uyxuupze\",\"ddatopdtphvjgvjz\",\"kngq\"],\"ipv6Addresses\":[\"jxzxbth\",\"nyzpu\",\"nrmd\"]},\"annotation\":\"oabfcvefb\"},\"location\":\"pmgyqshsasm\",\"tags\":{\"grz\":\"yutkbx\"},\"id\":\"kyqguauuihkybg\",\"name\":\"yncyzjnd\",\"type\":\"eemxiu\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.neighborGroups().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pmgyqshsasm", response.iterator().next().location()); - Assertions.assertEquals("yutkbx", response.iterator().next().tags().get("grz")); - Assertions.assertEquals("ndexijo", response.iterator().next().destination().ipv4Addresses().get(0)); - Assertions.assertEquals("jxzxbth", response.iterator().next().destination().ipv6Addresses().get(0)); - Assertions.assertEquals("oabfcvefb", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsListResultTests.java deleted file mode 100644 index 2589fe078216..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NeighborGroupsListResultTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NeighborGroupInner; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupDestination; -import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupsListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NeighborGroupsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NeighborGroupsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"networkTapIds\":[\"oksz\",\"nm\",\"wgpterdiuw\",\"i\"],\"networkTapRuleIds\":[\"kwztsdetj\"],\"provisioningState\":\"Failed\",\"destination\":{\"ipv4Addresses\":[\"cq\",\"olzkgys\"],\"ipv6Addresses\":[\"yybzoxlvoc\",\"tvdxxhe\"]},\"annotation\":\"mlil\"},\"location\":\"ghjhjvmabzzbwa\",\"tags\":{\"apr\":\"mdafbgymqt\",\"neychbjizq\":\"ojxrjnbsconxavi\",\"rfbo\":\"sgnwdxzedpq\",\"mlnfyz\":\"xi\"},\"id\":\"vfrbypic\",\"name\":\"bkpdjtaqhsmq\",\"type\":\"zpdgonjhxshthmgp\"}],\"nextLink\":\"qulpt\"}") - .toObject(NeighborGroupsListResult.class); - Assertions.assertEquals("ghjhjvmabzzbwa", model.value().get(0).location()); - Assertions.assertEquals("mdafbgymqt", model.value().get(0).tags().get("apr")); - Assertions.assertEquals("cq", model.value().get(0).destination().ipv4Addresses().get(0)); - Assertions.assertEquals("yybzoxlvoc", model.value().get(0).destination().ipv6Addresses().get(0)); - Assertions.assertEquals("mlil", model.value().get(0).annotation()); - Assertions.assertEquals("qulpt", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NeighborGroupsListResult model = - new NeighborGroupsListResult() - .withValue( - Arrays - .asList( - new NeighborGroupInner() - .withLocation("ghjhjvmabzzbwa") - .withTags( - mapOf( - "apr", - "mdafbgymqt", - "neychbjizq", - "ojxrjnbsconxavi", - "rfbo", - "sgnwdxzedpq", - "mlnfyz", - "xi")) - .withDestination( - new NeighborGroupDestination() - .withIpv4Addresses(Arrays.asList("cq", "olzkgys")) - .withIpv6Addresses(Arrays.asList("yybzoxlvoc", "tvdxxhe"))) - .withAnnotation("mlil"))) - .withNextLink("qulpt"); - model = BinaryData.fromObject(model).toObject(NeighborGroupsListResult.class); - Assertions.assertEquals("ghjhjvmabzzbwa", model.value().get(0).location()); - Assertions.assertEquals("mdafbgymqt", model.value().get(0).tags().get("apr")); - Assertions.assertEquals("cq", model.value().get(0).destination().ipv4Addresses().get(0)); - Assertions.assertEquals("yybzoxlvoc", model.value().get(0).destination().ipv6Addresses().get(0)); - Assertions.assertEquals("mlil", model.value().get(0).annotation()); - Assertions.assertEquals("qulpt", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceInnerTests.java deleted file mode 100644 index 72f42b7c0731..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceInnerTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkDeviceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkDeviceInner model = - BinaryData - .fromString( - "{\"properties\":{\"version\":\"kbnbmxlxmwtyg\",\"networkDeviceSku\":\"zusitoqcahfs\",\"networkDeviceRole\":\"Management\",\"networkRackId\":\"lreesrfwsszvlcwl\",\"managementIpv4Address\":\"olntfx\",\"managementIpv6Address\":\"rqmipfjwf\",\"configurationState\":\"ErrorDeprovisioning\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Enabled\",\"hostName\":\"xxbaizabuln\",\"serialNumber\":\"skjto\",\"annotation\":\"dzjs\"},\"location\":\"nvhxqqmqip\",\"tags\":{\"tfshksnyzm\":\"hfnzocx\",\"bnl\":\"pamwbw\",\"kvi\":\"lcefiqdktw\",\"uuzhw\":\"lpfliwoyn\"},\"id\":\"ladpcmhjha\",\"name\":\"sybkekymffzt\",\"type\":\"ilscv\"}") - .toObject(NetworkDeviceInner.class); - Assertions.assertEquals("nvhxqqmqip", model.location()); - Assertions.assertEquals("hfnzocx", model.tags().get("tfshksnyzm")); - Assertions.assertEquals("zusitoqcahfs", model.networkDeviceSku()); - Assertions.assertEquals("xxbaizabuln", model.hostname()); - Assertions.assertEquals("skjto", model.serialNumber()); - Assertions.assertEquals("dzjs", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkDeviceInner model = - new NetworkDeviceInner() - .withLocation("nvhxqqmqip") - .withTags(mapOf("tfshksnyzm", "hfnzocx", "bnl", "pamwbw", "kvi", "lcefiqdktw", "uuzhw", "lpfliwoyn")) - .withNetworkDeviceSku("zusitoqcahfs") - .withHostname("xxbaizabuln") - .withSerialNumber("skjto") - .withAnnotation("dzjs"); - model = BinaryData.fromObject(model).toObject(NetworkDeviceInner.class); - Assertions.assertEquals("nvhxqqmqip", model.location()); - Assertions.assertEquals("hfnzocx", model.tags().get("tfshksnyzm")); - Assertions.assertEquals("zusitoqcahfs", model.networkDeviceSku()); - Assertions.assertEquals("xxbaizabuln", model.hostname()); - Assertions.assertEquals("skjto", model.serialNumber()); - Assertions.assertEquals("dzjs", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePatchParametersPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePatchParametersPropertiesTests.java deleted file mode 100644 index 2784c1d7f62b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePatchParametersPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDevicePatchParametersProperties; -import org.junit.jupiter.api.Assertions; - -public final class NetworkDevicePatchParametersPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkDevicePatchParametersProperties model = - BinaryData - .fromString( - "{\"hostName\":\"qqzjkoxdu\",\"serialNumber\":\"amglrouig\",\"annotation\":\"fivjqterdqqigdy\"}") - .toObject(NetworkDevicePatchParametersProperties.class); - Assertions.assertEquals("fivjqterdqqigdy", model.annotation()); - Assertions.assertEquals("qqzjkoxdu", model.hostname()); - Assertions.assertEquals("amglrouig", model.serialNumber()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkDevicePatchParametersProperties model = - new NetworkDevicePatchParametersProperties() - .withAnnotation("fivjqterdqqigdy") - .withHostname("qqzjkoxdu") - .withSerialNumber("amglrouig"); - model = BinaryData.fromObject(model).toObject(NetworkDevicePatchParametersProperties.class); - Assertions.assertEquals("fivjqterdqqigdy", model.annotation()); - Assertions.assertEquals("qqzjkoxdu", model.hostname()); - Assertions.assertEquals("amglrouig", model.serialNumber()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePatchParametersTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePatchParametersTests.java deleted file mode 100644 index 121fdf886118..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePatchParametersTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevicePatchParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkDevicePatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkDevicePatchParameters model = - BinaryData - .fromString( - "{\"properties\":{\"hostName\":\"awkikcdgfh\",\"serialNumber\":\"sd\",\"annotation\":\"ey\"},\"tags\":{\"gxsur\":\"dedecfiwh\",\"bgullc\":\"jqrshz\"}}") - .toObject(NetworkDevicePatchParameters.class); - Assertions.assertEquals("dedecfiwh", model.tags().get("gxsur")); - Assertions.assertEquals("awkikcdgfh", model.hostname()); - Assertions.assertEquals("sd", model.serialNumber()); - Assertions.assertEquals("ey", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkDevicePatchParameters model = - new NetworkDevicePatchParameters() - .withTags(mapOf("gxsur", "dedecfiwh", "bgullc", "jqrshz")) - .withHostname("awkikcdgfh") - .withSerialNumber("sd") - .withAnnotation("ey"); - model = BinaryData.fromObject(model).toObject(NetworkDevicePatchParameters.class); - Assertions.assertEquals("dedecfiwh", model.tags().get("gxsur")); - Assertions.assertEquals("awkikcdgfh", model.hostname()); - Assertions.assertEquals("sd", model.serialNumber()); - Assertions.assertEquals("ey", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePatchablePropertiesTests.java deleted file mode 100644 index ba84d0291d87..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePatchablePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevicePatchableProperties; -import org.junit.jupiter.api.Assertions; - -public final class NetworkDevicePatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkDevicePatchableProperties model = - BinaryData - .fromString("{\"hostName\":\"b\",\"serialNumber\":\"glhzqp\"}") - .toObject(NetworkDevicePatchableProperties.class); - Assertions.assertEquals("b", model.hostname()); - Assertions.assertEquals("glhzqp", model.serialNumber()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkDevicePatchableProperties model = - new NetworkDevicePatchableProperties().withHostname("b").withSerialNumber("glhzqp"); - model = BinaryData.fromObject(model).toObject(NetworkDevicePatchableProperties.class); - Assertions.assertEquals("b", model.hostname()); - Assertions.assertEquals("glhzqp", model.serialNumber()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePropertiesTests.java deleted file mode 100644 index 9c9c30a81634..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicePropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceProperties; -import org.junit.jupiter.api.Assertions; - -public final class NetworkDevicePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkDeviceProperties model = - BinaryData - .fromString( - "{\"version\":\"yeiihfymkou\",\"networkDeviceSku\":\"yese\",\"networkDeviceRole\":\"ToR\",\"networkRackId\":\"igzhogsmgbvmtdw\",\"managementIpv4Address\":\"bebjn\",\"managementIpv6Address\":\"eglabtvkbiwznhtf\",\"configurationState\":\"Failed\",\"provisioningState\":\"Updating\",\"administrativeState\":\"MAT\",\"hostName\":\"izpacz\",\"serialNumber\":\"hbcakznhokhoit\",\"annotation\":\"rjsdmmazdnck\"}") - .toObject(NetworkDeviceProperties.class); - Assertions.assertEquals("rjsdmmazdnck", model.annotation()); - Assertions.assertEquals("yese", model.networkDeviceSku()); - Assertions.assertEquals("izpacz", model.hostname()); - Assertions.assertEquals("hbcakznhokhoit", model.serialNumber()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkDeviceProperties model = - new NetworkDeviceProperties() - .withAnnotation("rjsdmmazdnck") - .withNetworkDeviceSku("yese") - .withHostname("izpacz") - .withSerialNumber("hbcakznhokhoit"); - model = BinaryData.fromObject(model).toObject(NetworkDeviceProperties.class); - Assertions.assertEquals("rjsdmmazdnck", model.annotation()); - Assertions.assertEquals("yese", model.networkDeviceSku()); - Assertions.assertEquals("izpacz", model.hostname()); - Assertions.assertEquals("hbcakznhokhoit", model.serialNumber()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkuInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkuInnerTests.java deleted file mode 100644 index 8a66141030d8..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkuInnerTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.DeviceInterfaceProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; -import com.azure.resourcemanager.managednetworkfabric.models.SupportedConnectorProperties; -import com.azure.resourcemanager.managednetworkfabric.models.SupportedVersionProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkDeviceSkuInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkDeviceSkuInner model = - BinaryData - .fromString( - "{\"properties\":{\"model\":\"bvcpxtzhi\",\"manufacturer\":\"qbtimpk\",\"supportedVersions\":[{\"version\":\"rnsihqhudsmus\",\"vendorOsVersion\":\"awja\",\"vendorFirmwareVersion\":\"wj\",\"isDefault\":\"False\"},{\"version\":\"mnn\",\"vendorOsVersion\":\"xyxvqban\",\"vendorFirmwareVersion\":\"jtgirnb\",\"isDefault\":\"True\"},{\"version\":\"ddorgmynltwmpft\",\"vendorOsVersion\":\"oeajogsy\",\"vendorFirmwareVersion\":\"etamfddrvlkpzwb\",\"isDefault\":\"False\"}],\"supportedRoleTypes\":[\"Management\"],\"interfaces\":[{\"identifier\":\"drmuhka\",\"interfaceType\":\"j\",\"supportedConnectorTypes\":[{\"connectorType\":\"ucvkhhwmjpjbw\",\"maxSpeedInMbps\":430534456}]}],\"provisioningState\":\"Deleting\"},\"id\":\"qrrihufoihp\",\"name\":\"iybxvgnzuzpb\",\"type\":\"kzcscpiuzvkun\"}") - .toObject(NetworkDeviceSkuInner.class); - Assertions.assertEquals("bvcpxtzhi", model.model()); - Assertions.assertEquals("qbtimpk", model.manufacturer()); - Assertions.assertEquals("rnsihqhudsmus", model.supportedVersions().get(0).version()); - Assertions.assertEquals("awja", model.supportedVersions().get(0).vendorOsVersion()); - Assertions.assertEquals("wj", model.supportedVersions().get(0).vendorFirmwareVersion()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.supportedVersions().get(0).isDefault()); - Assertions.assertEquals(NetworkDeviceRoleName.MANAGEMENT, model.supportedRoleTypes().get(0)); - Assertions.assertEquals("drmuhka", model.interfaces().get(0).identifier()); - Assertions.assertEquals("j", model.interfaces().get(0).interfaceType()); - Assertions - .assertEquals("ucvkhhwmjpjbw", model.interfaces().get(0).supportedConnectorTypes().get(0).connectorType()); - Assertions.assertEquals(430534456, model.interfaces().get(0).supportedConnectorTypes().get(0).maxSpeedInMbps()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkDeviceSkuInner model = - new NetworkDeviceSkuInner() - .withModel("bvcpxtzhi") - .withManufacturer("qbtimpk") - .withSupportedVersions( - Arrays - .asList( - new SupportedVersionProperties() - .withVersion("rnsihqhudsmus") - .withVendorOsVersion("awja") - .withVendorFirmwareVersion("wj") - .withIsDefault(BooleanEnumProperty.FALSE), - new SupportedVersionProperties() - .withVersion("mnn") - .withVendorOsVersion("xyxvqban") - .withVendorFirmwareVersion("jtgirnb") - .withIsDefault(BooleanEnumProperty.TRUE), - new SupportedVersionProperties() - .withVersion("ddorgmynltwmpft") - .withVendorOsVersion("oeajogsy") - .withVendorFirmwareVersion("etamfddrvlkpzwb") - .withIsDefault(BooleanEnumProperty.FALSE))) - .withSupportedRoleTypes(Arrays.asList(NetworkDeviceRoleName.MANAGEMENT)) - .withInterfaces( - Arrays - .asList( - new DeviceInterfaceProperties() - .withIdentifier("drmuhka") - .withInterfaceType("j") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties() - .withConnectorType("ucvkhhwmjpjbw") - .withMaxSpeedInMbps(430534456))))); - model = BinaryData.fromObject(model).toObject(NetworkDeviceSkuInner.class); - Assertions.assertEquals("bvcpxtzhi", model.model()); - Assertions.assertEquals("qbtimpk", model.manufacturer()); - Assertions.assertEquals("rnsihqhudsmus", model.supportedVersions().get(0).version()); - Assertions.assertEquals("awja", model.supportedVersions().get(0).vendorOsVersion()); - Assertions.assertEquals("wj", model.supportedVersions().get(0).vendorFirmwareVersion()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.supportedVersions().get(0).isDefault()); - Assertions.assertEquals(NetworkDeviceRoleName.MANAGEMENT, model.supportedRoleTypes().get(0)); - Assertions.assertEquals("drmuhka", model.interfaces().get(0).identifier()); - Assertions.assertEquals("j", model.interfaces().get(0).interfaceType()); - Assertions - .assertEquals("ucvkhhwmjpjbw", model.interfaces().get(0).supportedConnectorTypes().get(0).connectorType()); - Assertions.assertEquals(430534456, model.interfaces().get(0).supportedConnectorTypes().get(0).maxSpeedInMbps()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkuPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkuPropertiesTests.java deleted file mode 100644 index e50ef168b539..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkuPropertiesTests.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuProperties; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.DeviceInterfaceProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; -import com.azure.resourcemanager.managednetworkfabric.models.SupportedConnectorProperties; -import com.azure.resourcemanager.managednetworkfabric.models.SupportedVersionProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkDeviceSkuPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkDeviceSkuProperties model = - BinaryData - .fromString( - "{\"model\":\"dimjuktirzkau\",\"manufacturer\":\"u\",\"supportedVersions\":[{\"version\":\"fq\",\"vendorOsVersion\":\"wgofmhx\",\"vendorFirmwareVersion\":\"jlvzklk\",\"isDefault\":\"False\"}],\"supportedRoleTypes\":[\"NPB\",\"CE\",\"Management\"],\"interfaces\":[{\"identifier\":\"vlbishjvpzapt\",\"interfaceType\":\"skaoizjixwf\",\"supportedConnectorTypes\":[{\"connectorType\":\"y\",\"maxSpeedInMbps\":89327285}]},{\"identifier\":\"wnujvqynvav\",\"interfaceType\":\"mdmuqoh\",\"supportedConnectorTypes\":[{\"connectorType\":\"a\",\"maxSpeedInMbps\":1688024813},{\"connectorType\":\"drwjcljbrhlh\",\"maxSpeedInMbps\":1496418758},{\"connectorType\":\"dbwen\",\"maxSpeedInMbps\":226649221},{\"connectorType\":\"fhxrzfr\",\"maxSpeedInMbps\":359961335}]},{\"identifier\":\"iucwv\",\"interfaceType\":\"llukhkrcqxgcbvz\",\"supportedConnectorTypes\":[{\"connectorType\":\"cbpokstsinvago\",\"maxSpeedInMbps\":1606479022},{\"connectorType\":\"d\",\"maxSpeedInMbps\":1543016379},{\"connectorType\":\"dvcehqw\",\"maxSpeedInMbps\":607181789},{\"connectorType\":\"nmxgnm\",\"maxSpeedInMbps\":1672771636}]}],\"provisioningState\":\"Deleting\"}") - .toObject(NetworkDeviceSkuProperties.class); - Assertions.assertEquals("dimjuktirzkau", model.model()); - Assertions.assertEquals("u", model.manufacturer()); - Assertions.assertEquals("fq", model.supportedVersions().get(0).version()); - Assertions.assertEquals("wgofmhx", model.supportedVersions().get(0).vendorOsVersion()); - Assertions.assertEquals("jlvzklk", model.supportedVersions().get(0).vendorFirmwareVersion()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.supportedVersions().get(0).isDefault()); - Assertions.assertEquals(NetworkDeviceRoleName.NPB, model.supportedRoleTypes().get(0)); - Assertions.assertEquals("vlbishjvpzapt", model.interfaces().get(0).identifier()); - Assertions.assertEquals("skaoizjixwf", model.interfaces().get(0).interfaceType()); - Assertions.assertEquals("y", model.interfaces().get(0).supportedConnectorTypes().get(0).connectorType()); - Assertions.assertEquals(89327285, model.interfaces().get(0).supportedConnectorTypes().get(0).maxSpeedInMbps()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkDeviceSkuProperties model = - new NetworkDeviceSkuProperties() - .withModel("dimjuktirzkau") - .withManufacturer("u") - .withSupportedVersions( - Arrays - .asList( - new SupportedVersionProperties() - .withVersion("fq") - .withVendorOsVersion("wgofmhx") - .withVendorFirmwareVersion("jlvzklk") - .withIsDefault(BooleanEnumProperty.FALSE))) - .withSupportedRoleTypes( - Arrays - .asList(NetworkDeviceRoleName.NPB, NetworkDeviceRoleName.CE, NetworkDeviceRoleName.MANAGEMENT)) - .withInterfaces( - Arrays - .asList( - new DeviceInterfaceProperties() - .withIdentifier("vlbishjvpzapt") - .withInterfaceType("skaoizjixwf") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties() - .withConnectorType("y") - .withMaxSpeedInMbps(89327285))), - new DeviceInterfaceProperties() - .withIdentifier("wnujvqynvav") - .withInterfaceType("mdmuqoh") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties() - .withConnectorType("a") - .withMaxSpeedInMbps(1688024813), - new SupportedConnectorProperties() - .withConnectorType("drwjcljbrhlh") - .withMaxSpeedInMbps(1496418758), - new SupportedConnectorProperties() - .withConnectorType("dbwen") - .withMaxSpeedInMbps(226649221), - new SupportedConnectorProperties() - .withConnectorType("fhxrzfr") - .withMaxSpeedInMbps(359961335))), - new DeviceInterfaceProperties() - .withIdentifier("iucwv") - .withInterfaceType("llukhkrcqxgcbvz") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties() - .withConnectorType("cbpokstsinvago") - .withMaxSpeedInMbps(1606479022), - new SupportedConnectorProperties() - .withConnectorType("d") - .withMaxSpeedInMbps(1543016379), - new SupportedConnectorProperties() - .withConnectorType("dvcehqw") - .withMaxSpeedInMbps(607181789), - new SupportedConnectorProperties() - .withConnectorType("nmxgnm") - .withMaxSpeedInMbps(1672771636))))); - model = BinaryData.fromObject(model).toObject(NetworkDeviceSkuProperties.class); - Assertions.assertEquals("dimjuktirzkau", model.model()); - Assertions.assertEquals("u", model.manufacturer()); - Assertions.assertEquals("fq", model.supportedVersions().get(0).version()); - Assertions.assertEquals("wgofmhx", model.supportedVersions().get(0).vendorOsVersion()); - Assertions.assertEquals("jlvzklk", model.supportedVersions().get(0).vendorFirmwareVersion()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.supportedVersions().get(0).isDefault()); - Assertions.assertEquals(NetworkDeviceRoleName.NPB, model.supportedRoleTypes().get(0)); - Assertions.assertEquals("vlbishjvpzapt", model.interfaces().get(0).identifier()); - Assertions.assertEquals("skaoizjixwf", model.interfaces().get(0).interfaceType()); - Assertions.assertEquals("y", model.interfaces().get(0).supportedConnectorTypes().get(0).connectorType()); - Assertions.assertEquals(89327285, model.interfaces().get(0).supportedConnectorTypes().get(0).maxSpeedInMbps()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusGetWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusGetWithResponseMockTests.java deleted file mode 100644 index f3f01175d305..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusGetWithResponseMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSku; -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 NetworkDeviceSkusGetWithResponseMockTests { - @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\":{\"model\":\"cbogsfovk\",\"manufacturer\":\"miy\",\"supportedVersions\":[{\"version\":\"rukcyyaalbk\",\"vendorOsVersion\":\"zqazdlrkvitz\",\"vendorFirmwareVersion\":\"fqbxmnnidotm\",\"isDefault\":\"False\"}],\"supportedRoleTypes\":[\"TS\"],\"interfaces\":[{\"identifier\":\"ttqhpvaru\",\"interfaceType\":\"uwj\",\"supportedConnectorTypes\":[{},{}]},{\"identifier\":\"fpqqllavzlhjgm\",\"interfaceType\":\"dblapqraczvtniwf\",\"supportedConnectorTypes\":[{},{},{},{}]}],\"provisioningState\":\"Updating\"},\"id\":\"xmyibx\",\"name\":\"ceg\",\"type\":\"ttgxkxt\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkDeviceSku response = - manager.networkDeviceSkus().getWithResponse("phxmwwvxcaicb", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("cbogsfovk", response.model()); - Assertions.assertEquals("miy", response.manufacturer()); - Assertions.assertEquals("rukcyyaalbk", response.supportedVersions().get(0).version()); - Assertions.assertEquals("zqazdlrkvitz", response.supportedVersions().get(0).vendorOsVersion()); - Assertions.assertEquals("fqbxmnnidotm", response.supportedVersions().get(0).vendorFirmwareVersion()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, response.supportedVersions().get(0).isDefault()); - Assertions.assertEquals(NetworkDeviceRoleName.TS, response.supportedRoleTypes().get(0)); - Assertions.assertEquals("ttqhpvaru", response.interfaces().get(0).identifier()); - Assertions.assertEquals("uwj", response.interfaces().get(0).interfaceType()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusListMockTests.java deleted file mode 100644 index d3628f95a948..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusListMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSku; -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 NetworkDeviceSkusListMockTests { - @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\":{\"model\":\"xb\",\"manufacturer\":\"beyqohvi\",\"supportedVersions\":[{\"version\":\"fkrarer\",\"vendorOsVersion\":\"gbvtpxo\",\"vendorFirmwareVersion\":\"o\",\"isDefault\":\"False\"},{\"version\":\"cjasua\",\"vendorOsVersion\":\"gjkfiszhexumfavw\",\"vendorFirmwareVersion\":\"loblitxrrsjsc\",\"isDefault\":\"False\"}],\"supportedRoleTypes\":[\"ToR\"],\"interfaces\":[{\"identifier\":\"rztog\",\"interfaceType\":\"gbncl\",\"supportedConnectorTypes\":[{},{},{}]},{\"identifier\":\"zfggsuzkvdantpz\",\"interfaceType\":\"wazoabthutctc\",\"supportedConnectorTypes\":[{},{},{},{}]}],\"provisioningState\":\"Succeeded\"},\"id\":\"abzfihsz\",\"name\":\"kpoidfzwegvu\",\"type\":\"juwgw\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkDeviceSkus().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xb", response.iterator().next().model()); - Assertions.assertEquals("beyqohvi", response.iterator().next().manufacturer()); - Assertions.assertEquals("fkrarer", response.iterator().next().supportedVersions().get(0).version()); - Assertions.assertEquals("gbvtpxo", response.iterator().next().supportedVersions().get(0).vendorOsVersion()); - Assertions.assertEquals("o", response.iterator().next().supportedVersions().get(0).vendorFirmwareVersion()); - Assertions - .assertEquals(BooleanEnumProperty.FALSE, response.iterator().next().supportedVersions().get(0).isDefault()); - Assertions.assertEquals(NetworkDeviceRoleName.TOR, response.iterator().next().supportedRoleTypes().get(0)); - Assertions.assertEquals("rztog", response.iterator().next().interfaces().get(0).identifier()); - Assertions.assertEquals("gbncl", response.iterator().next().interfaces().get(0).interfaceType()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusListResultTests.java deleted file mode 100644 index 3e375898174a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusListResultTests.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.DeviceInterfaceProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkusListResult; -import com.azure.resourcemanager.managednetworkfabric.models.SupportedConnectorProperties; -import com.azure.resourcemanager.managednetworkfabric.models.SupportedVersionProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkDeviceSkusListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkDeviceSkusListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"model\":\"jnhj\",\"manufacturer\":\"tif\",\"supportedVersions\":[{\"version\":\"ngkegxcypxbbfe\",\"vendorOsVersion\":\"ilyrzoxp\",\"vendorFirmwareVersion\":\"qlf\",\"isDefault\":\"False\"},{\"version\":\"ow\",\"vendorOsVersion\":\"iu\",\"vendorFirmwareVersion\":\"ewnahwkxjjmzt\",\"isDefault\":\"True\"},{\"version\":\"oodtm\",\"vendorOsVersion\":\"cdhdyswcrpt\",\"vendorFirmwareVersion\":\"ajczxvl\",\"isDefault\":\"True\"}],\"supportedRoleTypes\":[\"NPB\",\"TS\",\"ToR\"],\"interfaces\":[{\"identifier\":\"ywlptyuqh\",\"interfaceType\":\"mc\",\"supportedConnectorTypes\":[{},{}]},{\"identifier\":\"pfuofixcnpcfykkp\",\"interfaceType\":\"cpawmp\",\"supportedConnectorTypes\":[{},{}]},{\"identifier\":\"pwr\",\"interfaceType\":\"fpcfjf\",\"supportedConnectorTypes\":[{},{},{},{}]}],\"provisioningState\":\"Failed\"},\"id\":\"awkgy\",\"name\":\"peyamnnidmdiaw\",\"type\":\"zxkzrntmkct\"},{\"properties\":{\"model\":\"huosgwqpsqaz\",\"manufacturer\":\"qodvqgcnbhcbmj\",\"supportedVersions\":[{\"version\":\"bn\",\"vendorOsVersion\":\"ntsxjmfmeftvh\",\"vendorFirmwareVersion\":\"o\",\"isDefault\":\"False\"}],\"supportedRoleTypes\":[\"NPB\"],\"interfaces\":[{\"identifier\":\"gmjgrul\",\"interfaceType\":\"ogxhcxn\",\"supportedConnectorTypes\":[{},{},{},{}]},{\"identifier\":\"fdz\",\"interfaceType\":\"ouzfwofwakuk\",\"supportedConnectorTypes\":[{},{}]},{\"identifier\":\"zxsoednl\",\"interfaceType\":\"li\",\"supportedConnectorTypes\":[{},{},{},{}]}],\"provisioningState\":\"Accepted\"},\"id\":\"ucmqgisnione\",\"name\":\"bzdrdpuenxkgt\",\"type\":\"zlm\"}],\"nextLink\":\"lxcznn\"}") - .toObject(NetworkDeviceSkusListResult.class); - Assertions.assertEquals("jnhj", model.value().get(0).model()); - Assertions.assertEquals("tif", model.value().get(0).manufacturer()); - Assertions.assertEquals("ngkegxcypxbbfe", model.value().get(0).supportedVersions().get(0).version()); - Assertions.assertEquals("ilyrzoxp", model.value().get(0).supportedVersions().get(0).vendorOsVersion()); - Assertions.assertEquals("qlf", model.value().get(0).supportedVersions().get(0).vendorFirmwareVersion()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.value().get(0).supportedVersions().get(0).isDefault()); - Assertions.assertEquals(NetworkDeviceRoleName.NPB, model.value().get(0).supportedRoleTypes().get(0)); - Assertions.assertEquals("ywlptyuqh", model.value().get(0).interfaces().get(0).identifier()); - Assertions.assertEquals("mc", model.value().get(0).interfaces().get(0).interfaceType()); - Assertions.assertEquals("lxcznn", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkDeviceSkusListResult model = - new NetworkDeviceSkusListResult() - .withValue( - Arrays - .asList( - new NetworkDeviceSkuInner() - .withModel("jnhj") - .withManufacturer("tif") - .withSupportedVersions( - Arrays - .asList( - new SupportedVersionProperties() - .withVersion("ngkegxcypxbbfe") - .withVendorOsVersion("ilyrzoxp") - .withVendorFirmwareVersion("qlf") - .withIsDefault(BooleanEnumProperty.FALSE), - new SupportedVersionProperties() - .withVersion("ow") - .withVendorOsVersion("iu") - .withVendorFirmwareVersion("ewnahwkxjjmzt") - .withIsDefault(BooleanEnumProperty.TRUE), - new SupportedVersionProperties() - .withVersion("oodtm") - .withVendorOsVersion("cdhdyswcrpt") - .withVendorFirmwareVersion("ajczxvl") - .withIsDefault(BooleanEnumProperty.TRUE))) - .withSupportedRoleTypes( - Arrays - .asList( - NetworkDeviceRoleName.NPB, - NetworkDeviceRoleName.TS, - NetworkDeviceRoleName.TOR)) - .withInterfaces( - Arrays - .asList( - new DeviceInterfaceProperties() - .withIdentifier("ywlptyuqh") - .withInterfaceType("mc") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties(), - new SupportedConnectorProperties())), - new DeviceInterfaceProperties() - .withIdentifier("pfuofixcnpcfykkp") - .withInterfaceType("cpawmp") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties(), - new SupportedConnectorProperties())), - new DeviceInterfaceProperties() - .withIdentifier("pwr") - .withInterfaceType("fpcfjf") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties(), - new SupportedConnectorProperties(), - new SupportedConnectorProperties(), - new SupportedConnectorProperties())))), - new NetworkDeviceSkuInner() - .withModel("huosgwqpsqaz") - .withManufacturer("qodvqgcnbhcbmj") - .withSupportedVersions( - Arrays - .asList( - new SupportedVersionProperties() - .withVersion("bn") - .withVendorOsVersion("ntsxjmfmeftvh") - .withVendorFirmwareVersion("o") - .withIsDefault(BooleanEnumProperty.FALSE))) - .withSupportedRoleTypes(Arrays.asList(NetworkDeviceRoleName.NPB)) - .withInterfaces( - Arrays - .asList( - new DeviceInterfaceProperties() - .withIdentifier("gmjgrul") - .withInterfaceType("ogxhcxn") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties(), - new SupportedConnectorProperties(), - new SupportedConnectorProperties(), - new SupportedConnectorProperties())), - new DeviceInterfaceProperties() - .withIdentifier("fdz") - .withInterfaceType("ouzfwofwakuk") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties(), - new SupportedConnectorProperties())), - new DeviceInterfaceProperties() - .withIdentifier("zxsoednl") - .withInterfaceType("li") - .withSupportedConnectorTypes( - Arrays - .asList( - new SupportedConnectorProperties(), - new SupportedConnectorProperties(), - new SupportedConnectorProperties(), - new SupportedConnectorProperties())))))) - .withNextLink("lxcznn"); - model = BinaryData.fromObject(model).toObject(NetworkDeviceSkusListResult.class); - Assertions.assertEquals("jnhj", model.value().get(0).model()); - Assertions.assertEquals("tif", model.value().get(0).manufacturer()); - Assertions.assertEquals("ngkegxcypxbbfe", model.value().get(0).supportedVersions().get(0).version()); - Assertions.assertEquals("ilyrzoxp", model.value().get(0).supportedVersions().get(0).vendorOsVersion()); - Assertions.assertEquals("qlf", model.value().get(0).supportedVersions().get(0).vendorFirmwareVersion()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.value().get(0).supportedVersions().get(0).isDefault()); - Assertions.assertEquals(NetworkDeviceRoleName.NPB, model.value().get(0).supportedRoleTypes().get(0)); - Assertions.assertEquals("ywlptyuqh", model.value().get(0).interfaces().get(0).identifier()); - Assertions.assertEquals("mc", model.value().get(0).interfaces().get(0).interfaceType()); - Assertions.assertEquals("lxcznn", model.nextLink()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateMockTests.java deleted file mode 100644 index 29403f6d2662..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateMockTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevice; -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 NetworkDevicesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"version\":\"lnuzgz\",\"networkDeviceSku\":\"xdusebkc\",\"networkDeviceRole\":\"ToR\",\"networkRackId\":\"punt\",\"managementIpv4Address\":\"masuiqrsnm\",\"managementIpv6Address\":\"ubqwxvsxrbiyzjl\",\"configurationState\":\"Accepted\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"RMA\",\"hostName\":\"ukbocsitsxhvsgzp\",\"serialNumber\":\"ieyxjkctyq\",\"annotation\":\"tampq\"},\"location\":\"eftmub\",\"tags\":{\"zeq\":\"oepeqlhbtysy\",\"gyzwfyfdbvoo\":\"ctpqnofkw\",\"iyqmlmw\":\"lmikdsqqykgjjsmv\",\"cvemmriyz\":\"wsmnwbm\"},\"id\":\"vque\",\"name\":\"xplcsinb\",\"type\":\"lolxxhcyn\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkDevice response = - manager - .networkDevices() - .define("gseqjte") - .withRegion("mqaxtmvmyc") - .withExistingResourceGroup("zolrvw") - .withTags(mapOf("yvn", "axjdqvvyje", "rdvhbgtuhwh", "jngoq")) - .withNetworkDeviceSku("bpvsobamtarir") - .withHostname("nbxxyfozbgody") - .withSerialNumber("jikfrxvl") - .withAnnotation("edpnk") - .create(); - - Assertions.assertEquals("eftmub", response.location()); - Assertions.assertEquals("oepeqlhbtysy", response.tags().get("zeq")); - Assertions.assertEquals("xdusebkc", response.networkDeviceSku()); - Assertions.assertEquals("ukbocsitsxhvsgzp", response.hostname()); - Assertions.assertEquals("ieyxjkctyq", response.serialNumber()); - Assertions.assertEquals("tampq", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index f77e6f21c49b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevice; -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 NetworkDevicesGetByResourceGroupWithResponseMockTests { - @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\":{\"version\":\"dgktl\",\"networkDeviceSku\":\"fiqgpqcpen\",\"networkDeviceRole\":\"Management\",\"networkRackId\":\"sbeespqbvva\",\"managementIpv4Address\":\"szsu\",\"managementIpv6Address\":\"sautbri\",\"configurationState\":\"ErrorProvisioning\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Enabled\",\"hostName\":\"ntzunhyyqxckdlx\",\"serialNumber\":\"isrdnowinc\",\"annotation\":\"sfvijnubxfiiy\"},\"location\":\"xewjsyutezl\",\"tags\":{\"gecyqoytwssb\":\"voxdporxkivbkut\",\"dwdmuvya\":\"qnp\",\"blzrmiukothyfjbp\":\"rbqpwx\",\"cjni\":\"hdhfrvsizfwgn\"},\"id\":\"ffwcgjjio\",\"name\":\"wuuogdkpnmwrfu\",\"type\":\"jdebyxqucnbgib\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkDevice response = - manager - .networkDevices() - .getByResourceGroupWithResponse("ccvufjqv", "cfsssmyaemkrh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xewjsyutezl", response.location()); - Assertions.assertEquals("voxdporxkivbkut", response.tags().get("gecyqoytwssb")); - Assertions.assertEquals("fiqgpqcpen", response.networkDeviceSku()); - Assertions.assertEquals("ntzunhyyqxckdlx", response.hostname()); - Assertions.assertEquals("isrdnowinc", response.serialNumber()); - Assertions.assertEquals("sfvijnubxfiiy", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListByResourceGroupMockTests.java deleted file mode 100644 index eee5a4b8b8c1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevice; -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 NetworkDevicesListByResourceGroupMockTests { - @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\":{\"version\":\"wdkouzyvi\",\"networkDeviceSku\":\"v\",\"networkDeviceRole\":\"CE\",\"networkRackId\":\"mtsmgkre\",\"managementIpv4Address\":\"ny\",\"managementIpv6Address\":\"eulbyzz\",\"configurationState\":\"Failed\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Enabled\",\"hostName\":\"myckdpzbr\",\"serialNumber\":\"mljrjyfjleuxix\",\"annotation\":\"sjldg\"},\"location\":\"mqoacfqzx\",\"tags\":{\"efq\":\"qcsotwqtkpdc\"},\"id\":\"ermgmgnddaxaog\",\"name\":\"khcm\",\"type\":\"mbipysehyyb\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.networkDevices().listByResourceGroup("l", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mqoacfqzx", response.iterator().next().location()); - Assertions.assertEquals("qcsotwqtkpdc", response.iterator().next().tags().get("efq")); - Assertions.assertEquals("v", response.iterator().next().networkDeviceSku()); - Assertions.assertEquals("myckdpzbr", response.iterator().next().hostname()); - Assertions.assertEquals("mljrjyfjleuxix", response.iterator().next().serialNumber()); - Assertions.assertEquals("sjldg", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListMockTests.java deleted file mode 100644 index de55546d5969..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevice; -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 NetworkDevicesListMockTests { - @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\":{\"version\":\"fjcvmkkbpgdiwd\",\"networkDeviceSku\":\"hdtiemb\",\"networkDeviceRole\":\"ToR\",\"networkRackId\":\"vcwcehzrtrgpdlbt\",\"managementIpv4Address\":\"hyfwjfqktuzr\",\"managementIpv6Address\":\"pecsdk\",\"configurationState\":\"Succeeded\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"MAT\",\"hostName\":\"qjntvhnjpbhjlugc\",\"serialNumber\":\"cyfrho\",\"annotation\":\"v\"},\"location\":\"uxyeeafdxsuwly\",\"tags\":{\"pdxbhjquxk\":\"hgb\",\"dzwnkbjqp\":\"xqomzdfaupqve\",\"sochtuxap\":\"modwhqu\",\"q\":\"wz\"},\"id\":\"bx\",\"name\":\"ynslcvynavwtttsm\",\"type\":\"z\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkDevices().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("uxyeeafdxsuwly", response.iterator().next().location()); - Assertions.assertEquals("hgb", response.iterator().next().tags().get("pdxbhjquxk")); - Assertions.assertEquals("hdtiemb", response.iterator().next().networkDeviceSku()); - Assertions.assertEquals("qjntvhnjpbhjlugc", response.iterator().next().hostname()); - Assertions.assertEquals("cyfrho", response.iterator().next().serialNumber()); - Assertions.assertEquals("v", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListResultTests.java deleted file mode 100644 index daa3543ec613..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListResultTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceInner; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevicesListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkDevicesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkDevicesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"version\":\"p\",\"networkDeviceSku\":\"rwqirvtktyhhmvf\",\"networkDeviceRole\":\"NPB\",\"networkRackId\":\"jajodmkrr\",\"managementIpv4Address\":\"pgqvqo\",\"managementIpv6Address\":\"lujqgi\",\"configurationState\":\"Succeeded\",\"provisioningState\":\"Failed\",\"administrativeState\":\"MAT\",\"hostName\":\"chpqvctsfaeuhww\",\"serialNumber\":\"nstvzuzhasup\",\"annotation\":\"p\"},\"location\":\"pgzvzqazvbka\",\"tags\":{\"s\":\"tgongrua\",\"igbeqn\":\"iysjqhe\",\"yjdeayscseyd\":\"uba\"},\"id\":\"jemexmnv\",\"name\":\"vmuw\",\"type\":\"xlniwmcpm\"},{\"properties\":{\"version\":\"dlhvdv\",\"networkDeviceSku\":\"phbeaeqjz\",\"networkDeviceRole\":\"TS\",\"networkRackId\":\"clacr\",\"managementIpv4Address\":\"zfmunerkelux\",\"managementIpv6Address\":\"hxze\",\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"MAT\",\"hostName\":\"evzske\",\"serialNumber\":\"gwfsgqkstyecupyu\",\"annotation\":\"p\"},\"location\":\"davsjcfmazpz\",\"tags\":{\"izekuvfrj\":\"uzvcmcok\",\"ajbvbn\":\"ucaonz\",\"idgzwdydamis\":\"rdemdidack\",\"xkqejtpjfojiunr\":\"pztdivyk\"},\"id\":\"shxuknsykdtoi\",\"name\":\"oancdrco\",\"type\":\"nvxuldxonckb\"},{\"properties\":{\"version\":\"blfxlupibaqzi\",\"networkDeviceSku\":\"zpzwegh\",\"networkDeviceRole\":\"TS\",\"networkRackId\":\"ogvgfklqiyn\",\"managementIpv4Address\":\"eqelsb\",\"managementIpv6Address\":\"dstrkzxsgtz\",\"configurationState\":\"Succeeded\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"Disabled\",\"hostName\":\"o\",\"serialNumber\":\"im\",\"annotation\":\"dnox\"},\"location\":\"nrqa\",\"tags\":{\"lousdvrgptqm\":\"nndx\",\"drpizfulgyctsdb\":\"wz\",\"oxrqw\":\"qgkujds\",\"ejdpdfhtwm\":\"eurbtigapdyarik\"},\"id\":\"kfqbriqulwwt\",\"name\":\"jmeqkvy\",\"type\":\"zokpoy\"}],\"nextLink\":\"h\"}") - .toObject(NetworkDevicesListResult.class); - Assertions.assertEquals("pgzvzqazvbka", model.value().get(0).location()); - Assertions.assertEquals("tgongrua", model.value().get(0).tags().get("s")); - Assertions.assertEquals("rwqirvtktyhhmvf", model.value().get(0).networkDeviceSku()); - Assertions.assertEquals("chpqvctsfaeuhww", model.value().get(0).hostname()); - Assertions.assertEquals("nstvzuzhasup", model.value().get(0).serialNumber()); - Assertions.assertEquals("p", model.value().get(0).annotation()); - Assertions.assertEquals("h", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkDevicesListResult model = - new NetworkDevicesListResult() - .withValue( - Arrays - .asList( - new NetworkDeviceInner() - .withLocation("pgzvzqazvbka") - .withTags(mapOf("s", "tgongrua", "igbeqn", "iysjqhe", "yjdeayscseyd", "uba")) - .withNetworkDeviceSku("rwqirvtktyhhmvf") - .withHostname("chpqvctsfaeuhww") - .withSerialNumber("nstvzuzhasup") - .withAnnotation("p"), - new NetworkDeviceInner() - .withLocation("davsjcfmazpz") - .withTags( - mapOf( - "izekuvfrj", - "uzvcmcok", - "ajbvbn", - "ucaonz", - "idgzwdydamis", - "rdemdidack", - "xkqejtpjfojiunr", - "pztdivyk")) - .withNetworkDeviceSku("phbeaeqjz") - .withHostname("evzske") - .withSerialNumber("gwfsgqkstyecupyu") - .withAnnotation("p"), - new NetworkDeviceInner() - .withLocation("nrqa") - .withTags( - mapOf( - "lousdvrgptqm", - "nndx", - "drpizfulgyctsdb", - "wz", - "oxrqw", - "qgkujds", - "ejdpdfhtwm", - "eurbtigapdyarik")) - .withNetworkDeviceSku("zpzwegh") - .withHostname("o") - .withSerialNumber("im") - .withAnnotation("dnox"))) - .withNextLink("h"); - model = BinaryData.fromObject(model).toObject(NetworkDevicesListResult.class); - Assertions.assertEquals("pgzvzqazvbka", model.value().get(0).location()); - Assertions.assertEquals("tgongrua", model.value().get(0).tags().get("s")); - Assertions.assertEquals("rwqirvtktyhhmvf", model.value().get(0).networkDeviceSku()); - Assertions.assertEquals("chpqvctsfaeuhww", model.value().get(0).hostname()); - Assertions.assertEquals("nstvzuzhasup", model.value().get(0).serialNumber()); - Assertions.assertEquals("p", model.value().get(0).annotation()); - Assertions.assertEquals("h", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRebootMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRebootMockTests.java deleted file mode 100644 index 800a5b363bf2..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRebootMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.RebootProperties; -import com.azure.resourcemanager.managednetworkfabric.models.RebootType; -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 NetworkDevicesRebootMockTests { - @Test - public void testReboot() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"DeferredControl\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .networkDevices() - .reboot( - "oddcaqi", - "o", - new RebootProperties().withRebootType(RebootType.GRACEFUL_REBOOT_WITHOUT_ZTP), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRefreshConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRefreshConfigurationMockTests.java deleted file mode 100644 index 75518cdfdd79..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRefreshConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -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 NetworkDevicesRefreshConfigurationMockTests { - @Test - public void testRefreshConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Deprovisioning\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager.networkDevices().refreshConfiguration("xkhbucmzkqt", "fja", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateAdministrativeStateMockTests.java deleted file mode 100644 index abaf8e819abc..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.DeviceAdministrativeState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateDeviceAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NetworkDevicesUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Accepted\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .networkDevices() - .updateAdministrativeState( - "vcebgo", - "jfyplavb", - new UpdateDeviceAdministrativeState() - .withResourceIds(Arrays.asList("dsoqwexiebnz", "teikf")) - .withState(DeviceAdministrativeState.GRACEFUL_QUARANTINE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpgradeMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpgradeMockTests.java deleted file mode 100644 index 3a567c216feb..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpgradeMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersion; -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 NetworkDevicesUpgradeMockTests { - @Test - public void testUpgrade() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Rejected\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .networkDevices() - .upgrade( - "fadgywylavetq", - "vohy", - new UpdateVersion().withVersion("dgjtpbtkogfg"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkuInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkuInnerTests.java deleted file mode 100644 index 814dd2840d69..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkuInnerTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner; -import org.junit.jupiter.api.Assertions; - -public final class NetworkFabricSkuInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkFabricSkuInner model = - BinaryData - .fromString( - "{\"properties\":{\"type\":\"MultiRack\",\"maxComputeRacks\":496223976,\"maximumServerCount\":1319155554,\"supportedVersions\":[\"mmzng\"],\"details\":\"fr\",\"provisioningState\":\"Accepted\"},\"id\":\"pwyiulayno\",\"name\":\"ugkfhaxttpfsm\",\"type\":\"gsgh\"}") - .toObject(NetworkFabricSkuInner.class); - Assertions.assertEquals(496223976, model.maxComputeRacks()); - Assertions.assertEquals(1319155554, model.maximumServerCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkFabricSkuInner model = - new NetworkFabricSkuInner().withMaxComputeRacks(496223976).withMaximumServerCount(1319155554); - model = BinaryData.fromObject(model).toObject(NetworkFabricSkuInner.class); - Assertions.assertEquals(496223976, model.maxComputeRacks()); - Assertions.assertEquals(1319155554, model.maximumServerCount()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkuPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkuPropertiesTests.java deleted file mode 100644 index 6efd5ed6369d..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkuPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuProperties; -import org.junit.jupiter.api.Assertions; - -public final class NetworkFabricSkuPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkFabricSkuProperties model = - BinaryData - .fromString( - "{\"type\":\"SingleRack\",\"maxComputeRacks\":982301337,\"maximumServerCount\":513170915,\"supportedVersions\":[\"uqmllfeothxu\",\"rigrjdljlkq\",\"vkrbzkuastaxklpr\"],\"details\":\"l\",\"provisioningState\":\"Accepted\"}") - .toObject(NetworkFabricSkuProperties.class); - Assertions.assertEquals(982301337, model.maxComputeRacks()); - Assertions.assertEquals(513170915, model.maximumServerCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkFabricSkuProperties model = - new NetworkFabricSkuProperties().withMaxComputeRacks(982301337).withMaximumServerCount(513170915); - model = BinaryData.fromObject(model).toObject(NetworkFabricSkuProperties.class); - Assertions.assertEquals(982301337, model.maxComputeRacks()); - Assertions.assertEquals(513170915, model.maximumServerCount()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusGetWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusGetWithResponseMockTests.java deleted file mode 100644 index 6c296855dc00..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricSku; -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 NetworkFabricSkusGetWithResponseMockTests { - @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\":{\"type\":\"SingleRack\",\"maxComputeRacks\":64386936,\"maximumServerCount\":1158976419,\"supportedVersions\":[\"vruuhyncppmmwh\"],\"details\":\"rlurgip\",\"provisioningState\":\"Deleting\"},\"id\":\"xlepsmck\",\"name\":\"pxdxgcqmguvd\",\"type\":\"oiihrfcowlas\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkFabricSku response = - manager.networkFabricSkus().getWithResponse("psotbame", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(64386936, response.maxComputeRacks()); - Assertions.assertEquals(1158976419, response.maximumServerCount()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusListMockTests.java deleted file mode 100644 index 0cb73e94eb20..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusListMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricSku; -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 NetworkFabricSkusListMockTests { - @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\":{\"type\":\"MultiRack\",\"maxComputeRacks\":1861846779,\"maximumServerCount\":1040205889,\"supportedVersions\":[\"ylaqh\"],\"details\":\"vf\",\"provisioningState\":\"Updating\"},\"id\":\"vjhwgkynxlwrjgo\",\"name\":\"dtmck\",\"type\":\"kalhpiybfnkylz\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkFabricSkus().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(1861846779, response.iterator().next().maxComputeRacks()); - Assertions.assertEquals(1040205889, response.iterator().next().maximumServerCount()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusListResultTests.java deleted file mode 100644 index 3eb81c3e89cf..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusListResultTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricSkusListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkFabricSkusListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkFabricSkusListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"type\":\"MultiRack\",\"maxComputeRacks\":844024628,\"maximumServerCount\":1036553043,\"supportedVersions\":[\"sgfy\",\"skyekgafxczv\",\"cckwrtwle\"],\"details\":\"veszrtlhpdhw\",\"provisioningState\":\"Canceled\"},\"id\":\"tacz\",\"name\":\"njfmbbfnvjxit\",\"type\":\"ovnkrtiklsmnihql\"},{\"properties\":{\"type\":\"MultiRack\",\"maxComputeRacks\":688911413,\"maximumServerCount\":357291580,\"supportedVersions\":[\"hyxwbgbud\",\"vqdorbccqcd\"],\"details\":\"hojvlirkn\",\"provisioningState\":\"Failed\"},\"id\":\"sawrdtn\",\"name\":\"gzlgpyaixihz\",\"type\":\"jjtsm\"}],\"nextLink\":\"dqftt\"}") - .toObject(NetworkFabricSkusListResult.class); - Assertions.assertEquals(844024628, model.value().get(0).maxComputeRacks()); - Assertions.assertEquals(1036553043, model.value().get(0).maximumServerCount()); - Assertions.assertEquals("dqftt", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkFabricSkusListResult model = - new NetworkFabricSkusListResult() - .withValue( - Arrays - .asList( - new NetworkFabricSkuInner() - .withMaxComputeRacks(844024628) - .withMaximumServerCount(1036553043), - new NetworkFabricSkuInner() - .withMaxComputeRacks(688911413) - .withMaximumServerCount(357291580))) - .withNextLink("dqftt"); - model = BinaryData.fromObject(model).toObject(NetworkFabricSkusListResult.class); - Assertions.assertEquals(844024628, model.value().get(0).maxComputeRacks()); - Assertions.assertEquals(1036553043, model.value().get(0).maximumServerCount()); - Assertions.assertEquals("dqftt", model.nextLink()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCommitConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCommitConfigurationMockTests.java deleted file mode 100644 index d9572cce980f..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCommitConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -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 NetworkFabricsCommitConfigurationMockTests { - @Test - public void testCommitConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"DeferredControl\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager.networkFabrics().commitConfiguration("vopvfgu", "rxumwdqwy", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeprovisionMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeprovisionMockTests.java deleted file mode 100644 index b00bdc61606b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeprovisionMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate; -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 NetworkFabricsDeprovisionMockTests { - @Test - public void testDeprovision() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"configurationState\":\"Accepted\",\"successfulDevices\":[\"fysalbjfkjex\",\"fzmhkridip\",\"c\",\"jnn\"],\"failedDevices\":[\"fjqhjenbdu\",\"fpllosadjffllrs\",\"g\"]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForDeviceUpdate response = - manager.networkFabrics().deprovision("mhmeoxx", "zagwnompvyis", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fysalbjfkjex", response.successfulDevices().get(0)); - Assertions.assertEquals("fjqhjenbdu", response.failedDevices().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsGetTopologyMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsGetTopologyMockTests.java deleted file mode 100644 index 637ba55d54e7..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsGetTopologyMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationResponse; -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 NetworkFabricsGetTopologyMockTests { - @Test - public void testGetTopology() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"DeferredControl\",\"url\":\"msdnm\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateConfigurationResponse response = - manager.networkFabrics().getTopology("ehyl", "nayypsx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("msdnm", response.url()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsProvisionMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsProvisionMockTests.java deleted file mode 100644 index 648b210fdcd2..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsProvisionMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate; -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 NetworkFabricsProvisionMockTests { - @Test - public void testProvision() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"configurationState\":\"Failed\",\"successfulDevices\":[\"xzxwrnqwdjvlw\",\"zxyylwsfxqcmej\",\"zjcbciua\",\"ak\"],\"failedDevices\":[\"wwmavllpfjguzsyf\"]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForDeviceUpdate response = - manager.networkFabrics().provision("b", "auhejmsw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xzxwrnqwdjvlw", response.successfulDevices().get(0)); - Assertions.assertEquals("wwmavllpfjguzsyf", response.failedDevices().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsRefreshConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsRefreshConfigurationMockTests.java deleted file mode 100644 index 0a34ed46ac91..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsRefreshConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -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 NetworkFabricsRefreshConfigurationMockTests { - @Test - public void testRefreshConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Deprovisioned\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager.networkFabrics().refreshConfiguration("qgzcojgdqjh", "fe", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateInfraManagementBfdConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateInfraManagementBfdConfigurationMockTests.java deleted file mode 100644 index 188912cadcb8..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateInfraManagementBfdConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NetworkFabricsUpdateInfraManagementBfdConfigurationMockTests { - @Test - public void testUpdateInfraManagementBfdConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Rejected\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .networkFabrics() - .updateInfraManagementBfdConfiguration( - "pcifdvt", - "uncnf", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("myubhtmlg", "aickym", "dwirglqib")) - .withState(EnableDisableState.ENABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateWorkloadManagementBfdConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateWorkloadManagementBfdConfigurationMockTests.java deleted file mode 100644 index 1b0453c0e156..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateWorkloadManagementBfdConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NetworkFabricsUpdateWorkloadManagementBfdConfigurationMockTests { - @Test - public void testUpdateWorkloadManagementBfdConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Provisioned\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .networkFabrics() - .updateWorkloadManagementBfdConfiguration( - "jnydkkgbvsqks", - "gkvga", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("qqiwfysuj", "vhclg", "exrxyrpwzsmwgeb")) - .withState(EnableDisableState.DISABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpgradeMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpgradeMockTests.java deleted file mode 100644 index f998ec5aa66e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpgradeMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersion; -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 NetworkFabricsUpgradeMockTests { - @Test - public void testUpgrade() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Deprovisioning\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .networkFabrics() - .upgrade( - "yeok", - "dzuddcccls", - new UpdateVersion().withVersion("lcxxpmnypktgslk"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsValidateConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsValidateConfigurationMockTests.java deleted file mode 100644 index 89377fde3232..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsValidateConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateAction; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationResponse; -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 NetworkFabricsValidateConfigurationMockTests { - @Test - public void testValidateConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"ErrorDeprovisioning\",\"url\":\"zmxxi\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateConfigurationResponse response = - manager - .networkFabrics() - .validateConfiguration( - "kaw", - "uxbzfhurrw", - new ValidateConfigurationProperties().withValidateAction(ValidateAction.CABLING), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zmxxi", response.url()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfaceInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfaceInnerTests.java deleted file mode 100644 index 7d822a1a4b6e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfaceInnerTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner; -import org.junit.jupiter.api.Assertions; - -public final class NetworkInterfaceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkInterfaceInner model = - BinaryData - .fromString( - "{\"properties\":{\"physicalIdentifier\":\"nsnaajphmp\",\"connectedTo\":\"jnglpwsad\",\"interfaceType\":\"Data\",\"ipv4Address\":\"umxpezcoi\",\"ipv6Address\":\"jrmfqzwqd\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"Enabled\",\"annotation\":\"c\"},\"id\":\"wmywxfqzkvemy\",\"name\":\"dpczaqpqifd\",\"type\":\"m\"}") - .toObject(NetworkInterfaceInner.class); - Assertions.assertEquals("c", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkInterfaceInner model = new NetworkInterfaceInner().withAnnotation("c"); - model = BinaryData.fromObject(model).toObject(NetworkInterfaceInner.class); - Assertions.assertEquals("c", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacePatchPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacePatchPropertiesTests.java deleted file mode 100644 index 25391e56e075..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacePatchPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfacePatchProperties; -import org.junit.jupiter.api.Assertions; - -public final class NetworkInterfacePatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkInterfacePatchProperties model = - BinaryData.fromString("{\"annotation\":\"yqhfnkv\"}").toObject(NetworkInterfacePatchProperties.class); - Assertions.assertEquals("yqhfnkv", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkInterfacePatchProperties model = new NetworkInterfacePatchProperties().withAnnotation("yqhfnkv"); - model = BinaryData.fromObject(model).toObject(NetworkInterfacePatchProperties.class); - Assertions.assertEquals("yqhfnkv", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacePatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacePatchTests.java deleted file mode 100644 index 926ce6aa1491..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacePatchTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterfacePatch; -import org.junit.jupiter.api.Assertions; - -public final class NetworkInterfacePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkInterfacePatch model = - BinaryData - .fromString("{\"properties\":{\"annotation\":\"likyohz\"}}") - .toObject(NetworkInterfacePatch.class); - Assertions.assertEquals("likyohz", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkInterfacePatch model = new NetworkInterfacePatch().withAnnotation("likyohz"); - model = BinaryData.fromObject(model).toObject(NetworkInterfacePatch.class); - Assertions.assertEquals("likyohz", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacePropertiesTests.java deleted file mode 100644 index 389c3ff4a58f..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacePropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceProperties; -import org.junit.jupiter.api.Assertions; - -public final class NetworkInterfacePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkInterfaceProperties model = - BinaryData - .fromString( - "{\"physicalIdentifier\":\"rwtx\",\"connectedTo\":\"isamonatniz\",\"interfaceType\":\"Management\",\"ipv4Address\":\"qsqjghrmthsplwst\",\"ipv6Address\":\"srgxfq\",\"provisioningState\":\"Updating\",\"administrativeState\":\"Enabled\",\"annotation\":\"ovxgzwhsxyrujmti\"}") - .toObject(NetworkInterfaceProperties.class); - Assertions.assertEquals("ovxgzwhsxyrujmti", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkInterfaceProperties model = new NetworkInterfaceProperties().withAnnotation("ovxgzwhsxyrujmti"); - model = BinaryData.fromObject(model).toObject(NetworkInterfaceProperties.class); - Assertions.assertEquals("ovxgzwhsxyrujmti", model.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesCreateMockTests.java deleted file mode 100644 index f2b25de7b5e0..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesCreateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterface; -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 NetworkInterfacesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"physicalIdentifier\":\"svrljlhejccc\",\"connectedTo\":\"bnwitafjjevp\",\"interfaceType\":\"Management\",\"ipv4Address\":\"ghzqwvkparskpl\",\"ipv6Address\":\"tqc\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"RMA\",\"annotation\":\"dcy\"},\"id\":\"gul\",\"name\":\"llfwrmsuxyq\",\"type\":\"mqoubxlpkdsn\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkInterface response = - manager - .networkInterfaces() - .define("mpgqqdhtct") - .withExistingNetworkDevice("totktd", "ewwlkry") - .withAnnotation("xdbisihumwafapct") - .create(); - - Assertions.assertEquals("dcy", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetWithResponseMockTests.java deleted file mode 100644 index 0120fc80dace..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterface; -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 NetworkInterfacesGetWithResponseMockTests { - @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\":{\"physicalIdentifier\":\"yjl\",\"connectedTo\":\"albcyuwahwzagvai\",\"interfaceType\":\"Data\",\"ipv4Address\":\"phnhn\",\"ipv6Address\":\"gyfzkhism\",\"provisioningState\":\"Updating\",\"administrativeState\":\"Disabled\",\"annotation\":\"prjbpertjpairpw\"},\"id\":\"mcgiwsywpe\",\"name\":\"tvqopugrse\",\"type\":\"giuztqefzypul\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkInterface response = - manager - .networkInterfaces() - .getWithResponse("mvaizv", "wqqpwcidsjqcqyz", "rtfdlgp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("prjbpertjpairpw", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesListByNetworkDeviceMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesListByNetworkDeviceMockTests.java deleted file mode 100644 index 0bf91a202dad..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesListByNetworkDeviceMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterface; -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 NetworkInterfacesListByNetworkDeviceMockTests { - @Test - public void testListByNetworkDevice() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"physicalIdentifier\":\"ukqmkiynbfvk\",\"connectedTo\":\"mq\",\"interfaceType\":\"Data\",\"ipv4Address\":\"tcctirgyu\",\"ipv6Address\":\"x\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"Disabled\",\"annotation\":\"gvjbryb\"},\"id\":\"arkhkoqcud\",\"name\":\"wmoyhd\",\"type\":\"jjhq\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .networkInterfaces() - .listByNetworkDevice("dmcbc", "ndidhuepikwcxoa", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gvjbryb", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesListTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesListTests.java deleted file mode 100644 index 83e5c73ee646..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesListTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterfacesList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkInterfacesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkInterfacesList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"physicalIdentifier\":\"qdseipnquwzxhrp\",\"connectedTo\":\"odlhkfktl\",\"interfaceType\":\"Data\",\"ipv4Address\":\"objopnou\",\"ipv6Address\":\"qezkqxs\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"MAT\",\"annotation\":\"gfcvcewbwq\"},\"id\":\"dgsjsat\",\"name\":\"rncmazdfsqxh\",\"type\":\"qmr\"},{\"properties\":{\"physicalIdentifier\":\"parn\",\"connectedTo\":\"grszrbwtdrcwg\",\"interfaceType\":\"Management\",\"ipv4Address\":\"xzlh\",\"ipv6Address\":\"ix\",\"provisioningState\":\"Updating\",\"administrativeState\":\"Enabled\",\"annotation\":\"zjrmhpfywvyld\"},\"id\":\"pzfzxsoxinunjlz\",\"name\":\"drocqsxytq\",\"type\":\"tcmiwd\"},{\"properties\":{\"physicalIdentifier\":\"svnmeylajamcajy\",\"connectedTo\":\"tpzcr\",\"interfaceType\":\"Management\",\"ipv4Address\":\"leyn\",\"ipv6Address\":\"nhkigg\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Enabled\",\"annotation\":\"hvubhgzphetxdqc\"},\"id\":\"yctajqz\",\"name\":\"vale\",\"type\":\"xb\"},{\"properties\":{\"physicalIdentifier\":\"i\",\"connectedTo\":\"sd\",\"interfaceType\":\"Management\",\"ipv4Address\":\"sbfpzvoikvntwcz\",\"ipv6Address\":\"wushlcxpbl\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"Disabled\",\"annotation\":\"p\"},\"id\":\"kissaidqzsaa\",\"name\":\"qdsgptotxj\",\"type\":\"fiafc\"}],\"nextLink\":\"r\"}") - .toObject(NetworkInterfacesList.class); - Assertions.assertEquals("gfcvcewbwq", model.value().get(0).annotation()); - Assertions.assertEquals("r", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkInterfacesList model = - new NetworkInterfacesList() - .withValue( - Arrays - .asList( - new NetworkInterfaceInner().withAnnotation("gfcvcewbwq"), - new NetworkInterfaceInner().withAnnotation("zjrmhpfywvyld"), - new NetworkInterfaceInner().withAnnotation("hvubhgzphetxdqc"), - new NetworkInterfaceInner().withAnnotation("p"))) - .withNextLink("r"); - model = BinaryData.fromObject(model).toObject(NetworkInterfacesList.class); - Assertions.assertEquals("gfcvcewbwq", model.value().get(0).annotation()); - Assertions.assertEquals("r", model.nextLink()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateAdministrativeStateMockTests.java deleted file mode 100644 index e9e6f6e0575a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NetworkInterfacesUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Succeeded\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .networkInterfaces() - .updateAdministrativeState( - "zcbjfpxoy", - "nm", - "niqw", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("fknjqsstnwvravn", "vklkwqisnlpa")) - .withState(EnableDisableState.ENABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokerInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokerInnerTests.java deleted file mode 100644 index 9364c0c64a26..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokerInnerTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkPacketBrokerInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkPacketBrokerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkPacketBrokerInner model = - BinaryData - .fromString( - "{\"properties\":{\"networkFabricId\":\"ugejcvjkjyczcmt\",\"networkDeviceIds\":[\"lajdyoljeqyxq\",\"mzsizzhravrcjk\"],\"sourceInterfaceIds\":[\"gqb\",\"cxhnqxgzxlerm\",\"merghski\"],\"networkTapIds\":[\"pupkcbkfukd\",\"jqnvtsdyd\",\"hkpafyaloowwzizz\"],\"neighborGroupIds\":[\"f\"],\"provisioningState\":\"Accepted\"},\"location\":\"ti\",\"tags\":{\"qiyv\":\"fyjfd\"},\"id\":\"djokgwesym\",\"name\":\"qh\",\"type\":\"qpfzlpejtznxlue\"}") - .toObject(NetworkPacketBrokerInner.class); - Assertions.assertEquals("ti", model.location()); - Assertions.assertEquals("fyjfd", model.tags().get("qiyv")); - Assertions.assertEquals("ugejcvjkjyczcmt", model.networkFabricId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkPacketBrokerInner model = - new NetworkPacketBrokerInner() - .withLocation("ti") - .withTags(mapOf("qiyv", "fyjfd")) - .withNetworkFabricId("ugejcvjkjyczcmt"); - model = BinaryData.fromObject(model).toObject(NetworkPacketBrokerInner.class); - Assertions.assertEquals("ti", model.location()); - Assertions.assertEquals("fyjfd", model.tags().get("qiyv")); - Assertions.assertEquals("ugejcvjkjyczcmt", model.networkFabricId()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokerPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokerPatchTests.java deleted file mode 100644 index 21b14c2a31f6..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokerPatchTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkPacketBrokerPatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkPacketBrokerPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkPacketBrokerPatch model = - BinaryData - .fromString( - "{\"tags\":{\"fubnsnstlpwqpj\":\"vknmpecqxgiqas\",\"ouweuiyx\":\"xjkhtupsv\",\"znfhkqytk\":\"wkztsmsfbevyl\",\"fcycrsvlo\":\"tadopgfzdg\"}}") - .toObject(NetworkPacketBrokerPatch.class); - Assertions.assertEquals("vknmpecqxgiqas", model.tags().get("fubnsnstlpwqpj")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkPacketBrokerPatch model = - new NetworkPacketBrokerPatch() - .withTags( - mapOf( - "fubnsnstlpwqpj", - "vknmpecqxgiqas", - "ouweuiyx", - "xjkhtupsv", - "znfhkqytk", - "wkztsmsfbevyl", - "fcycrsvlo", - "tadopgfzdg")); - model = BinaryData.fromObject(model).toObject(NetworkPacketBrokerPatch.class); - Assertions.assertEquals("vknmpecqxgiqas", model.tags().get("fubnsnstlpwqpj")); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokerPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokerPropertiesTests.java deleted file mode 100644 index 679db7ab188f..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokerPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkPacketBrokerProperties; -import org.junit.jupiter.api.Assertions; - -public final class NetworkPacketBrokerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkPacketBrokerProperties model = - BinaryData - .fromString( - "{\"networkFabricId\":\"ujqbbgsimwejl\",\"networkDeviceIds\":[\"bpjzobdwbcpraswk\",\"hydt\",\"aczkf\",\"fatgawphnski\"],\"sourceInterfaceIds\":[\"gtqcumecsaaqgoq\",\"diuycsbskowkrbhz\"],\"networkTapIds\":[\"k\",\"tmqowiuasfgqg\",\"cyhfaimqvdru\"],\"neighborGroupIds\":[\"gyfpeoehgfmqmsk\",\"ixvlz\",\"xplhpeva\",\"yntvzjyielbq\"],\"provisioningState\":\"Deleting\"}") - .toObject(NetworkPacketBrokerProperties.class); - Assertions.assertEquals("ujqbbgsimwejl", model.networkFabricId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkPacketBrokerProperties model = new NetworkPacketBrokerProperties().withNetworkFabricId("ujqbbgsimwejl"); - model = BinaryData.fromObject(model).toObject(NetworkPacketBrokerProperties.class); - Assertions.assertEquals("ujqbbgsimwejl", model.networkFabricId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersCreateMockTests.java deleted file mode 100644 index 16a06792568f..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersCreateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkPacketBroker; -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 NetworkPacketBrokersCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"networkFabricId\":\"bncdrchuew\",\"networkDeviceIds\":[\"qcbonqjoekcjcgl\",\"obctit\",\"xrbalvkfdq\",\"lprqhxfq\"],\"sourceInterfaceIds\":[\"dyrqlazfjltckb\",\"vdxhyfv\",\"tde\"],\"networkTapIds\":[\"zpxalkqlvbkz\"],\"neighborGroupIds\":[\"rnwwoiviniyoizuw\",\"zcri\"],\"provisioningState\":\"Succeeded\"},\"location\":\"elnqalbsoqxajs\",\"tags\":{\"zbwxuypcuri\":\"aibqjb\",\"qdqtz\":\"llxtclv\",\"rymi\":\"hwlwj\",\"wbd\":\"sghhcmqdlk\"},\"id\":\"kbv\",\"name\":\"ulmka\",\"type\":\"dnxbssatpialrq\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkPacketBroker response = - manager - .networkPacketBrokers() - .define("qczzscgrop") - .withRegion("wvkuhtdxdcodzdh") - .withExistingResourceGroup("bsjtfqwlb") - .withNetworkFabricId("q") - .withTags(mapOf("vmxiundifuahtk", "m", "ayxnlvt", "ccrusrzsfoqodya", "o", "p")) - .create(); - - Assertions.assertEquals("elnqalbsoqxajs", response.location()); - Assertions.assertEquals("aibqjb", response.tags().get("zbwxuypcuri")); - Assertions.assertEquals("bncdrchuew", response.networkFabricId()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 2a18e70eab86..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkPacketBroker; -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 NetworkPacketBrokersGetByResourceGroupWithResponseMockTests { - @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\":{\"networkFabricId\":\"xh\",\"networkDeviceIds\":[\"ehcdfdxthqnztu\",\"ir\"],\"sourceInterfaceIds\":[\"ijdhzkwvueweivaj\",\"lswlxdknxctglzb\",\"xdfsgwigyiwbwju\",\"xzfvnazc\"],\"networkTapIds\":[\"hnqiyevjehts\",\"aoxxsehf\",\"fmabpyzxc\",\"lphfstvurtkc\"],\"neighborGroupIds\":[\"vaxwzbwxx\",\"disxsrrhr\",\"rbbedrn\"],\"provisioningState\":\"Deleting\"},\"location\":\"uimpiybm\",\"tags\":{\"suv\":\"ihcgxmfbi\",\"q\":\"qorhtqtw\",\"ichhxqnlmjvpmsd\":\"jcemia\",\"ouhysrmkkzj\":\"ibwvh\"},\"id\":\"nxzljxaayxpd\",\"name\":\"vgyujkxjge\",\"type\":\"zdbigitra\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkPacketBroker response = - manager - .networkPacketBrokers() - .getByResourceGroupWithResponse("tzbkeeohpf", "dxgdjudek", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("uimpiybm", response.location()); - Assertions.assertEquals("ihcgxmfbi", response.tags().get("suv")); - Assertions.assertEquals("xh", response.networkFabricId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersListByResourceGroupMockTests.java deleted file mode 100644 index 5f33c8b61657..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkPacketBroker; -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 NetworkPacketBrokersListByResourceGroupMockTests { - @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\":{\"networkFabricId\":\"bpi\",\"networkDeviceIds\":[\"bxq\",\"olixfelsrym\"],\"sourceInterfaceIds\":[\"zyfktba\",\"hasnjalkiyzlkqy\",\"zyzxkrdfdssof\",\"xyst\"],\"networkTapIds\":[\"qvikoiiqajfw\",\"ubfgoqvzbu\",\"iydoqbruxlx\"],\"neighborGroupIds\":[\"hed\",\"kzj\",\"r\"],\"provisioningState\":\"Failed\"},\"location\":\"zrtsei\",\"tags\":{\"adgzxbwn\":\"rwgznacmkwcyeljn\"},\"id\":\"yihct\",\"name\":\"u\",\"type\":\"mzozb\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.networkPacketBrokers().listByResourceGroup("udyrsir", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zrtsei", response.iterator().next().location()); - Assertions.assertEquals("rwgznacmkwcyeljn", response.iterator().next().tags().get("adgzxbwn")); - Assertions.assertEquals("bpi", response.iterator().next().networkFabricId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersListMockTests.java deleted file mode 100644 index b29830f87782..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkPacketBroker; -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 NetworkPacketBrokersListMockTests { - @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\":{\"networkFabricId\":\"htvughu\",\"networkDeviceIds\":[\"lm\",\"nfyfy\",\"tkvzbdl\"],\"sourceInterfaceIds\":[\"iumagfyinmajj\"],\"networkTapIds\":[\"gtwfk\"],\"neighborGroupIds\":[\"vbzk\",\"ebuafbddmcfq\",\"nml\",\"hgzzohta\"],\"provisioningState\":\"Deleting\"},\"location\":\"hdqhqgrksypoosfx\",\"tags\":{\"td\":\"ovsvh\"},\"id\":\"xgllmdeoubvfxi\",\"name\":\"wem\",\"type\":\"cjhmvvzeaicm\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.networkPacketBrokers().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hdqhqgrksypoosfx", response.iterator().next().location()); - Assertions.assertEquals("ovsvh", response.iterator().next().tags().get("td")); - Assertions.assertEquals("htvughu", response.iterator().next().networkFabricId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersListResultTests.java deleted file mode 100644 index 73ee0feeeed1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkPacketBrokersListResultTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkPacketBrokerInner; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkPacketBrokersListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkPacketBrokersListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkPacketBrokersListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"networkFabricId\":\"igqkzjuqwqa\",\"networkDeviceIds\":[\"zxpixhyo\"],\"sourceInterfaceIds\":[\"f\",\"bgsosc\",\"enezfvbennmfkbpj\",\"rtek\"],\"networkTapIds\":[\"thr\",\"pmdudsyiurzt\",\"ktjhffe\",\"q\"],\"neighborGroupIds\":[\"youergaghp\",\"zxkpyehhfdyld\"],\"provisioningState\":\"Accepted\"},\"location\":\"d\",\"tags\":{\"htdereun\":\"qiyu\",\"edznmxrfomckewv\":\"kakzwhpjlwy\",\"fjjtpdyzou\":\"yifop\"},\"id\":\"xfptofh\",\"name\":\"nuywe\",\"type\":\"ygv\"}],\"nextLink\":\"gaaqw\"}") - .toObject(NetworkPacketBrokersListResult.class); - Assertions.assertEquals("d", model.value().get(0).location()); - Assertions.assertEquals("qiyu", model.value().get(0).tags().get("htdereun")); - Assertions.assertEquals("igqkzjuqwqa", model.value().get(0).networkFabricId()); - Assertions.assertEquals("gaaqw", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkPacketBrokersListResult model = - new NetworkPacketBrokersListResult() - .withValue( - Arrays - .asList( - new NetworkPacketBrokerInner() - .withLocation("d") - .withTags( - mapOf("htdereun", "qiyu", "edznmxrfomckewv", "kakzwhpjlwy", "fjjtpdyzou", "yifop")) - .withNetworkFabricId("igqkzjuqwqa"))) - .withNextLink("gaaqw"); - model = BinaryData.fromObject(model).toObject(NetworkPacketBrokersListResult.class); - Assertions.assertEquals("d", model.value().get(0).location()); - Assertions.assertEquals("qiyu", model.value().get(0).tags().get("htdereun")); - Assertions.assertEquals("igqkzjuqwqa", model.value().get(0).networkFabricId()); - Assertions.assertEquals("gaaqw", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackInnerTests.java deleted file mode 100644 index 086c63096040..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackInnerTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackInner; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkRackInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkRackInner model = - BinaryData - .fromString( - "{\"properties\":{\"networkRackType\":\"Aggregate\",\"networkFabricId\":\"jpytp\",\"networkDevices\":[\"dnogehlufbor\"],\"provisioningState\":\"Deleting\",\"annotation\":\"kk\"},\"location\":\"xzsvbxxyji\",\"tags\":{\"qocl\":\"o\",\"oewyhxessmvrkd\":\"l\",\"bdxmd\":\"sqeq\"},\"id\":\"esbrujbjpppktl\",\"name\":\"dibfmthi\",\"type\":\"at\"}") - .toObject(NetworkRackInner.class); - Assertions.assertEquals("xzsvbxxyji", model.location()); - Assertions.assertEquals("o", model.tags().get("qocl")); - Assertions.assertEquals(NetworkRackType.AGGREGATE, model.networkRackType()); - Assertions.assertEquals("jpytp", model.networkFabricId()); - Assertions.assertEquals("kk", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkRackInner model = - new NetworkRackInner() - .withLocation("xzsvbxxyji") - .withTags(mapOf("qocl", "o", "oewyhxessmvrkd", "l", "bdxmd", "sqeq")) - .withNetworkRackType(NetworkRackType.AGGREGATE) - .withNetworkFabricId("jpytp") - .withAnnotation("kk"); - model = BinaryData.fromObject(model).toObject(NetworkRackInner.class); - Assertions.assertEquals("xzsvbxxyji", model.location()); - Assertions.assertEquals("o", model.tags().get("qocl")); - Assertions.assertEquals(NetworkRackType.AGGREGATE, model.networkRackType()); - Assertions.assertEquals("jpytp", model.networkFabricId()); - Assertions.assertEquals("kk", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackPropertiesTests.java deleted file mode 100644 index aec138c9935e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackType; -import org.junit.jupiter.api.Assertions; - -public final class NetworkRackPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkRackProperties model = - BinaryData - .fromString( - "{\"networkRackType\":\"Aggregate\",\"networkFabricId\":\"rnminzqplgtkih\",\"networkDevices\":[\"kzsrz\",\"ffjilzfbpnt\",\"gkensckhbmcarmo\"],\"provisioningState\":\"Deleting\",\"annotation\":\"kwykuqdndxl\"}") - .toObject(NetworkRackProperties.class); - Assertions.assertEquals("kwykuqdndxl", model.annotation()); - Assertions.assertEquals(NetworkRackType.AGGREGATE, model.networkRackType()); - Assertions.assertEquals("rnminzqplgtkih", model.networkFabricId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkRackProperties model = - new NetworkRackProperties() - .withAnnotation("kwykuqdndxl") - .withNetworkRackType(NetworkRackType.AGGREGATE) - .withNetworkFabricId("rnminzqplgtkih"); - model = BinaryData.fromObject(model).toObject(NetworkRackProperties.class); - Assertions.assertEquals("kwykuqdndxl", model.annotation()); - Assertions.assertEquals(NetworkRackType.AGGREGATE, model.networkRackType()); - Assertions.assertEquals("rnminzqplgtkih", model.networkFabricId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateMockTests.java deleted file mode 100644 index 096451db2189..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateMockTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRack; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackType; -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 NetworkRacksCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"networkRackType\":\"Aggregate\",\"networkFabricId\":\"hedrbzzbhyagwxw\",\"networkDevices\":[\"kdlxdlh\",\"alz\"],\"provisioningState\":\"Succeeded\",\"annotation\":\"kyxowno\"},\"location\":\"qus\",\"tags\":{\"gtjxlopncc\":\"ajicrs\",\"jlwrfeabzjpg\":\"xtpprszeh\",\"rxix\":\"jmgpceqaklsfx\",\"sbjxpuokkdpts\":\"mfqmvnhsfjxt\"},\"id\":\"pg\",\"name\":\"plonal\",\"type\":\"waulkwuyasjwn\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkRack response = - manager - .networkRacks() - .define("eciexsc") - .withRegion("bnwdkgbzjoyy") - .withExistingResourceGroup("tkgopdjqnsicucq") - .withNetworkFabricId("hjjlypwgwbycf") - .withTags(mapOf("qxkzeowizvj", "okd", "xxboauvkkc", "jzxkflzqw")) - .withNetworkRackType(NetworkRackType.COMPUTE) - .withAnnotation("myerpusozaoutjl") - .create(); - - Assertions.assertEquals("qus", response.location()); - Assertions.assertEquals("ajicrs", response.tags().get("gtjxlopncc")); - Assertions.assertEquals(NetworkRackType.AGGREGATE, response.networkRackType()); - Assertions.assertEquals("hedrbzzbhyagwxw", response.networkFabricId()); - Assertions.assertEquals("kyxowno", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 56d35214df02..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRack; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackType; -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 NetworkRacksGetByResourceGroupWithResponseMockTests { - @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\":{\"networkRackType\":\"Aggregate\",\"networkFabricId\":\"vrexitpzri\",\"networkDevices\":[\"sc\",\"ujywwumbusnaw\",\"ncljkh\"],\"provisioningState\":\"Accepted\",\"annotation\":\"uahokiclrmmudv\"},\"location\":\"t\",\"tags\":{\"ysmzgbogdj\":\"idkwznwttlizd\"},\"id\":\"uybcp\",\"name\":\"dvuotkvkbpmk\",\"type\":\"pbnkcwauylkbdsk\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkRack response = - manager - .networkRacks() - .getByResourceGroupWithResponse("wcxxccf", "fvoz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("t", response.location()); - Assertions.assertEquals("idkwznwttlizd", response.tags().get("ysmzgbogdj")); - Assertions.assertEquals(NetworkRackType.AGGREGATE, response.networkRackType()); - Assertions.assertEquals("vrexitpzri", response.networkFabricId()); - Assertions.assertEquals("uahokiclrmmudv", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListByResourceGroupMockTests.java deleted file mode 100644 index 6c6423074bff..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRack; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackType; -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 NetworkRacksListByResourceGroupMockTests { - @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\":{\"networkRackType\":\"Combined\",\"networkFabricId\":\"empahyuxxeike\",\"networkDevices\":[\"wrnh\",\"afu\"],\"provisioningState\":\"Succeeded\",\"annotation\":\"phjkx\"},\"location\":\"mesxjeqqfy\",\"tags\":{\"hdncq\":\"kxtanlvoorv\",\"vxp\":\"uwtpssgqlnols\"},\"id\":\"egxlzd\",\"name\":\"atptzkmfvdrkcw\",\"type\":\"smnwsffia\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.networkRacks().listByResourceGroup("pyfrtlukafq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mesxjeqqfy", response.iterator().next().location()); - Assertions.assertEquals("kxtanlvoorv", response.iterator().next().tags().get("hdncq")); - Assertions.assertEquals(NetworkRackType.COMBINED, response.iterator().next().networkRackType()); - Assertions.assertEquals("empahyuxxeike", response.iterator().next().networkFabricId()); - Assertions.assertEquals("phjkx", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListMockTests.java deleted file mode 100644 index 752411091986..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRack; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackType; -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 NetworkRacksListMockTests { - @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\":{\"networkRackType\":\"Combined\",\"networkFabricId\":\"frzzxirxxkmozkd\",\"networkDevices\":[\"rhkivvpyzn\"],\"provisioningState\":\"Accepted\",\"annotation\":\"uuzny\"},\"location\":\"zzwsesqy\",\"tags\":{\"sxcsoaxcmepkpx\":\"vofgxor\",\"nbyi\":\"bxynkubwkdihs\"},\"id\":\"wetwwjv\",\"name\":\"ycygcvgebf\",\"type\":\"ityantecv\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkRacks().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zzwsesqy", response.iterator().next().location()); - Assertions.assertEquals("vofgxor", response.iterator().next().tags().get("sxcsoaxcmepkpx")); - Assertions.assertEquals(NetworkRackType.COMBINED, response.iterator().next().networkRackType()); - Assertions.assertEquals("frzzxirxxkmozkd", response.iterator().next().networkFabricId()); - Assertions.assertEquals("uuzny", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListResultTests.java deleted file mode 100644 index 6ad94cf03689..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListResultTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackInner; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackType; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkRacksListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkRacksListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkRacksListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"networkRackType\":\"Combined\",\"networkFabricId\":\"gapvdgtfpeerscdx\",\"networkDevices\":[\"njrcuf\"],\"provisioningState\":\"Canceled\",\"annotation\":\"cnrgfdtnc\"},\"location\":\"psa\",\"tags\":{\"qiqmlfvhlq\":\"meub\"},\"id\":\"skkqjmxptuei\",\"name\":\"uugkw\",\"type\":\"rq\"}],\"nextLink\":\"pahu\"}") - .toObject(NetworkRacksListResult.class); - Assertions.assertEquals("psa", model.value().get(0).location()); - Assertions.assertEquals("meub", model.value().get(0).tags().get("qiqmlfvhlq")); - Assertions.assertEquals(NetworkRackType.COMBINED, model.value().get(0).networkRackType()); - Assertions.assertEquals("gapvdgtfpeerscdx", model.value().get(0).networkFabricId()); - Assertions.assertEquals("cnrgfdtnc", model.value().get(0).annotation()); - Assertions.assertEquals("pahu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkRacksListResult model = - new NetworkRacksListResult() - .withValue( - Arrays - .asList( - new NetworkRackInner() - .withLocation("psa") - .withTags(mapOf("qiqmlfvhlq", "meub")) - .withNetworkRackType(NetworkRackType.COMBINED) - .withNetworkFabricId("gapvdgtfpeerscdx") - .withAnnotation("cnrgfdtnc"))) - .withNextLink("pahu"); - model = BinaryData.fromObject(model).toObject(NetworkRacksListResult.class); - Assertions.assertEquals("psa", model.value().get(0).location()); - Assertions.assertEquals("meub", model.value().get(0).tags().get("qiqmlfvhlq")); - Assertions.assertEquals(NetworkRackType.COMBINED, model.value().get(0).networkRackType()); - Assertions.assertEquals("gapvdgtfpeerscdx", model.value().get(0).networkFabricId()); - Assertions.assertEquals("cnrgfdtnc", model.value().get(0).annotation()); - Assertions.assertEquals("pahu", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapInnerTests.java deleted file mode 100644 index f1086f512a6a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapInnerTests.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkTapInner; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.IsolationDomainProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapPropertiesDestinationsItem; -import com.azure.resourcemanager.managednetworkfabric.models.PollingType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapInner model = - BinaryData - .fromString( - "{\"properties\":{\"networkPacketBrokerId\":\"czmrjgobe\",\"sourceTapRuleId\":\"eheow\",\"destinations\":[{\"name\":\"afdrz\",\"destinationType\":\"Direct\",\"destinationId\":\"i\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"bmseesacuicnvq\"]},\"destinationTapRuleId\":\"suivmrf\"},{\"name\":\"tnd\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"lh\",\"isolationDomainProperties\":{\"encapsulation\":\"GRE\",\"neighborGroupIds\":[\"kekc\",\"aviiebeqrfz\"]},\"destinationTapRuleId\":\"qymcwt\"},{\"name\":\"uceplbrzgkuorwp\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"weobptscr\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"layynoyjy\",\"l\",\"msbnlyoifg\",\"fzjqthy\"]},\"destinationTapRuleId\":\"voevcwfzo\"},{\"name\":\"xxlwwooxgbsdz\",\"destinationType\":\"Direct\",\"destinationId\":\"ypjh\",\"isolationDomainProperties\":{\"encapsulation\":\"GRE\",\"neighborGroupIds\":[\"bxehujcqgzwvx\",\"iuaoibmjklqrljd\",\"uky\"]},\"destinationTapRuleId\":\"xrjiqoqovqhg\"}],\"pollingType\":\"Push\",\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"MAT\",\"annotation\":\"yqruvumryddnqiva\"},\"location\":\"cqwnjz\",\"tags\":{\"spwwibpybq\":\"icciyoypoed\",\"ffnhcgnaqsrmrfqd\":\"igxuyxsxteuikhzn\",\"b\":\"rkrgsdc\"},\"id\":\"mgqlwyqznbbyzpo\",\"name\":\"zfutgpbygbnb\",\"type\":\"moiqg\"}") - .toObject(NetworkTapInner.class); - Assertions.assertEquals("cqwnjz", model.location()); - Assertions.assertEquals("icciyoypoed", model.tags().get("spwwibpybq")); - Assertions.assertEquals("czmrjgobe", model.networkPacketBrokerId()); - Assertions.assertEquals("afdrz", model.destinations().get(0).name()); - Assertions.assertEquals(DestinationType.DIRECT, model.destinations().get(0).destinationType()); - Assertions.assertEquals("i", model.destinations().get(0).destinationId()); - Assertions - .assertEquals(Encapsulation.NONE, model.destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions - .assertEquals( - "bmseesacuicnvq", model.destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("suivmrf", model.destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals(PollingType.PUSH, model.pollingType()); - Assertions.assertEquals("yqruvumryddnqiva", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapInner model = - new NetworkTapInner() - .withLocation("cqwnjz") - .withTags(mapOf("spwwibpybq", "icciyoypoed", "ffnhcgnaqsrmrfqd", "igxuyxsxteuikhzn", "b", "rkrgsdc")) - .withNetworkPacketBrokerId("czmrjgobe") - .withDestinations( - Arrays - .asList( - new NetworkTapPropertiesDestinationsItem() - .withName("afdrz") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("i") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("bmseesacuicnvq"))) - .withDestinationTapRuleId("suivmrf"), - new NetworkTapPropertiesDestinationsItem() - .withName("tnd") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("lh") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.GRE) - .withNeighborGroupIds(Arrays.asList("kekc", "aviiebeqrfz"))) - .withDestinationTapRuleId("qymcwt"), - new NetworkTapPropertiesDestinationsItem() - .withName("uceplbrzgkuorwp") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("weobptscr") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("layynoyjy", "l", "msbnlyoifg", "fzjqthy"))) - .withDestinationTapRuleId("voevcwfzo"), - new NetworkTapPropertiesDestinationsItem() - .withName("xxlwwooxgbsdz") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("ypjh") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.GRE) - .withNeighborGroupIds(Arrays.asList("bxehujcqgzwvx", "iuaoibmjklqrljd", "uky"))) - .withDestinationTapRuleId("xrjiqoqovqhg"))) - .withPollingType(PollingType.PUSH) - .withAnnotation("yqruvumryddnqiva"); - model = BinaryData.fromObject(model).toObject(NetworkTapInner.class); - Assertions.assertEquals("cqwnjz", model.location()); - Assertions.assertEquals("icciyoypoed", model.tags().get("spwwibpybq")); - Assertions.assertEquals("czmrjgobe", model.networkPacketBrokerId()); - Assertions.assertEquals("afdrz", model.destinations().get(0).name()); - Assertions.assertEquals(DestinationType.DIRECT, model.destinations().get(0).destinationType()); - Assertions.assertEquals("i", model.destinations().get(0).destinationId()); - Assertions - .assertEquals(Encapsulation.NONE, model.destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions - .assertEquals( - "bmseesacuicnvq", model.destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("suivmrf", model.destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals(PollingType.PUSH, model.pollingType()); - Assertions.assertEquals("yqruvumryddnqiva", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPatchTests.java deleted file mode 100644 index 42c0bd3a1320..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPatchTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.IsolationDomainProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapPatch; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapPatchableParametersDestinationsItem; -import com.azure.resourcemanager.managednetworkfabric.models.PollingType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapPatch model = - BinaryData - .fromString( - "{\"properties\":{\"pollingType\":\"Push\",\"destinations\":[{\"name\":\"mbzquu\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"hbtqyzy\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"y\",\"vxjdqosxzmdz\",\"ybqfufkekzfkicxh\",\"evmnk\"]},\"destinationTapRuleId\":\"hvsr\"},{\"name\":\"ok\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"bjsarxsvmfpa\",\"isolationDomainProperties\":{\"encapsulation\":\"GRE\",\"neighborGroupIds\":[\"fgqpud\",\"gxgieabbfp\",\"xavlozukgs\",\"uhwyxjsfmaxcebn\"]},\"destinationTapRuleId\":\"oskemq\"}],\"annotation\":\"rwqxpjpvem\"},\"tags\":{\"mhyt\":\"httuobrx\"}}") - .toObject(NetworkTapPatch.class); - Assertions.assertEquals("httuobrx", model.tags().get("mhyt")); - Assertions.assertEquals(PollingType.PUSH, model.pollingType()); - Assertions.assertEquals("mbzquu", model.destinations().get(0).name()); - Assertions.assertEquals(DestinationType.ISOLATION_DOMAIN, model.destinations().get(0).destinationType()); - Assertions.assertEquals("hbtqyzy", model.destinations().get(0).destinationId()); - Assertions - .assertEquals(Encapsulation.NONE, model.destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions.assertEquals("y", model.destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("hvsr", model.destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals("rwqxpjpvem", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapPatch model = - new NetworkTapPatch() - .withTags(mapOf("mhyt", "httuobrx")) - .withPollingType(PollingType.PUSH) - .withDestinations( - Arrays - .asList( - new NetworkTapPatchableParametersDestinationsItem() - .withName("mbzquu") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("hbtqyzy") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds( - Arrays.asList("y", "vxjdqosxzmdz", "ybqfufkekzfkicxh", "evmnk"))) - .withDestinationTapRuleId("hvsr"), - new NetworkTapPatchableParametersDestinationsItem() - .withName("ok") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("bjsarxsvmfpa") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.GRE) - .withNeighborGroupIds( - Arrays.asList("fgqpud", "gxgieabbfp", "xavlozukgs", "uhwyxjsfmaxcebn"))) - .withDestinationTapRuleId("oskemq"))) - .withAnnotation("rwqxpjpvem"); - model = BinaryData.fromObject(model).toObject(NetworkTapPatch.class); - Assertions.assertEquals("httuobrx", model.tags().get("mhyt")); - Assertions.assertEquals(PollingType.PUSH, model.pollingType()); - Assertions.assertEquals("mbzquu", model.destinations().get(0).name()); - Assertions.assertEquals(DestinationType.ISOLATION_DOMAIN, model.destinations().get(0).destinationType()); - Assertions.assertEquals("hbtqyzy", model.destinations().get(0).destinationId()); - Assertions - .assertEquals(Encapsulation.NONE, model.destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions.assertEquals("y", model.destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("hvsr", model.destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals("rwqxpjpvem", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPatchableParametersDestinationsItemTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPatchableParametersDestinationsItemTests.java deleted file mode 100644 index 706d5de431fe..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPatchableParametersDestinationsItemTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.IsolationDomainProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapPatchableParametersDestinationsItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapPatchableParametersDestinationsItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapPatchableParametersDestinationsItem model = - BinaryData - .fromString( - "{\"name\":\"dnuehxwltssjdywb\",\"destinationType\":\"Direct\",\"destinationId\":\"erxa\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"xc\",\"mpt\"]},\"destinationTapRuleId\":\"rm\"}") - .toObject(NetworkTapPatchableParametersDestinationsItem.class); - Assertions.assertEquals("dnuehxwltssjdywb", model.name()); - Assertions.assertEquals(DestinationType.DIRECT, model.destinationType()); - Assertions.assertEquals("erxa", model.destinationId()); - Assertions.assertEquals(Encapsulation.NONE, model.isolationDomainProperties().encapsulation()); - Assertions.assertEquals("xc", model.isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("rm", model.destinationTapRuleId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapPatchableParametersDestinationsItem model = - new NetworkTapPatchableParametersDestinationsItem() - .withName("dnuehxwltssjdywb") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("erxa") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("xc", "mpt"))) - .withDestinationTapRuleId("rm"); - model = BinaryData.fromObject(model).toObject(NetworkTapPatchableParametersDestinationsItem.class); - Assertions.assertEquals("dnuehxwltssjdywb", model.name()); - Assertions.assertEquals(DestinationType.DIRECT, model.destinationType()); - Assertions.assertEquals("erxa", model.destinationId()); - Assertions.assertEquals(Encapsulation.NONE, model.isolationDomainProperties().encapsulation()); - Assertions.assertEquals("xc", model.isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("rm", model.destinationTapRuleId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPatchableParametersTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPatchableParametersTests.java deleted file mode 100644 index 52732747e9e0..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPatchableParametersTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkTapPatchableParameters; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.IsolationDomainProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapPatchableParametersDestinationsItem; -import com.azure.resourcemanager.managednetworkfabric.models.PollingType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapPatchableParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapPatchableParameters model = - BinaryData - .fromString( - "{\"pollingType\":\"Pull\",\"destinations\":[{\"name\":\"eecwtfm\",\"destinationType\":\"Direct\",\"destinationId\":\"mnhtwofxfmhlvyq\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"mlqkiekhj\"]},\"destinationTapRuleId\":\"q\"},{\"name\":\"gwespscvsmsp\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"ozfvza\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"gx\",\"vwio\"]},\"destinationTapRuleId\":\"cmcgmlmpnvq\"},{\"name\":\"yiarzn\",\"destinationType\":\"Direct\",\"destinationId\":\"eypd\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"yxoaf\",\"mzgccy\"]},\"destinationTapRuleId\":\"uvmsie\"},{\"name\":\"dmmvoneeyr\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"xtzayqwddig\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"z\",\"ssiwwv\"]},\"destinationTapRuleId\":\"ozbjk\"}],\"annotation\":\"p\"}") - .toObject(NetworkTapPatchableParameters.class); - Assertions.assertEquals("p", model.annotation()); - Assertions.assertEquals(PollingType.PULL, model.pollingType()); - Assertions.assertEquals("eecwtfm", model.destinations().get(0).name()); - Assertions.assertEquals(DestinationType.DIRECT, model.destinations().get(0).destinationType()); - Assertions.assertEquals("mnhtwofxfmhlvyq", model.destinations().get(0).destinationId()); - Assertions - .assertEquals(Encapsulation.NONE, model.destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions - .assertEquals( - "mlqkiekhj", model.destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("q", model.destinations().get(0).destinationTapRuleId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapPatchableParameters model = - new NetworkTapPatchableParameters() - .withAnnotation("p") - .withPollingType(PollingType.PULL) - .withDestinations( - Arrays - .asList( - new NetworkTapPatchableParametersDestinationsItem() - .withName("eecwtfm") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("mnhtwofxfmhlvyq") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("mlqkiekhj"))) - .withDestinationTapRuleId("q"), - new NetworkTapPatchableParametersDestinationsItem() - .withName("gwespscvsmsp") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("ozfvza") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("gx", "vwio"))) - .withDestinationTapRuleId("cmcgmlmpnvq"), - new NetworkTapPatchableParametersDestinationsItem() - .withName("yiarzn") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("eypd") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("yxoaf", "mzgccy"))) - .withDestinationTapRuleId("uvmsie"), - new NetworkTapPatchableParametersDestinationsItem() - .withName("dmmvoneeyr") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("xtzayqwddig") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("z", "ssiwwv"))) - .withDestinationTapRuleId("ozbjk"))); - model = BinaryData.fromObject(model).toObject(NetworkTapPatchableParameters.class); - Assertions.assertEquals("p", model.annotation()); - Assertions.assertEquals(PollingType.PULL, model.pollingType()); - Assertions.assertEquals("eecwtfm", model.destinations().get(0).name()); - Assertions.assertEquals(DestinationType.DIRECT, model.destinations().get(0).destinationType()); - Assertions.assertEquals("mnhtwofxfmhlvyq", model.destinations().get(0).destinationId()); - Assertions - .assertEquals(Encapsulation.NONE, model.destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions - .assertEquals( - "mlqkiekhj", model.destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("q", model.destinations().get(0).destinationTapRuleId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPropertiesDestinationsItemTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPropertiesDestinationsItemTests.java deleted file mode 100644 index abfdb0125cc8..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPropertiesDestinationsItemTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.IsolationDomainProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapPropertiesDestinationsItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapPropertiesDestinationsItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapPropertiesDestinationsItem model = - BinaryData - .fromString( - "{\"name\":\"avi\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"g\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"wichmxczby\"]},\"destinationTapRuleId\":\"ocgmzdcts\"}") - .toObject(NetworkTapPropertiesDestinationsItem.class); - Assertions.assertEquals("avi", model.name()); - Assertions.assertEquals(DestinationType.ISOLATION_DOMAIN, model.destinationType()); - Assertions.assertEquals("g", model.destinationId()); - Assertions.assertEquals(Encapsulation.NONE, model.isolationDomainProperties().encapsulation()); - Assertions.assertEquals("wichmxczby", model.isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("ocgmzdcts", model.destinationTapRuleId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapPropertiesDestinationsItem model = - new NetworkTapPropertiesDestinationsItem() - .withName("avi") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("g") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("wichmxczby"))) - .withDestinationTapRuleId("ocgmzdcts"); - model = BinaryData.fromObject(model).toObject(NetworkTapPropertiesDestinationsItem.class); - Assertions.assertEquals("avi", model.name()); - Assertions.assertEquals(DestinationType.ISOLATION_DOMAIN, model.destinationType()); - Assertions.assertEquals("g", model.destinationId()); - Assertions.assertEquals(Encapsulation.NONE, model.isolationDomainProperties().encapsulation()); - Assertions.assertEquals("wichmxczby", model.isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("ocgmzdcts", model.destinationTapRuleId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPropertiesTests.java deleted file mode 100644 index 4b36758df562..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkTapProperties; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.IsolationDomainProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapPropertiesDestinationsItem; -import com.azure.resourcemanager.managednetworkfabric.models.PollingType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapProperties model = - BinaryData - .fromString( - "{\"networkPacketBrokerId\":\"zpvqewflwzhxzuxe\",\"sourceTapRuleId\":\"hywlrkqsq\",\"destinations\":[{\"name\":\"kfpfjdajdqx\",\"destinationType\":\"Direct\",\"destinationId\":\"yfrdjidcetfvg\",\"isolationDomainProperties\":{\"encapsulation\":\"GRE\",\"neighborGroupIds\":[\"igwouppvyddqsvc\",\"rsnxfrp\"]},\"destinationTapRuleId\":\"wqclmdmtfxxepzpx\"},{\"name\":\"lcqzfxai\",\"destinationType\":\"Direct\",\"destinationId\":\"cj\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"pqnip\",\"dmhk\",\"omeobwkeuzltenlb\"]},\"destinationTapRuleId\":\"lmxoz\"},{\"name\":\"ndoduom\",\"destinationType\":\"Direct\",\"destinationId\":\"ri\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"kk\",\"yvurhwishy\",\"mrzcqfevnkyakc\",\"tehognsddjk\"]},\"destinationTapRuleId\":\"edesuazogfcnx\"}],\"pollingType\":\"Pull\",\"configurationState\":\"Accepted\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"RMA\",\"annotation\":\"myvkxix\"}") - .toObject(NetworkTapProperties.class); - Assertions.assertEquals("myvkxix", model.annotation()); - Assertions.assertEquals("zpvqewflwzhxzuxe", model.networkPacketBrokerId()); - Assertions.assertEquals("kfpfjdajdqx", model.destinations().get(0).name()); - Assertions.assertEquals(DestinationType.DIRECT, model.destinations().get(0).destinationType()); - Assertions.assertEquals("yfrdjidcetfvg", model.destinations().get(0).destinationId()); - Assertions - .assertEquals(Encapsulation.GRE, model.destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions - .assertEquals( - "igwouppvyddqsvc", model.destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("wqclmdmtfxxepzpx", model.destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals(PollingType.PULL, model.pollingType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapProperties model = - new NetworkTapProperties() - .withAnnotation("myvkxix") - .withNetworkPacketBrokerId("zpvqewflwzhxzuxe") - .withDestinations( - Arrays - .asList( - new NetworkTapPropertiesDestinationsItem() - .withName("kfpfjdajdqx") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("yfrdjidcetfvg") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.GRE) - .withNeighborGroupIds(Arrays.asList("igwouppvyddqsvc", "rsnxfrp"))) - .withDestinationTapRuleId("wqclmdmtfxxepzpx"), - new NetworkTapPropertiesDestinationsItem() - .withName("lcqzfxai") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("cj") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("pqnip", "dmhk", "omeobwkeuzltenlb"))) - .withDestinationTapRuleId("lmxoz"), - new NetworkTapPropertiesDestinationsItem() - .withName("ndoduom") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("ri") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds( - Arrays.asList("kk", "yvurhwishy", "mrzcqfevnkyakc", "tehognsddjk"))) - .withDestinationTapRuleId("edesuazogfcnx"))) - .withPollingType(PollingType.PULL); - model = BinaryData.fromObject(model).toObject(NetworkTapProperties.class); - Assertions.assertEquals("myvkxix", model.annotation()); - Assertions.assertEquals("zpvqewflwzhxzuxe", model.networkPacketBrokerId()); - Assertions.assertEquals("kfpfjdajdqx", model.destinations().get(0).name()); - Assertions.assertEquals(DestinationType.DIRECT, model.destinations().get(0).destinationType()); - Assertions.assertEquals("yfrdjidcetfvg", model.destinations().get(0).destinationId()); - Assertions - .assertEquals(Encapsulation.GRE, model.destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions - .assertEquals( - "igwouppvyddqsvc", model.destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("wqclmdmtfxxepzpx", model.destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals(PollingType.PULL, model.pollingType()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleActionTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleActionTests.java deleted file mode 100644 index 4bd2219a6a55..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleActionTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleAction; -import com.azure.resourcemanager.managednetworkfabric.models.TapRuleActionType; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapRuleActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapRuleAction model = - BinaryData - .fromString( - "{\"type\":\"Count\",\"truncate\":\"hvwt\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"chcgsfz\",\"matchConfigurationName\":\"jkiysqbjsdj\"}") - .toObject(NetworkTapRuleAction.class); - Assertions.assertEquals(TapRuleActionType.COUNT, model.type()); - Assertions.assertEquals("hvwt", model.truncate()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.isTimestampEnabled()); - Assertions.assertEquals("chcgsfz", model.destinationId()); - Assertions.assertEquals("jkiysqbjsdj", model.matchConfigurationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapRuleAction model = - new NetworkTapRuleAction() - .withType(TapRuleActionType.COUNT) - .withTruncate("hvwt") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("chcgsfz") - .withMatchConfigurationName("jkiysqbjsdj"); - model = BinaryData.fromObject(model).toObject(NetworkTapRuleAction.class); - Assertions.assertEquals(TapRuleActionType.COUNT, model.type()); - Assertions.assertEquals("hvwt", model.truncate()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.isTimestampEnabled()); - Assertions.assertEquals("chcgsfz", model.destinationId()); - Assertions.assertEquals("jkiysqbjsdj", model.matchConfigurationName()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleInnerTests.java deleted file mode 100644 index be3afdde2409..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleInnerTests.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkTapRuleInner; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.EncapsulationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleAction; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.PollingIntervalInSeconds; -import com.azure.resourcemanager.managednetworkfabric.models.PortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.TapRuleActionType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"networkTapId\":\"njkkxukgu\",\"pollingIntervalInSeconds\":60,\"lastSyncedTime\":\"2021-12-04T13:47:23Z\",\"configurationState\":\"Accepted\",\"provisioningState\":\"Updating\",\"administrativeState\":\"Enabled\",\"configurationType\":\"File\",\"tapRulesUrl\":\"lleuidpmtonvhgn\",\"matchConfigurations\":[{\"matchConfigurationName\":\"plhbpjbapmummmkv\",\"sequenceNumber\":1261371572179891456,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"None\",\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"ufzhrchx\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Drop\",\"truncate\":\"wlvi\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"mlitqdsj\",\"matchConfigurationName\":\"dvisco\"},{\"type\":\"Redirect\",\"truncate\":\"riifefn\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"rqoemwsieeailwdq\",\"matchConfigurationName\":\"fydeotmfxlkd\"},{\"type\":\"Goto\",\"truncate\":\"namkuuyiuyu\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"lxicwgpthdcf\",\"matchConfigurationName\":\"z\"}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{\"name\":\"d\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"v\"]},{\"name\":\"tw\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"gqrnt\",\"umdrcjlvkrkegty\",\"zuppiyx\"]},{\"name\":\"miyddeeqzqvabmh\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"uetbapfczew\",\"trlq\"]},{\"name\":\"xyazkjpirgzx\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"hyegb\"]}],\"vlanGroups\":[{\"name\":\"ritjbu\",\"vlans\":[\"runozfvual\",\"thoivsdwsngk\",\"f\",\"hscj\"]},{\"name\":\"kmhzbh\",\"vlans\":[\"fbwih\"]},{\"name\":\"nx\",\"vlans\":[\"ynuqqkotauratnic\",\"pfzsclefyrl\",\"tndqlmf\",\"ggnbbuypwovvvsfl\"]}],\"portGroups\":[{\"name\":\"oqayrehjuqwv\",\"ports\":[\"rlzh\",\"zihacen\",\"qzlxn\"]},{\"name\":\"ubfonfdbgmkf\",\"ports\":[\"cwtewfhxwyrkb\"]},{\"name\":\"hzlrynjpchamkae\",\"ports\":[\"ajubo\",\"uywevtjrieikmwl\",\"oklf\",\"isyxgucbmtredsc\"]}]}],\"annotation\":\"stjcyyuvtzr\"},\"location\":\"hcle\",\"tags\":{\"yup\":\"tzqzcloy\",\"yresgzsdtmwbyorj\":\"idhz\",\"hychakvyrfbqvum\":\"lb\"},\"id\":\"xqjsiuepm\",\"name\":\"xfnzlpq\",\"type\":\"pf\"}") - .toObject(NetworkTapRuleInner.class); - Assertions.assertEquals("hcle", model.location()); - Assertions.assertEquals("tzqzcloy", model.tags().get("yup")); - Assertions.assertEquals(PollingIntervalInSeconds.SIX_ZERO, model.pollingIntervalInSeconds()); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("lleuidpmtonvhgn", model.tapRulesUrl()); - Assertions.assertEquals("plhbpjbapmummmkv", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(1261371572179891456L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals( - "ufzhrchx", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - EncapsulationType.NONE, - model.matchConfigurations().get(0).matchConditions().get(0).encapsulationType()); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions.assertEquals(TapRuleActionType.DROP, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("wlvi", model.matchConfigurations().get(0).actions().get(0).truncate()); - Assertions - .assertEquals( - BooleanEnumProperty.TRUE, model.matchConfigurations().get(0).actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("mlitqdsj", model.matchConfigurations().get(0).actions().get(0).destinationId()); - Assertions.assertEquals("dvisco", model.matchConfigurations().get(0).actions().get(0).matchConfigurationName()); - Assertions.assertEquals("d", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV4, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions.assertEquals("v", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("ritjbu", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("runozfvual", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("oqayrehjuqwv", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("rlzh", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - Assertions.assertEquals("stjcyyuvtzr", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapRuleInner model = - new NetworkTapRuleInner() - .withLocation("hcle") - .withTags(mapOf("yup", "tzqzcloy", "yresgzsdtmwbyorj", "idhz", "hychakvyrfbqvum", "lb")) - .withPollingIntervalInSeconds(PollingIntervalInSeconds.SIX_ZERO) - .withConfigurationType(ConfigurationType.FILE) - .withTapRulesUrl("lleuidpmtonvhgn") - .withMatchConfigurations( - Arrays - .asList( - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("plhbpjbapmummmkv") - .withSequenceNumber(1261371572179891456L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("ufzhrchx")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition().withLayer4Protocol(Layer4Protocol.TCP)))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.DROP) - .withTruncate("wlvi") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("mlitqdsj") - .withMatchConfigurationName("dvisco"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.REDIRECT) - .withTruncate("riifefn") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("rqoemwsieeailwdq") - .withMatchConfigurationName("fydeotmfxlkd"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.GOTO) - .withTruncate("namkuuyiuyu") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("lxicwgpthdcf") - .withMatchConfigurationName("z"))))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("d") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("v")), - new IpGroupProperties() - .withName("tw") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("gqrnt", "umdrcjlvkrkegty", "zuppiyx")), - new IpGroupProperties() - .withName("miyddeeqzqvabmh") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("uetbapfczew", "trlq")), - new IpGroupProperties() - .withName("xyazkjpirgzx") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("hyegb")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("ritjbu") - .withVlans(Arrays.asList("runozfvual", "thoivsdwsngk", "f", "hscj")), - new VlanGroupProperties() - .withName("kmhzbh") - .withVlans(Arrays.asList("fbwih")), - new VlanGroupProperties() - .withName("nx") - .withVlans( - Arrays - .asList( - "ynuqqkotauratnic", - "pfzsclefyrl", - "tndqlmf", - "ggnbbuypwovvvsfl")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("oqayrehjuqwv") - .withPorts(Arrays.asList("rlzh", "zihacen", "qzlxn")), - new PortGroupProperties() - .withName("ubfonfdbgmkf") - .withPorts(Arrays.asList("cwtewfhxwyrkb")), - new PortGroupProperties() - .withName("hzlrynjpchamkae") - .withPorts( - Arrays - .asList( - "ajubo", "uywevtjrieikmwl", "oklf", "isyxgucbmtredsc")))))) - .withAnnotation("stjcyyuvtzr"); - model = BinaryData.fromObject(model).toObject(NetworkTapRuleInner.class); - Assertions.assertEquals("hcle", model.location()); - Assertions.assertEquals("tzqzcloy", model.tags().get("yup")); - Assertions.assertEquals(PollingIntervalInSeconds.SIX_ZERO, model.pollingIntervalInSeconds()); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("lleuidpmtonvhgn", model.tapRulesUrl()); - Assertions.assertEquals("plhbpjbapmummmkv", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(1261371572179891456L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals( - "ufzhrchx", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - EncapsulationType.NONE, - model.matchConfigurations().get(0).matchConditions().get(0).encapsulationType()); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions.assertEquals(TapRuleActionType.DROP, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("wlvi", model.matchConfigurations().get(0).actions().get(0).truncate()); - Assertions - .assertEquals( - BooleanEnumProperty.TRUE, model.matchConfigurations().get(0).actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("mlitqdsj", model.matchConfigurations().get(0).actions().get(0).destinationId()); - Assertions.assertEquals("dvisco", model.matchConfigurations().get(0).actions().get(0).matchConfigurationName()); - Assertions.assertEquals("d", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV4, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions.assertEquals("v", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("ritjbu", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("runozfvual", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("oqayrehjuqwv", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("rlzh", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - Assertions.assertEquals("stjcyyuvtzr", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleMatchConditionTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleMatchConditionTests.java deleted file mode 100644 index c9273d6fad8a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleMatchConditionTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.EncapsulationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapRuleMatchConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapRuleMatchCondition model = - BinaryData - .fromString( - "{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"ause\",\"nczk\",\"ihvtuwyjsqw\"],\"portGroupNames\":[\"oszjgz\",\"nkfnyskwwunq\"]},\"protocolTypes\":[\"avoj\"],\"vlanMatchCondition\":{\"vlans\":[\"ipcuk\",\"bljp\",\"prrv\"],\"innerVlans\":[\"luqalpc\",\"fjjfxtizt\"],\"vlanGroupNames\":[\"tahhhsa\",\"xxsri\",\"rcwbaae\",\"yyefmxwoqotiiqb\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"tistyikjhorlx\",\"pypkennycntrq\",\"xwtdmbqjtsuhqh\"],\"ipGroupNames\":[\"tdyqav\",\"x\",\"qmzxsyaks\",\"npaami\"]}}") - .toObject(NetworkTapRuleMatchCondition.class); - Assertions.assertEquals("avoj", model.protocolTypes().get(0)); - Assertions.assertEquals("ipcuk", model.vlanMatchCondition().vlans().get(0)); - Assertions.assertEquals("luqalpc", model.vlanMatchCondition().innerVlans().get(0)); - Assertions.assertEquals("tahhhsa", model.vlanMatchCondition().vlanGroupNames().get(0)); - Assertions.assertEquals(SourceDestinationType.SOURCE_IP, model.ipCondition().type()); - Assertions.assertEquals(PrefixType.PREFIX, model.ipCondition().prefixType()); - Assertions.assertEquals("tistyikjhorlx", model.ipCondition().ipPrefixValues().get(0)); - Assertions.assertEquals("tdyqav", model.ipCondition().ipGroupNames().get(0)); - Assertions.assertEquals(EncapsulationType.GTPV1, model.encapsulationType()); - Assertions.assertEquals(PortType.SOURCE_PORT, model.portCondition().portType()); - Assertions.assertEquals(Layer4Protocol.UDP, model.portCondition().layer4Protocol()); - Assertions.assertEquals("ause", model.portCondition().ports().get(0)); - Assertions.assertEquals("oszjgz", model.portCondition().portGroupNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapRuleMatchCondition model = - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("avoj")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("ipcuk", "bljp", "prrv")) - .withInnerVlans(Arrays.asList("luqalpc", "fjjfxtizt")) - .withVlanGroupNames(Arrays.asList("tahhhsa", "xxsri", "rcwbaae", "yyefmxwoqotiiqb"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("tistyikjhorlx", "pypkennycntrq", "xwtdmbqjtsuhqh")) - .withIpGroupNames(Arrays.asList("tdyqav", "x", "qmzxsyaks", "npaami"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("ause", "nczk", "ihvtuwyjsqw")) - .withPortGroupNames(Arrays.asList("oszjgz", "nkfnyskwwunq"))); - model = BinaryData.fromObject(model).toObject(NetworkTapRuleMatchCondition.class); - Assertions.assertEquals("avoj", model.protocolTypes().get(0)); - Assertions.assertEquals("ipcuk", model.vlanMatchCondition().vlans().get(0)); - Assertions.assertEquals("luqalpc", model.vlanMatchCondition().innerVlans().get(0)); - Assertions.assertEquals("tahhhsa", model.vlanMatchCondition().vlanGroupNames().get(0)); - Assertions.assertEquals(SourceDestinationType.SOURCE_IP, model.ipCondition().type()); - Assertions.assertEquals(PrefixType.PREFIX, model.ipCondition().prefixType()); - Assertions.assertEquals("tistyikjhorlx", model.ipCondition().ipPrefixValues().get(0)); - Assertions.assertEquals("tdyqav", model.ipCondition().ipGroupNames().get(0)); - Assertions.assertEquals(EncapsulationType.GTPV1, model.encapsulationType()); - Assertions.assertEquals(PortType.SOURCE_PORT, model.portCondition().portType()); - Assertions.assertEquals(Layer4Protocol.UDP, model.portCondition().layer4Protocol()); - Assertions.assertEquals("ause", model.portCondition().ports().get(0)); - Assertions.assertEquals("oszjgz", model.portCondition().portGroupNames().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleMatchConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleMatchConfigurationTests.java deleted file mode 100644 index 1ee0c5c24c39..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRuleMatchConfigurationTests.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.EncapsulationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleAction; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.PortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.TapRuleActionType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapRuleMatchConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapRuleMatchConfiguration model = - BinaryData - .fromString( - "{\"matchConfigurationName\":\"ccxz\",\"sequenceNumber\":2240264352789297819,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"dtu\"],\"portGroupNames\":[\"vhnjvpmxnhtmz\"]},\"protocolTypes\":[\"lfxolr\",\"vtlgx\",\"fjswequflzyyopoa\"],\"vlanMatchCondition\":{\"vlans\":[\"gwqub\",\"tbvufrkwjiemim\"],\"innerVlans\":[\"powewjs\"],\"vlanGroupNames\":[\"eedddrftfquu\",\"p\",\"lhs\",\"igeeuwbr\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"netdqw\"],\"ipGroupNames\":[\"oqgvbzpggp\",\"meyobqajejirvavr\",\"kgpogplbjuvlnh\"]}}],\"actions\":[{\"type\":\"Mirror\",\"truncate\":\"inaegesbx\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"mjmoplu\",\"matchConfigurationName\":\"ykkfhsovadkrm\"},{\"type\":\"Redirect\",\"truncate\":\"qpdkesjqbzkqmx\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"iw\",\"matchConfigurationName\":\"ggijtspzjnrrhik\"},{\"type\":\"Drop\",\"truncate\":\"r\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"quhtr\",\"matchConfigurationName\":\"frunj\"}]}") - .toObject(NetworkTapRuleMatchConfiguration.class); - Assertions.assertEquals("ccxz", model.matchConfigurationName()); - Assertions.assertEquals(2240264352789297819L, model.sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.ipAddressType()); - Assertions.assertEquals("lfxolr", model.matchConditions().get(0).protocolTypes().get(0)); - Assertions.assertEquals("gwqub", model.matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions.assertEquals("powewjs", model.matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals("eedddrftfquu", model.matchConditions().get(0).vlanMatchCondition().vlanGroupNames().get(0)); - Assertions - .assertEquals(SourceDestinationType.DESTINATION_IP, model.matchConditions().get(0).ipCondition().type()); - Assertions.assertEquals(PrefixType.LONGEST_PREFIX, model.matchConditions().get(0).ipCondition().prefixType()); - Assertions.assertEquals("netdqw", model.matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions.assertEquals("oqgvbzpggp", model.matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions.assertEquals(EncapsulationType.GTPV1, model.matchConditions().get(0).encapsulationType()); - Assertions.assertEquals(PortType.SOURCE_PORT, model.matchConditions().get(0).portCondition().portType()); - Assertions.assertEquals(Layer4Protocol.TCP, model.matchConditions().get(0).portCondition().layer4Protocol()); - Assertions.assertEquals("dtu", model.matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals("vhnjvpmxnhtmz", model.matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions.assertEquals(TapRuleActionType.MIRROR, model.actions().get(0).type()); - Assertions.assertEquals("inaegesbx", model.actions().get(0).truncate()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("mjmoplu", model.actions().get(0).destinationId()); - Assertions.assertEquals("ykkfhsovadkrm", model.actions().get(0).matchConfigurationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapRuleMatchConfiguration model = - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("ccxz") - .withSequenceNumber(2240264352789297819L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("lfxolr", "vtlgx", "fjswequflzyyopoa")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("gwqub", "tbvufrkwjiemim")) - .withInnerVlans(Arrays.asList("powewjs")) - .withVlanGroupNames(Arrays.asList("eedddrftfquu", "p", "lhs", "igeeuwbr"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("netdqw")) - .withIpGroupNames( - Arrays.asList("oqgvbzpggp", "meyobqajejirvavr", "kgpogplbjuvlnh"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("dtu")) - .withPortGroupNames(Arrays.asList("vhnjvpmxnhtmz"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.MIRROR) - .withTruncate("inaegesbx") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("mjmoplu") - .withMatchConfigurationName("ykkfhsovadkrm"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.REDIRECT) - .withTruncate("qpdkesjqbzkqmx") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("iw") - .withMatchConfigurationName("ggijtspzjnrrhik"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.DROP) - .withTruncate("r") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("quhtr") - .withMatchConfigurationName("frunj"))); - model = BinaryData.fromObject(model).toObject(NetworkTapRuleMatchConfiguration.class); - Assertions.assertEquals("ccxz", model.matchConfigurationName()); - Assertions.assertEquals(2240264352789297819L, model.sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.ipAddressType()); - Assertions.assertEquals("lfxolr", model.matchConditions().get(0).protocolTypes().get(0)); - Assertions.assertEquals("gwqub", model.matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions.assertEquals("powewjs", model.matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals("eedddrftfquu", model.matchConditions().get(0).vlanMatchCondition().vlanGroupNames().get(0)); - Assertions - .assertEquals(SourceDestinationType.DESTINATION_IP, model.matchConditions().get(0).ipCondition().type()); - Assertions.assertEquals(PrefixType.LONGEST_PREFIX, model.matchConditions().get(0).ipCondition().prefixType()); - Assertions.assertEquals("netdqw", model.matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions.assertEquals("oqgvbzpggp", model.matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions.assertEquals(EncapsulationType.GTPV1, model.matchConditions().get(0).encapsulationType()); - Assertions.assertEquals(PortType.SOURCE_PORT, model.matchConditions().get(0).portCondition().portType()); - Assertions.assertEquals(Layer4Protocol.TCP, model.matchConditions().get(0).portCondition().layer4Protocol()); - Assertions.assertEquals("dtu", model.matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals("vhnjvpmxnhtmz", model.matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions.assertEquals(TapRuleActionType.MIRROR, model.actions().get(0).type()); - Assertions.assertEquals("inaegesbx", model.actions().get(0).truncate()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("mjmoplu", model.actions().get(0).destinationId()); - Assertions.assertEquals("ykkfhsovadkrm", model.actions().get(0).matchConfigurationName()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePatchPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePatchPropertiesTests.java deleted file mode 100644 index eb43183167e0..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePatchPropertiesTests.java +++ /dev/null @@ -1,771 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkTapRulePatchProperties; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.EncapsulationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleAction; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.PortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.TapRuleActionType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapRulePatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapRulePatchProperties model = - BinaryData - .fromString( - "{\"configurationType\":\"Inline\",\"tapRulesUrl\":\"t\",\"matchConfigurations\":[{\"matchConfigurationName\":\"zdjmofsvpzxgny\",\"sequenceNumber\":2171958133476599680,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"cfyzqpeqregfu\",\"dpagk\"],\"portGroupNames\":[\"aovrgihlnzffewv\",\"kycjcg\",\"ipqxxsdyafwtydsm\"]},\"protocolTypes\":[\"hg\",\"lejqzhpvhxp\",\"adj\",\"eullgfyog\"],\"vlanMatchCondition\":{\"vlans\":[\"jpvqerqxko\",\"wdzpzl\",\"cuex\"],\"innerVlans\":[\"wwvmbjec\",\"wlbg\",\"nkfrwxo\"],\"vlanGroupNames\":[\"dsnjzpchiypb\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"qozewbr\",\"rjzgkbrauxbo\",\"fq\",\"nqbjxgjwsrer\"],\"ipGroupNames\":[\"uudrizwkwkjxlaac\",\"dikqelssybz\",\"evgb\",\"rommkiqhypwt\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"mzqlnaag\"],\"portGroupNames\":[\"j\"]},\"protocolTypes\":[\"iywhxpsb\",\"pialezay\",\"puz\",\"degefxlieggoto\"],\"vlanMatchCondition\":{\"vlans\":[\"sfnwh\"],\"innerVlans\":[\"hh\"],\"vlanGroupNames\":[\"nfmkcuft\",\"dgwuzron\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"nwysodcikgxkkzzf\"],\"ipGroupNames\":[\"ekebawnxzs\",\"wyfixi\",\"gcjf\",\"iwu\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"fqnfforxsq\",\"zngxb\"],\"portGroupNames\":[\"ewg\",\"xcmmhipbvskcitly\",\"kwfsaangfgbm\",\"vm\"]},\"protocolTypes\":[\"yliuajklnacg\"],\"vlanMatchCondition\":{\"vlans\":[\"eonmzrjjaojp\",\"ngdrzigecwsadsq\",\"udd\"],\"innerVlans\":[\"qdmohheuyuunxmy\"],\"vlanGroupNames\":[\"igdeipnfizejwli\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"hajodapqok\",\"dyncradxsewbe\",\"pfapmqnmelyk\"],\"ipGroupNames\":[\"ihiclmsln\",\"n\",\"qvzlbbbajdexqu\",\"wexizbfzetjizwh\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"xtvvxna\",\"zixbkay\",\"fm\"],\"portGroupNames\":[\"fwhrmvlaknujmw\",\"nrzblxna\",\"hsmfndcbsyhludzj\",\"kovohwvpr\"]},\"protocolTypes\":[\"vtdu\"],\"vlanMatchCondition\":{\"vlans\":[\"a\",\"ntjna\"],\"innerVlans\":[\"vqiiasbt\",\"skkfkuyikm\",\"hhqsxjbjkewrigl\",\"qtrefe\"],\"vlanGroupNames\":[\"lxcjffzwncv\",\"efx\",\"n\",\"tpcjpt\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"pz\",\"vn\",\"jr\"],\"ipGroupNames\":[\"gsjbi\",\"agwviqehmdqvaoli\",\"xdfsfvkjc\",\"m\"]}}],\"actions\":[{\"type\":\"Replicate\",\"truncate\":\"htjnhptjlrkdc\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"mmydtdtftmizuz\",\"matchConfigurationName\":\"urgyzcslazp\"},{\"type\":\"Mirror\",\"truncate\":\"yimxpggktteagbg\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"pjuytvu\",\"matchConfigurationName\":\"ylpbybki\"},{\"type\":\"Count\",\"truncate\":\"fmxgl\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"raurfshznurt\",\"matchConfigurationName\":\"haaaxxdcdjm\"},{\"type\":\"Mirror\",\"truncate\":\"xfrmbecxstowag\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"ihwe\",\"matchConfigurationName\":\"tjaqgbl\"}]},{\"matchConfigurationName\":\"ncypmtevspsa\",\"sequenceNumber\":2714804594338937684,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"rjokjwqd\",\"raq\",\"il\",\"pqcaigazwfwlrfd\"],\"portGroupNames\":[\"zseodtqfdrslzymq\"]},\"protocolTypes\":[\"rwycu\",\"ytjwgetfigw\",\"eqjxzizebjrahg\",\"stubw\"],\"vlanMatchCondition\":{\"vlans\":[\"sshxliqm\",\"ckwh\",\"mdoiiyobqzwjal\",\"rsofxcacr\"],\"innerVlans\":[\"fmrsuydldpr\"],\"vlanGroupNames\":[\"xfkz\",\"ztirjvqxvwkiocxo\",\"rjwbuocqflm\",\"lrlqxbctatezyozd\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"xc\",\"cnitodmrahjji\",\"odnvltcvma\",\"puwkupbb\"],\"ipGroupNames\":[\"clhyzhrcqd\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"sforsimtfcqmmyn\"],\"portGroupNames\":[\"elpfijtezgxmpes\",\"amadlerzi\",\"f\",\"ivczktllxswtdap\"]},\"protocolTypes\":[\"rmnrijefmrtwxc\",\"vdsp\",\"hgffmwtblgm\"],\"vlanMatchCondition\":{\"vlans\":[\"oikxiefwln\",\"lkffcnuestb\",\"liejdn\",\"cotelikjiyteh\"],\"innerVlans\":[\"zxqdwbymu\",\"lngncrdorc\"],\"vlanGroupNames\":[\"ecpekhxdbyhqtzcv\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"vlfy\",\"trtsvx\",\"pqtz\"],\"ipGroupNames\":[\"bcbkgnrfr\",\"schjxncqzah\",\"tvbgdobi\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"gihtrxueqb\",\"xqfg\",\"znjqswshe\",\"gcsqosecxlngou\"],\"portGroupNames\":[\"zpbm\"]},\"protocolTypes\":[\"spfyvslazip\",\"lxgtdu\",\"jtyc\"],\"vlanMatchCondition\":{\"vlans\":[\"znlaxozqthk\",\"xfugfzizyxd\"],\"innerVlans\":[\"nqzbrq\"],\"vlanGroupNames\":[\"mfckviyju\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"itwhmucjiu\",\"cxyvehykl\",\"lyqdvpqfbxgyc\"],\"ipGroupNames\":[\"sdmtxqlefnoh\",\"yw\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"ey\",\"nj\",\"w\",\"msfwtwrsvevcneq\"],\"portGroupNames\":[\"hqhg\"]},\"protocolTypes\":[\"bzvulqevvjncpmy\",\"t\",\"gdmvghcmixmlwkf\",\"fbcyjrtalqeebud\"],\"vlanMatchCondition\":{\"vlans\":[\"ooaezktom\"],\"innerVlans\":[\"ih\"],\"vlanGroupNames\":[\"bywa\",\"zbaeeek\",\"ztvn\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"noljdkxhmewy\",\"olclzxkrd\"],\"ipGroupNames\":[\"ytbpkrpkhqetpo\",\"nefnoafp\",\"nrxiyrxow\"]}}],\"actions\":[{\"type\":\"Log\",\"truncate\":\"uajwblxph\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"rf\",\"matchConfigurationName\":\"tnnsvrfajy\"},{\"type\":\"Log\",\"truncate\":\"ibufg\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"luctblf\",\"matchConfigurationName\":\"bgcgyohrcmeqlj\"},{\"type\":\"Replicate\",\"truncate\":\"hycxon\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"xa\",\"matchConfigurationName\":\"d\"}]},{\"matchConfigurationName\":\"wcn\",\"sequenceNumber\":8634204698322512413,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"tsrpjuvgzacr\"],\"portGroupNames\":[\"sbylgmgbh\",\"qczouanbfulvcxgl\",\"oqwb\"]},\"protocolTypes\":[\"lqbzbwb\",\"wzhbhflj\",\"yodpiovnlhrwy\",\"kzu\"],\"vlanMatchCondition\":{\"vlans\":[\"wxsvdeatj\",\"obnirgoextqdn\",\"tg\",\"timznupbmt\"],\"innerVlans\":[\"tkodsqvhedaakg\",\"crzm\"],\"vlanGroupNames\":[\"yvdhdgdiwmlg\",\"tmfetqjisjmolzca\",\"fkakhgkrvtyycvy\",\"v\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"sqpfzx\",\"czbdypbbimh\",\"bozvo\"],\"ipGroupNames\":[\"clnh\",\"jcyuzlybqsci\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"afnwqh\"],\"portGroupNames\":[\"cnviulby\",\"mgjz\",\"y\",\"wpbgumwhmxp\"]},\"protocolTypes\":[\"nsastl\",\"smg\",\"micttrvl\",\"vjmxokxxamq\"],\"vlanMatchCondition\":{\"vlans\":[\"zvlcivqxdemkl\",\"hxwwwlojkbg\",\"fbrz\",\"vfsunhaevla\"],\"innerVlans\":[\"zywywuah\",\"corewcnnaaxqjfda\",\"rfgimomggewdqbxe\"],\"vlanGroupNames\":[\"z\",\"vussuqks\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"qbyeywpmoh\",\"rtlikff\",\"dzt\",\"qrf\"],\"ipGroupNames\":[\"nzfwvz\",\"teqjmyqxuhgk\",\"xnyprijyoxxj\",\"bs\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"yfp\",\"ms\"],\"portGroupNames\":[\"emqom\"]},\"protocolTypes\":[\"lknuyapvibzicyvi\",\"hcaptkhjx\",\"rkbn\",\"fcck\"],\"vlanMatchCondition\":{\"vlans\":[\"nfgvlx\",\"xmnctigpksywi\"],\"innerVlans\":[\"ktgkdprtqjytdc\",\"efuhb\"],\"vlanGroupNames\":[\"vjsbgmlamoaxc\",\"ytn\",\"kvbpbl\",\"cw\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"nqoubvepvlrys\",\"fhdxyfhxohzbzhha\",\"zf\",\"xnvkdslcofuvtfue\"],\"ipGroupNames\":[\"isaklhjfd\",\"xqf\",\"ssubzssp\",\"jvailfauyvxpqw\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"rthldwvoglff\",\"dhg\",\"lor\",\"hbtofc\"],\"portGroupNames\":[\"yl\",\"cnsdy\",\"m\",\"qunkygb\"]},\"protocolTypes\":[\"s\",\"kwedwlx\",\"zhgbgbhudh\",\"pjimvrrqfibpkwm\"],\"vlanMatchCondition\":{\"vlans\":[\"fizju\"],\"innerVlans\":[\"d\"],\"vlanGroupNames\":[\"pngyhylqyafe\",\"cmo\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"nxrqxrtzeargvf\",\"khbjhmv\",\"jxs\",\"hw\"],\"ipGroupNames\":[\"nybffqcwwyn\",\"pktvm\",\"gvconysebjij\",\"hpxnikouox\"]}}],\"actions\":[{\"type\":\"Count\",\"truncate\":\"skk\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"sy\",\"matchConfigurationName\":\"eunbydlg\"},{\"type\":\"Log\",\"truncate\":\"wuubwtsaynrtv\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"eeoxvqjmrnbl\",\"matchConfigurationName\":\"sdbfbmdiv\"}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{\"name\":\"gqzmiaoawe\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"ubuhruetcnxriqz\"]},{\"name\":\"ckh\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"jsurnowobwxrxm\",\"okohlsfj\",\"ouqjp\"]},{\"name\":\"eahu\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"kvad\",\"jhymudjmaajzdeb\",\"sermclyqw\"]},{\"name\":\"hyqkaaptbssvkbcb\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"loccuhplx\",\"bnsshvq\"]}],\"vlanGroups\":[{\"name\":\"beuybutcdzjf\",\"vlans\":[\"peyxdyuxurxr\",\"tqmmijgpqfkwna\",\"ikczscymqfv\",\"g\"]},{\"name\":\"qnyumz\",\"vlans\":[\"okez\",\"pe\"]},{\"name\":\"nfzqnzbflbqmh\",\"vlans\":[\"xxvwedhagq\",\"bs\",\"seayuflmsyzz\",\"crolrzesbomp\"]},{\"name\":\"kymunwjivtb\",\"vlans\":[\"bdjrd\",\"eujywdalisdeqngc\",\"ydzin\",\"ooulpoz\"]}],\"portGroups\":[{\"name\":\"yclxrs\",\"ports\":[\"ebldpo\",\"affjkrtnh\"]},{\"name\":\"vimxmaxcjppit\",\"ports\":[\"dwdsoqtbfkvuozbz\",\"hn\",\"ekwanklp\",\"rlcydjht\"]},{\"name\":\"serwiyndurdonkg\",\"ports\":[\"blrdolenr\",\"wknpdrg\",\"mzaof\"]},{\"name\":\"efqckievyrejyo\",\"ports\":[\"qftusdwmnrtvvbuc\"]}]},{\"ipGroups\":[{\"name\":\"v\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"wsicvwqzoc\",\"f\",\"hennmsgpywdib\",\"gvnrgalvwrhr\"]},{\"name\":\"brbknuubxcwoj\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"vnpyeevffifujgtd\"]}],\"vlanGroups\":[{\"name\":\"mwefcbyb\",\"vlans\":[\"rtczwjcujyznvyrj\",\"djlgkuirxxeuwii\",\"rcvnfg\"]},{\"name\":\"viwxohktxagfuj\",\"vlans\":[\"jnyexbvxgxqq\"]},{\"name\":\"sfeooqftpv\",\"vlans\":[\"arp\"]},{\"name\":\"lqliiqeanuwgjnof\",\"vlans\":[\"y\",\"gseb\"]}],\"portGroups\":[{\"name\":\"tevaebzm\",\"ports\":[\"hrjkejvaedogz\",\"ugxbxxgjogcph\",\"v\",\"hrm\"]}]}],\"annotation\":\"nfdv\"}") - .toObject(NetworkTapRulePatchProperties.class); - Assertions.assertEquals("nfdv", model.annotation()); - Assertions.assertEquals(ConfigurationType.INLINE, model.configurationType()); - Assertions.assertEquals("t", model.tapRulesUrl()); - Assertions.assertEquals("zdjmofsvpzxgny", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(2171958133476599680L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals("hg", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "jpvqerqxko", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "wwvmbjec", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "dsnjzpchiypb", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.SOURCE_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.LONGEST_PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "qozewbr", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "uudrizwkwkjxlaac", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions - .assertEquals( - EncapsulationType.GTPV1, - model.matchConfigurations().get(0).matchConditions().get(0).encapsulationType()); - Assertions - .assertEquals( - PortType.SOURCE_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "cfyzqpeqregfu", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "aovrgihlnzffewv", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions - .assertEquals(TapRuleActionType.REPLICATE, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("htjnhptjlrkdc", model.matchConfigurations().get(0).actions().get(0).truncate()); - Assertions - .assertEquals( - BooleanEnumProperty.FALSE, model.matchConfigurations().get(0).actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("mmydtdtftmizuz", model.matchConfigurations().get(0).actions().get(0).destinationId()); - Assertions - .assertEquals("urgyzcslazp", model.matchConfigurations().get(0).actions().get(0).matchConfigurationName()); - Assertions.assertEquals("gqzmiaoawe", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV6, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals( - "ubuhruetcnxriqz", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("beuybutcdzjf", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("peyxdyuxurxr", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("yclxrs", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("ebldpo", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapRulePatchProperties model = - new NetworkTapRulePatchProperties() - .withAnnotation("nfdv") - .withConfigurationType(ConfigurationType.INLINE) - .withTapRulesUrl("t") - .withMatchConfigurations( - Arrays - .asList( - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("zdjmofsvpzxgny") - .withSequenceNumber(2171958133476599680L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("hg", "lejqzhpvhxp", "adj", "eullgfyog")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("jpvqerqxko", "wdzpzl", "cuex")) - .withInnerVlans(Arrays.asList("wwvmbjec", "wlbg", "nkfrwxo")) - .withVlanGroupNames(Arrays.asList("dsnjzpchiypb"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays - .asList( - "qozewbr", "rjzgkbrauxbo", "fq", "nqbjxgjwsrer")) - .withIpGroupNames( - Arrays - .asList( - "uudrizwkwkjxlaac", - "dikqelssybz", - "evgb", - "rommkiqhypwt"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("cfyzqpeqregfu", "dpagk")) - .withPortGroupNames( - Arrays - .asList( - "aovrgihlnzffewv", "kycjcg", "ipqxxsdyafwtydsm"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("iywhxpsb", "pialezay", "puz", "degefxlieggoto")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("sfnwh")) - .withInnerVlans(Arrays.asList("hh")) - .withVlanGroupNames(Arrays.asList("nfmkcuft", "dgwuzron"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("nwysodcikgxkkzzf")) - .withIpGroupNames( - Arrays.asList("ekebawnxzs", "wyfixi", "gcjf", "iwu"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("mzqlnaag")) - .withPortGroupNames(Arrays.asList("j"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("yliuajklnacg")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays.asList("eonmzrjjaojp", "ngdrzigecwsadsq", "udd")) - .withInnerVlans(Arrays.asList("qdmohheuyuunxmy")) - .withVlanGroupNames(Arrays.asList("igdeipnfizejwli"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays - .asList("hajodapqok", "dyncradxsewbe", "pfapmqnmelyk")) - .withIpGroupNames( - Arrays - .asList( - "ihiclmsln", - "n", - "qvzlbbbajdexqu", - "wexizbfzetjizwh"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("fqnfforxsq", "zngxb")) - .withPortGroupNames( - Arrays - .asList( - "ewg", "xcmmhipbvskcitly", "kwfsaangfgbm", "vm"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("vtdu")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("a", "ntjna")) - .withInnerVlans( - Arrays - .asList( - "vqiiasbt", - "skkfkuyikm", - "hhqsxjbjkewrigl", - "qtrefe")) - .withVlanGroupNames( - Arrays.asList("lxcjffzwncv", "efx", "n", "tpcjpt"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("pz", "vn", "jr")) - .withIpGroupNames( - Arrays - .asList("gsjbi", "agwviqehmdqvaoli", "xdfsfvkjc", "m"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("xtvvxna", "zixbkay", "fm")) - .withPortGroupNames( - Arrays - .asList( - "fwhrmvlaknujmw", - "nrzblxna", - "hsmfndcbsyhludzj", - "kovohwvpr"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.REPLICATE) - .withTruncate("htjnhptjlrkdc") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("mmydtdtftmizuz") - .withMatchConfigurationName("urgyzcslazp"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.MIRROR) - .withTruncate("yimxpggktteagbg") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("pjuytvu") - .withMatchConfigurationName("ylpbybki"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.COUNT) - .withTruncate("fmxgl") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("raurfshznurt") - .withMatchConfigurationName("haaaxxdcdjm"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.MIRROR) - .withTruncate("xfrmbecxstowag") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("ihwe") - .withMatchConfigurationName("tjaqgbl"))), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("ncypmtevspsa") - .withSequenceNumber(2714804594338937684L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("rwycu", "ytjwgetfigw", "eqjxzizebjrahg", "stubw")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "sshxliqm", "ckwh", "mdoiiyobqzwjal", "rsofxcacr")) - .withInnerVlans(Arrays.asList("fmrsuydldpr")) - .withVlanGroupNames( - Arrays - .asList( - "xfkz", - "ztirjvqxvwkiocxo", - "rjwbuocqflm", - "lrlqxbctatezyozd"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays - .asList( - "xc", "cnitodmrahjji", "odnvltcvma", "puwkupbb")) - .withIpGroupNames(Arrays.asList("clhyzhrcqd"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts( - Arrays.asList("rjokjwqd", "raq", "il", "pqcaigazwfwlrfd")) - .withPortGroupNames(Arrays.asList("zseodtqfdrslzymq"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("rmnrijefmrtwxc", "vdsp", "hgffmwtblgm")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "oikxiefwln", - "lkffcnuestb", - "liejdn", - "cotelikjiyteh")) - .withInnerVlans(Arrays.asList("zxqdwbymu", "lngncrdorc")) - .withVlanGroupNames(Arrays.asList("ecpekhxdbyhqtzcv"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("vlfy", "trtsvx", "pqtz")) - .withIpGroupNames( - Arrays.asList("bcbkgnrfr", "schjxncqzah", "tvbgdobi"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("sforsimtfcqmmyn")) - .withPortGroupNames( - Arrays - .asList( - "elpfijtezgxmpes", - "amadlerzi", - "f", - "ivczktllxswtdap"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("spfyvslazip", "lxgtdu", "jtyc")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("znlaxozqthk", "xfugfzizyxd")) - .withInnerVlans(Arrays.asList("nqzbrq")) - .withVlanGroupNames(Arrays.asList("mfckviyju"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("itwhmucjiu", "cxyvehykl", "lyqdvpqfbxgyc")) - .withIpGroupNames(Arrays.asList("sdmtxqlefnoh", "yw"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts( - Arrays - .asList( - "gihtrxueqb", - "xqfg", - "znjqswshe", - "gcsqosecxlngou")) - .withPortGroupNames(Arrays.asList("zpbm"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays - .asList( - "bzvulqevvjncpmy", - "t", - "gdmvghcmixmlwkf", - "fbcyjrtalqeebud")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("ooaezktom")) - .withInnerVlans(Arrays.asList("ih")) - .withVlanGroupNames(Arrays.asList("bywa", "zbaeeek", "ztvn"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("noljdkxhmewy", "olclzxkrd")) - .withIpGroupNames( - Arrays.asList("ytbpkrpkhqetpo", "nefnoafp", "nrxiyrxow"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("ey", "nj", "w", "msfwtwrsvevcneq")) - .withPortGroupNames(Arrays.asList("hqhg"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.LOG) - .withTruncate("uajwblxph") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("rf") - .withMatchConfigurationName("tnnsvrfajy"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.LOG) - .withTruncate("ibufg") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("luctblf") - .withMatchConfigurationName("bgcgyohrcmeqlj"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.REPLICATE) - .withTruncate("hycxon") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("xa") - .withMatchConfigurationName("d"))), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("wcn") - .withSequenceNumber(8634204698322512413L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("lqbzbwb", "wzhbhflj", "yodpiovnlhrwy", "kzu")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "wxsvdeatj", "obnirgoextqdn", "tg", "timznupbmt")) - .withInnerVlans(Arrays.asList("tkodsqvhedaakg", "crzm")) - .withVlanGroupNames( - Arrays - .asList( - "yvdhdgdiwmlg", - "tmfetqjisjmolzca", - "fkakhgkrvtyycvy", - "v"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays.asList("sqpfzx", "czbdypbbimh", "bozvo")) - .withIpGroupNames(Arrays.asList("clnh", "jcyuzlybqsci"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("tsrpjuvgzacr")) - .withPortGroupNames( - Arrays.asList("sbylgmgbh", "qczouanbfulvcxgl", "oqwb"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("nsastl", "smg", "micttrvl", "vjmxokxxamq")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "zvlcivqxdemkl", - "hxwwwlojkbg", - "fbrz", - "vfsunhaevla")) - .withInnerVlans( - Arrays - .asList( - "zywywuah", "corewcnnaaxqjfda", "rfgimomggewdqbxe")) - .withVlanGroupNames(Arrays.asList("z", "vussuqks"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("qbyeywpmoh", "rtlikff", "dzt", "qrf")) - .withIpGroupNames( - Arrays - .asList( - "nzfwvz", "teqjmyqxuhgk", "xnyprijyoxxj", "bs"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("afnwqh")) - .withPortGroupNames( - Arrays.asList("cnviulby", "mgjz", "y", "wpbgumwhmxp"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("lknuyapvibzicyvi", "hcaptkhjx", "rkbn", "fcck")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("nfgvlx", "xmnctigpksywi")) - .withInnerVlans(Arrays.asList("ktgkdprtqjytdc", "efuhb")) - .withVlanGroupNames( - Arrays.asList("vjsbgmlamoaxc", "ytn", "kvbpbl", "cw"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays - .asList( - "nqoubvepvlrys", - "fhdxyfhxohzbzhha", - "zf", - "xnvkdslcofuvtfue")) - .withIpGroupNames( - Arrays - .asList( - "isaklhjfd", "xqf", "ssubzssp", "jvailfauyvxpqw"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("yfp", "ms")) - .withPortGroupNames(Arrays.asList("emqom"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("s", "kwedwlx", "zhgbgbhudh", "pjimvrrqfibpkwm")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("fizju")) - .withInnerVlans(Arrays.asList("d")) - .withVlanGroupNames(Arrays.asList("pngyhylqyafe", "cmo"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays.asList("nxrqxrtzeargvf", "khbjhmv", "jxs", "hw")) - .withIpGroupNames( - Arrays - .asList( - "nybffqcwwyn", - "pktvm", - "gvconysebjij", - "hpxnikouox"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays.asList("rthldwvoglff", "dhg", "lor", "hbtofc")) - .withPortGroupNames( - Arrays.asList("yl", "cnsdy", "m", "qunkygb"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.COUNT) - .withTruncate("skk") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("sy") - .withMatchConfigurationName("eunbydlg"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.LOG) - .withTruncate("wuubwtsaynrtv") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("eeoxvqjmrnbl") - .withMatchConfigurationName("sdbfbmdiv"))))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("gqzmiaoawe") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("ubuhruetcnxriqz")), - new IpGroupProperties() - .withName("ckh") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("jsurnowobwxrxm", "okohlsfj", "ouqjp")), - new IpGroupProperties() - .withName("eahu") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("kvad", "jhymudjmaajzdeb", "sermclyqw")), - new IpGroupProperties() - .withName("hyqkaaptbssvkbcb") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("loccuhplx", "bnsshvq")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("beuybutcdzjf") - .withVlans( - Arrays - .asList("peyxdyuxurxr", "tqmmijgpqfkwna", "ikczscymqfv", "g")), - new VlanGroupProperties() - .withName("qnyumz") - .withVlans(Arrays.asList("okez", "pe")), - new VlanGroupProperties() - .withName("nfzqnzbflbqmh") - .withVlans( - Arrays.asList("xxvwedhagq", "bs", "seayuflmsyzz", "crolrzesbomp")), - new VlanGroupProperties() - .withName("kymunwjivtb") - .withVlans( - Arrays.asList("bdjrd", "eujywdalisdeqngc", "ydzin", "ooulpoz")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("yclxrs") - .withPorts(Arrays.asList("ebldpo", "affjkrtnh")), - new PortGroupProperties() - .withName("vimxmaxcjppit") - .withPorts( - Arrays.asList("dwdsoqtbfkvuozbz", "hn", "ekwanklp", "rlcydjht")), - new PortGroupProperties() - .withName("serwiyndurdonkg") - .withPorts(Arrays.asList("blrdolenr", "wknpdrg", "mzaof")), - new PortGroupProperties() - .withName("efqckievyrejyo") - .withPorts(Arrays.asList("qftusdwmnrtvvbuc")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("v") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays.asList("wsicvwqzoc", "f", "hennmsgpywdib", "gvnrgalvwrhr")), - new IpGroupProperties() - .withName("brbknuubxcwoj") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("vnpyeevffifujgtd")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("mwefcbyb") - .withVlans( - Arrays.asList("rtczwjcujyznvyrj", "djlgkuirxxeuwii", "rcvnfg")), - new VlanGroupProperties() - .withName("viwxohktxagfuj") - .withVlans(Arrays.asList("jnyexbvxgxqq")), - new VlanGroupProperties() - .withName("sfeooqftpv") - .withVlans(Arrays.asList("arp")), - new VlanGroupProperties() - .withName("lqliiqeanuwgjnof") - .withVlans(Arrays.asList("y", "gseb")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("tevaebzm") - .withPorts( - Arrays.asList("hrjkejvaedogz", "ugxbxxgjogcph", "v", "hrm")))))); - model = BinaryData.fromObject(model).toObject(NetworkTapRulePatchProperties.class); - Assertions.assertEquals("nfdv", model.annotation()); - Assertions.assertEquals(ConfigurationType.INLINE, model.configurationType()); - Assertions.assertEquals("t", model.tapRulesUrl()); - Assertions.assertEquals("zdjmofsvpzxgny", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(2171958133476599680L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals("hg", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "jpvqerqxko", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "wwvmbjec", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "dsnjzpchiypb", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.SOURCE_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.LONGEST_PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "qozewbr", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "uudrizwkwkjxlaac", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions - .assertEquals( - EncapsulationType.GTPV1, - model.matchConfigurations().get(0).matchConditions().get(0).encapsulationType()); - Assertions - .assertEquals( - PortType.SOURCE_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "cfyzqpeqregfu", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "aovrgihlnzffewv", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions - .assertEquals(TapRuleActionType.REPLICATE, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("htjnhptjlrkdc", model.matchConfigurations().get(0).actions().get(0).truncate()); - Assertions - .assertEquals( - BooleanEnumProperty.FALSE, model.matchConfigurations().get(0).actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("mmydtdtftmizuz", model.matchConfigurations().get(0).actions().get(0).destinationId()); - Assertions - .assertEquals("urgyzcslazp", model.matchConfigurations().get(0).actions().get(0).matchConfigurationName()); - Assertions.assertEquals("gqzmiaoawe", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV6, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals( - "ubuhruetcnxriqz", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("beuybutcdzjf", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("peyxdyuxurxr", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("yclxrs", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("ebldpo", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePatchTests.java deleted file mode 100644 index d1a70cd72ad5..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePatchTests.java +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.EncapsulationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleAction; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRulePatch; -import com.azure.resourcemanager.managednetworkfabric.models.PortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.TapRuleActionType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapRulePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapRulePatch model = - BinaryData - .fromString( - "{\"properties\":{\"configurationType\":\"Inline\",\"tapRulesUrl\":\"sgw\",\"matchConfigurations\":[{\"matchConfigurationName\":\"er\",\"sequenceNumber\":7850362678518268102,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"f\",\"qcooplfpohimgcky\"],\"vlanMatchCondition\":{},\"ipCondition\":{}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"layer4Protocol\":\"UDP\"},\"protocolTypes\":[\"znxsuloutnpbm\",\"ooqohgp\",\"cdmwk\",\"upf\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Replicate\",\"truncate\":\"uiunyevdyzdsyt\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"whcamwuynfxkc\",\"matchConfigurationName\":\"fcmvhadrpb\"}]},{\"matchConfigurationName\":\"vyrkljqkq\",\"sequenceNumber\":4996287303866483560,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"None\",\"portCondition\":{\"layer4Protocol\":\"TCP\"},\"protocolTypes\":[\"wwdmbyp\",\"kteiidlbovwbclpr\",\"eganihk\",\"cnerekyjul\"],\"vlanMatchCondition\":{},\"ipCondition\":{}}],\"actions\":[{\"type\":\"Redirect\",\"truncate\":\"lqgpwxtvceba\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"xwvegenlrj\",\"matchConfigurationName\":\"mwevguyflnxel\"}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{\"name\":\"detowwezhyfkdilb\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"csfqbirtybce\",\"fjnxodnjyhzfaxs\"]},{\"name\":\"vuelumodpegqxso\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"rqoxzyhlbeqvhskb\",\"pwxslaj\",\"gf\",\"gaef\"]}],\"vlanGroups\":[{\"name\":\"mibuyd\",\"vlans\":[\"rnicupdyttqmi\"]},{\"name\":\"jplosebmh\",\"vlans\":[\"qmtxynoflqobf\",\"xngxebihexhnkin\",\"iqcdolrpg\"]},{\"name\":\"sjlbsmndaf\",\"vlans\":[\"uyje\",\"kcnhpplzhc\",\"zxjziuu\",\"rlnewnuwkkfzzetl\"]}],\"portGroups\":[{\"name\":\"xzlv\",\"ports\":[\"j\",\"rlgqp\",\"w\",\"zpddarcbcdwhs\"]},{\"name\":\"ebajadknms\",\"ports\":[\"oprwkampyh\",\"pbldz\",\"iudrcycmwhuzym\"]},{\"name\":\"hihqknlvkmnbzko\",\"ports\":[\"ildcpudkhqu\",\"syjo\"]}]},{\"ipGroups\":[{\"name\":\"edrobujnjgybuxm\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"du\",\"l\",\"jgcpskgrhnytslg\",\"az\"]},{\"name\":\"znghxhk\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"dkpvnrvzw\",\"ffxsfybntmveh\",\"hflyuvbgtz\"]},{\"name\":\"qweuydyb\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"hpq\",\"vbzeogeat\",\"cnqnvncpr\",\"csjvjnkoiznzsqbi\"]}],\"vlanGroups\":[{\"name\":\"gicovjt\",\"vlans\":[\"rmjxyvuodnxc\"]},{\"name\":\"assqfy\",\"vlans\":[\"ppeygkbzbloasy\",\"xhqvovdpmht\"]},{\"name\":\"vsqjs\",\"vlans\":[\"nqt\",\"qgxqbfkc\"]},{\"name\":\"ncnr\",\"vlans\":[\"biywevs\"]}],\"portGroups\":[{\"name\":\"mnszdosmjsqsvzvm\",\"ports\":[\"wghndaevhgs\",\"lwvgseufigv\",\"jjuzk\",\"lmciwuhyzeky\"]},{\"name\":\"ovljlbzdlbybpaxh\",\"ports\":[\"s\",\"v\"]},{\"name\":\"wbh\",\"ports\":[\"gesfhshagpahn\"]},{\"name\":\"pbyfyvynpmggq\",\"ports\":[\"envqbugihcd\"]}]},{\"ipGroups\":[{\"name\":\"zorbloejzsax\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"vde\",\"p\",\"naphifkfrpmpl\",\"bpebrmj\"]},{\"name\":\"fpghtbttpkim\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"khbykrsmhrcme\",\"ycpgokuthrvyb\",\"zbnv\"]},{\"name\":\"hfuzzlapyixlvz\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"ebxiauqsuptessj\"]}],\"vlanGroups\":[{\"name\":\"atpvbl\",\"vlans\":[\"gxqaygaslkvcvwpv\",\"cj\"]},{\"name\":\"yezj\",\"vlans\":[\"qonbwhiieyoz\"]},{\"name\":\"cwf\",\"vlans\":[\"wnbcgqefgzjvbx\",\"cbgoarxtuuciagv\",\"dlhuduklbjo\",\"fmjfexulv\"]},{\"name\":\"pknarse\",\"vlans\":[\"csqoacbuqdgs\",\"pleqfgkxenvszglv\",\"akeszsuuvul\"]}],\"portGroups\":[{\"name\":\"ggchxvlqgf\",\"ports\":[\"ecicaovph\",\"rlzbipi\"]}]},{\"ipGroups\":[{\"name\":\"pkwzzzkueruwcj\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"wkau\",\"ttwyk\",\"xv\"]}],\"vlanGroups\":[{\"name\":\"xxdplrelfkvga\",\"vlans\":[\"tuxlbpxrhrfjen\",\"azwef\",\"ktlhqash\",\"ostjixyz\"]},{\"name\":\"cigz\",\"vlans\":[\"j\",\"acfvvtdpcbpzf\"]},{\"name\":\"csaugbrhfiwltkfy\",\"vlans\":[\"te\",\"hkl\",\"whcv\"]}],\"portGroups\":[{\"name\":\"hgqok\",\"ports\":[\"srkixy\",\"xhwr\",\"qomaqsyilpzzbrw\",\"rzozsxagyso\"]},{\"name\":\"iiksybvrrbnhyl\",\"ports\":[\"ujcy\"]},{\"name\":\"llmxvpstiz\",\"ports\":[\"agq\"]}]}],\"annotation\":\"cbrvaidylkyhtrr\"},\"tags\":{\"rnogyk\":\"yybptmj\",\"thkslgeuufkb\":\"gdlavsav\",\"lajybdnb\":\"bfbxj\"}}") - .toObject(NetworkTapRulePatch.class); - Assertions.assertEquals("yybptmj", model.tags().get("rnogyk")); - Assertions.assertEquals(ConfigurationType.INLINE, model.configurationType()); - Assertions.assertEquals("sgw", model.tapRulesUrl()); - Assertions.assertEquals("er", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(7850362678518268102L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals("f", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - EncapsulationType.GTPV1, - model.matchConfigurations().get(0).matchConditions().get(0).encapsulationType()); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals(TapRuleActionType.REPLICATE, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("uiunyevdyzdsyt", model.matchConfigurations().get(0).actions().get(0).truncate()); - Assertions - .assertEquals( - BooleanEnumProperty.FALSE, model.matchConfigurations().get(0).actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("whcamwuynfxkc", model.matchConfigurations().get(0).actions().get(0).destinationId()); - Assertions - .assertEquals("fcmvhadrpb", model.matchConfigurations().get(0).actions().get(0).matchConfigurationName()); - Assertions.assertEquals("detowwezhyfkdilb", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV6, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals( - "csfqbirtybce", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("mibuyd", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals( - "rnicupdyttqmi", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("xzlv", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("j", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - Assertions.assertEquals("cbrvaidylkyhtrr", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapRulePatch model = - new NetworkTapRulePatch() - .withTags(mapOf("rnogyk", "yybptmj", "thkslgeuufkb", "gdlavsav", "lajybdnb", "bfbxj")) - .withConfigurationType(ConfigurationType.INLINE) - .withTapRulesUrl("sgw") - .withMatchConfigurations( - Arrays - .asList( - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("er") - .withSequenceNumber(7850362678518268102L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("f", "qcooplfpohimgcky")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition().withLayer4Protocol(Layer4Protocol.TCP)), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("znxsuloutnpbm", "ooqohgp", "cdmwk", "upf")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition().withLayer4Protocol(Layer4Protocol.UDP)))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.REPLICATE) - .withTruncate("uiunyevdyzdsyt") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("whcamwuynfxkc") - .withMatchConfigurationName("fcmvhadrpb"))), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("vyrkljqkq") - .withSequenceNumber(4996287303866483560L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays - .asList("wwdmbyp", "kteiidlbovwbclpr", "eganihk", "cnerekyjul")) - .withVlanMatchCondition(new VlanMatchCondition()) - .withIpCondition(new IpMatchCondition()) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition().withLayer4Protocol(Layer4Protocol.TCP)))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.REDIRECT) - .withTruncate("lqgpwxtvceba") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("xwvegenlrj") - .withMatchConfigurationName("mwevguyflnxel"))))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("detowwezhyfkdilb") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("csfqbirtybce", "fjnxodnjyhzfaxs")), - new IpGroupProperties() - .withName("vuelumodpegqxso") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes( - Arrays.asList("rqoxzyhlbeqvhskb", "pwxslaj", "gf", "gaef")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("mibuyd") - .withVlans(Arrays.asList("rnicupdyttqmi")), - new VlanGroupProperties() - .withName("jplosebmh") - .withVlans( - Arrays.asList("qmtxynoflqobf", "xngxebihexhnkin", "iqcdolrpg")), - new VlanGroupProperties() - .withName("sjlbsmndaf") - .withVlans( - Arrays - .asList("uyje", "kcnhpplzhc", "zxjziuu", "rlnewnuwkkfzzetl")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("xzlv") - .withPorts(Arrays.asList("j", "rlgqp", "w", "zpddarcbcdwhs")), - new PortGroupProperties() - .withName("ebajadknms") - .withPorts(Arrays.asList("oprwkampyh", "pbldz", "iudrcycmwhuzym")), - new PortGroupProperties() - .withName("hihqknlvkmnbzko") - .withPorts(Arrays.asList("ildcpudkhqu", "syjo")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("edrobujnjgybuxm") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("du", "l", "jgcpskgrhnytslg", "az")), - new IpGroupProperties() - .withName("znghxhk") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes( - Arrays.asList("dkpvnrvzw", "ffxsfybntmveh", "hflyuvbgtz")), - new IpGroupProperties() - .withName("qweuydyb") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays - .asList("hpq", "vbzeogeat", "cnqnvncpr", "csjvjnkoiznzsqbi")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("gicovjt") - .withVlans(Arrays.asList("rmjxyvuodnxc")), - new VlanGroupProperties() - .withName("assqfy") - .withVlans(Arrays.asList("ppeygkbzbloasy", "xhqvovdpmht")), - new VlanGroupProperties() - .withName("vsqjs") - .withVlans(Arrays.asList("nqt", "qgxqbfkc")), - new VlanGroupProperties() - .withName("ncnr") - .withVlans(Arrays.asList("biywevs")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("mnszdosmjsqsvzvm") - .withPorts( - Arrays - .asList("wghndaevhgs", "lwvgseufigv", "jjuzk", "lmciwuhyzeky")), - new PortGroupProperties() - .withName("ovljlbzdlbybpaxh") - .withPorts(Arrays.asList("s", "v")), - new PortGroupProperties() - .withName("wbh") - .withPorts(Arrays.asList("gesfhshagpahn")), - new PortGroupProperties() - .withName("pbyfyvynpmggq") - .withPorts(Arrays.asList("envqbugihcd")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("zorbloejzsax") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("vde", "p", "naphifkfrpmpl", "bpebrmj")), - new IpGroupProperties() - .withName("fpghtbttpkim") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays.asList("khbykrsmhrcme", "ycpgokuthrvyb", "zbnv")), - new IpGroupProperties() - .withName("hfuzzlapyixlvz") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("ebxiauqsuptessj")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("atpvbl") - .withVlans(Arrays.asList("gxqaygaslkvcvwpv", "cj")), - new VlanGroupProperties() - .withName("yezj") - .withVlans(Arrays.asList("qonbwhiieyoz")), - new VlanGroupProperties() - .withName("cwf") - .withVlans( - Arrays - .asList( - "wnbcgqefgzjvbx", - "cbgoarxtuuciagv", - "dlhuduklbjo", - "fmjfexulv")), - new VlanGroupProperties() - .withName("pknarse") - .withVlans( - Arrays.asList("csqoacbuqdgs", "pleqfgkxenvszglv", "akeszsuuvul")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("ggchxvlqgf") - .withPorts(Arrays.asList("ecicaovph", "rlzbipi")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("pkwzzzkueruwcj") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("wkau", "ttwyk", "xv")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("xxdplrelfkvga") - .withVlans( - Arrays.asList("tuxlbpxrhrfjen", "azwef", "ktlhqash", "ostjixyz")), - new VlanGroupProperties() - .withName("cigz") - .withVlans(Arrays.asList("j", "acfvvtdpcbpzf")), - new VlanGroupProperties() - .withName("csaugbrhfiwltkfy") - .withVlans(Arrays.asList("te", "hkl", "whcv")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("hgqok") - .withPorts( - Arrays.asList("srkixy", "xhwr", "qomaqsyilpzzbrw", "rzozsxagyso")), - new PortGroupProperties() - .withName("iiksybvrrbnhyl") - .withPorts(Arrays.asList("ujcy")), - new PortGroupProperties() - .withName("llmxvpstiz") - .withPorts(Arrays.asList("agq")))))) - .withAnnotation("cbrvaidylkyhtrr"); - model = BinaryData.fromObject(model).toObject(NetworkTapRulePatch.class); - Assertions.assertEquals("yybptmj", model.tags().get("rnogyk")); - Assertions.assertEquals(ConfigurationType.INLINE, model.configurationType()); - Assertions.assertEquals("sgw", model.tapRulesUrl()); - Assertions.assertEquals("er", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(7850362678518268102L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals("f", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - EncapsulationType.GTPV1, - model.matchConfigurations().get(0).matchConditions().get(0).encapsulationType()); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals(TapRuleActionType.REPLICATE, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("uiunyevdyzdsyt", model.matchConfigurations().get(0).actions().get(0).truncate()); - Assertions - .assertEquals( - BooleanEnumProperty.FALSE, model.matchConfigurations().get(0).actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("whcamwuynfxkc", model.matchConfigurations().get(0).actions().get(0).destinationId()); - Assertions - .assertEquals("fcmvhadrpb", model.matchConfigurations().get(0).actions().get(0).matchConfigurationName()); - Assertions.assertEquals("detowwezhyfkdilb", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV6, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals( - "csfqbirtybce", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("mibuyd", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals( - "rnicupdyttqmi", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("xzlv", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("j", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - Assertions.assertEquals("cbrvaidylkyhtrr", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePatchablePropertiesTests.java deleted file mode 100644 index de4f29609c07..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePatchablePropertiesTests.java +++ /dev/null @@ -1,643 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.EncapsulationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleAction; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRulePatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.TapRuleActionType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapRulePatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapRulePatchableProperties model = - BinaryData - .fromString( - "{\"configurationType\":\"File\",\"tapRulesUrl\":\"ny\",\"matchConfigurations\":[{\"matchConfigurationName\":\"vqmvyumgmmu\",\"sequenceNumber\":6829595867395722232,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"yoseqcazisvbr\",\"gcyjpgawepk\",\"on\",\"zpghlrdtbgblxbu\"],\"portGroupNames\":[\"vjztaflvsmfj\",\"hvfj\"]},\"protocolTypes\":[\"tt\",\"fuqmmfjewfeqb\",\"vdostwyg\"],\"vlanMatchCondition\":{\"vlans\":[\"elvxgwzz\"],\"innerVlans\":[\"tlcjgpvcqz\",\"zrbvgw\",\"hlx\"],\"vlanGroupNames\":[\"v\",\"drwynbgovazoym\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"wwd\",\"atveqm\",\"k\"],\"ipGroupNames\":[\"zeyxryearmhp\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"asgtl\",\"hqpoilosja\",\"mcezevftmhllpok\"],\"portGroupNames\":[\"hztmsm\",\"wtpcflcezswwvw\",\"f\",\"djtvbf\"]},\"protocolTypes\":[\"ruptsyqcjnq\",\"wxdowum\"],\"vlanMatchCondition\":{\"vlans\":[\"rcdiohclqddnhf\",\"nebweddpnyzcwyj\"],\"innerVlans\":[\"aqld\",\"abnwvpa\",\"bqxfbb\",\"gcfddofxnfb\"],\"vlanGroupNames\":[\"yrqaedwovoc\",\"tjgo\",\"ayokrwfmihw\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"o\",\"dczvothmkh\",\"aozvbwfcnjhbpoel\"],\"ipGroupNames\":[\"myhrh\",\"vszfqbokndw\",\"ppqwojoevzz\",\"fytdxmly\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"rbuoggtdltlcu\",\"aizijvaylzeohlp\",\"ft\",\"krvmhvbvvcp\"],\"portGroupNames\":[\"suspnhmzy\",\"ffetevrnt\",\"k\",\"wacycsyotctkhf\"]},\"protocolTypes\":[\"atvcsxr\",\"hnmizhvprhqq\"],\"vlanMatchCondition\":{\"vlans\":[\"lehhkplobzg\",\"ttak\",\"adzighmmtbt\"],\"innerVlans\":[\"cfvvraabe\"],\"vlanGroupNames\":[\"eewlsuxpcbw\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"nioroofmft\"],\"ipGroupNames\":[\"mcreihu\",\"trnighm\"]}}],\"actions\":[{\"type\":\"Replicate\",\"truncate\":\"ungrobgwfmsx\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"lwxmvzjowz\",\"matchConfigurationName\":\"eerclbltbhpw\"},{\"type\":\"Mirror\",\"truncate\":\"eurjwmvwry\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"kiikgpruccwmecbt\",\"matchConfigurationName\":\"ytrtexegwmrq\"},{\"type\":\"Redirect\",\"truncate\":\"whvycfjncin\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"q\",\"matchConfigurationName\":\"jwjuriarsb\"}]},{\"matchConfigurationName\":\"lanhzcknjxizba\",\"sequenceNumber\":7000496485104697500,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"yjmlxppdndzkfe\",\"uiiu\"],\"portGroupNames\":[\"fkcjytqdcizeqqfo\"]},\"protocolTypes\":[\"opmotdsf\"],\"vlanMatchCondition\":{\"vlans\":[\"lyo\",\"zyfbkmvldzmxojz\",\"vmaigbqkvhyejth\"],\"innerVlans\":[\"cb\",\"ergwlckihbam\",\"qsokknpug\"],\"vlanGroupNames\":[\"dizcrj\",\"x\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"xgkrswksykkbxk\",\"xbbwlmnwz\"],\"ipGroupNames\":[\"vuqddlgg\",\"q\",\"olgzubakdlkv\",\"gcmfnsffetpkmixw\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"epnqvxgvohdb\",\"hhxmoevvud\",\"epfhgannvwx\",\"hpjhubohxvzga\"],\"portGroupNames\":[\"rhhogalgxnw\",\"mzvztauebpa\",\"qxfcssanybzzgh\"]},\"protocolTypes\":[\"eum\"],\"vlanMatchCondition\":{\"vlans\":[\"cdhlywkho\"],\"innerVlans\":[\"unzxezriw\",\"oewapcqksaaapxjh\",\"itibenwsdf\"],\"vlanGroupNames\":[\"aahlfr\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"pireszyaqgomlbmf\",\"geokfekcjj\"],\"ipGroupNames\":[\"yeahhhutpulnrfcq\",\"fmcihpinowr\",\"rjpxptch\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"mlgbbfjmdgjv\",\"lhmpm\",\"eftyaphqeofytl\"],\"portGroupNames\":[\"owm\",\"mcqixuanccqvjf\"]},\"protocolTypes\":[\"qpmquxpjhcf\",\"arad\",\"iovmufzgugrblwal\"],\"vlanMatchCondition\":{\"vlans\":[\"nqebaotbptgc\",\"manxx\",\"wqfmdqecvta\"],\"innerVlans\":[\"zmnobfeww\",\"sibxovuqo\",\"jrkblndyclwgycv\",\"qnzjcyqqz\"],\"vlanGroupNames\":[\"btbw\",\"alb\",\"dpisjdl\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"ooubsfxipj\",\"opskgocjomlupfa\"],\"ipGroupNames\":[\"jcdhus\"]}}],\"actions\":[{\"type\":\"Log\",\"truncate\":\"gdqyxajc\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"avqcwy\",\"matchConfigurationName\":\"qzkmqc\"},{\"type\":\"Replicate\",\"truncate\":\"nkiixepbntq\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"fgsqxile\",\"matchConfigurationName\":\"jsewrz\"},{\"type\":\"Drop\",\"truncate\":\"qynttwknh\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"bsyogjmqjhgcyd\",\"matchConfigurationName\":\"nm\"}]},{\"matchConfigurationName\":\"jbssfcri\",\"sequenceNumber\":5139041492172174883,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"cpxpyafrwr\",\"orogeuv\",\"krspnrsjsemlz\"],\"portGroupNames\":[\"snqpljpete\",\"utikelpmwgrpu\",\"wu\"]},\"protocolTypes\":[\"osgjzscuez\",\"livdfwg\",\"j\"],\"vlanMatchCondition\":{\"vlans\":[\"f\",\"rxggezkhzp\"],\"innerVlans\":[\"issenerru\",\"yzaivnpsjnpckpl\"],\"vlanGroupNames\":[\"duonbdawsa\",\"pl\",\"vmnb\",\"xjarsbb\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"ailxqkdyqjvzvcg\",\"dspzesfkqqxuhv\"],\"ipGroupNames\":[\"brouszxac\",\"wukokgoojj\",\"uktubcmunhgbtzv\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"krfnkcni\",\"kswxmfu\",\"qmwmwwp\"],\"portGroupNames\":[\"motahbqsvnk\"]},\"protocolTypes\":[\"tzuaedrlhxgcq\",\"yrhkvxzzmiem\",\"yftgpqoswgfqv\"],\"vlanMatchCondition\":{\"vlans\":[\"pakbqyhlsor\"],\"innerVlans\":[\"meqagkncjmyb\"],\"vlanGroupNames\":[\"vztnjawrhulemm\",\"mbwppxirxbkitzmn\",\"itaxju\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"cemegdzdvyljubv\"],\"ipGroupNames\":[\"zufldifnivlutg\",\"maac\",\"auhvcgzxhklsq\",\"toiyygktsrjyx\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"ecnxfxp\",\"sowbeb\",\"nbwutlvuwmsu\"],\"portGroupNames\":[\"tihtgrafjajvkyxm\"]},\"protocolTypes\":[\"zvogtde\",\"j\"],\"vlanMatchCondition\":{\"vlans\":[\"kvaeuwqdwxhhlbm\",\"phfxnrpdhewoky\"],\"innerVlans\":[\"kx\",\"sy\",\"b\"],\"vlanGroupNames\":[\"btodjfyxb\",\"kvwzdmvddqwc\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"awnjdvvlrhoc\"],\"ipGroupNames\":[\"vxundqzbvbps\"]}}],\"actions\":[{\"type\":\"Count\",\"truncate\":\"ozf\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"bkurklpiig\",\"matchConfigurationName\":\"zkeutu\"},{\"type\":\"Replicate\",\"truncate\":\"lzjwaqdzq\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"uwxyllzzzevtz\",\"matchConfigurationName\":\"czochwbekmuynfp\"},{\"type\":\"Redirect\",\"truncate\":\"hiys\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"kslhr\",\"matchConfigurationName\":\"kiwlwkfflaqwmwq\"},{\"type\":\"Drop\",\"truncate\":\"lteatn\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"zjxnjtqbgysibt\",\"matchConfigurationName\":\"vxw\"}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{\"name\":\"jdbtqyhkxu\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"qgbbjvovoaw\",\"gjsmbc\",\"loygsabdgdheron\"]},{\"name\":\"unr\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"atqhgzu\",\"xtrvfdbqs\",\"gqj\",\"vitp\"]}],\"vlanGroups\":[{\"name\":\"ffavdhpiwr\",\"vlans\":[\"k\",\"jwbyfdwfbw\"]}],\"portGroups\":[{\"name\":\"qtmg\",\"ports\":[\"drmegajrzc\",\"wymzskwqk\",\"g\"]},{\"name\":\"eiphgliupqs\",\"ports\":[\"bkjlcaxsqcomji\",\"i\",\"ncevxxkdevpxi\",\"ziizmeqmdu\"]},{\"name\":\"vodqxxpqhmlqib\",\"ports\":[\"mcvrj\",\"znotd\",\"fqvpbqsdqkpsbqsb\",\"m\"]}]},{\"ipGroups\":[{\"name\":\"tazgcxsv\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"fylamxowbgcjoyut\",\"hlkarvtipquksxik\",\"sgofunswhpce\"]},{\"name\":\"gvm\",\"ipAddressType\":\"IPv4\",\"ipPrefixes\":[\"xn\",\"dfkkedeetxtpwcv\",\"i\"]},{\"name\":\"sunjzijaciwmm\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"onbz\"]},{\"name\":\"nfzyviiwsuanz\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"if\",\"zqqhbtfloilmkfb\",\"oiipjpn\"]}],\"vlanGroups\":[{\"name\":\"uoi\",\"vlans\":[\"psxntugfwi\"]},{\"name\":\"nry\",\"vlans\":[\"cfmvswxv\",\"el\",\"ifqhdx\",\"wwulkrybpaevy\"]},{\"name\":\"yjecrqkwakkch\",\"vlans\":[\"ulborcxuibsdq\",\"dyblpe\",\"t\",\"m\"]}],\"portGroups\":[{\"name\":\"eoqhbjql\",\"ports\":[\"lerufollcshju\",\"ihbymjjvtpne\"]},{\"name\":\"vjeazrah\",\"ports\":[\"bimyiieqa\",\"cthtpq\"]},{\"name\":\"zdo\",\"ports\":[\"kdi\",\"vflgzhc\",\"jg\",\"ahcrxofgrutv\"]}]}]}") - .toObject(NetworkTapRulePatchableProperties.class); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("ny", model.tapRulesUrl()); - Assertions.assertEquals("vqmvyumgmmu", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(6829595867395722232L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals("tt", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "elvxgwzz", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "tlcjgpvcqz", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "v", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.DESTINATION_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "wwd", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "zeyxryearmhp", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions - .assertEquals( - EncapsulationType.GTPV1, - model.matchConfigurations().get(0).matchConditions().get(0).encapsulationType()); - Assertions - .assertEquals( - PortType.SOURCE_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "yoseqcazisvbr", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "vjztaflvsmfj", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions - .assertEquals(TapRuleActionType.REPLICATE, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("ungrobgwfmsx", model.matchConfigurations().get(0).actions().get(0).truncate()); - Assertions - .assertEquals( - BooleanEnumProperty.TRUE, model.matchConfigurations().get(0).actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("lwxmvzjowz", model.matchConfigurations().get(0).actions().get(0).destinationId()); - Assertions - .assertEquals("eerclbltbhpw", model.matchConfigurations().get(0).actions().get(0).matchConfigurationName()); - Assertions.assertEquals("jdbtqyhkxu", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV6, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals( - "qgbbjvovoaw", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("ffavdhpiwr", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions.assertEquals("k", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("qtmg", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions - .assertEquals("drmegajrzc", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapRulePatchableProperties model = - new NetworkTapRulePatchableProperties() - .withConfigurationType(ConfigurationType.FILE) - .withTapRulesUrl("ny") - .withMatchConfigurations( - Arrays - .asList( - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("vqmvyumgmmu") - .withSequenceNumber(6829595867395722232L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("tt", "fuqmmfjewfeqb", "vdostwyg")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("elvxgwzz")) - .withInnerVlans(Arrays.asList("tlcjgpvcqz", "zrbvgw", "hlx")) - .withVlanGroupNames(Arrays.asList("v", "drwynbgovazoym"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("wwd", "atveqm", "k")) - .withIpGroupNames(Arrays.asList("zeyxryearmhp"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays - .asList( - "yoseqcazisvbr", - "gcyjpgawepk", - "on", - "zpghlrdtbgblxbu")) - .withPortGroupNames(Arrays.asList("vjztaflvsmfj", "hvfj"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("ruptsyqcjnq", "wxdowum")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("rcdiohclqddnhf", "nebweddpnyzcwyj")) - .withInnerVlans( - Arrays.asList("aqld", "abnwvpa", "bqxfbb", "gcfddofxnfb")) - .withVlanGroupNames( - Arrays.asList("yrqaedwovoc", "tjgo", "ayokrwfmihw"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays.asList("o", "dczvothmkh", "aozvbwfcnjhbpoel")) - .withIpGroupNames( - Arrays - .asList( - "myhrh", "vszfqbokndw", "ppqwojoevzz", "fytdxmly"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts( - Arrays.asList("asgtl", "hqpoilosja", "mcezevftmhllpok")) - .withPortGroupNames( - Arrays.asList("hztmsm", "wtpcflcezswwvw", "f", "djtvbf"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("atvcsxr", "hnmizhvprhqq")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("lehhkplobzg", "ttak", "adzighmmtbt")) - .withInnerVlans(Arrays.asList("cfvvraabe")) - .withVlanGroupNames(Arrays.asList("eewlsuxpcbw"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("nioroofmft")) - .withIpGroupNames(Arrays.asList("mcreihu", "trnighm"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts( - Arrays - .asList( - "rbuoggtdltlcu", - "aizijvaylzeohlp", - "ft", - "krvmhvbvvcp")) - .withPortGroupNames( - Arrays - .asList( - "suspnhmzy", "ffetevrnt", "k", "wacycsyotctkhf"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.REPLICATE) - .withTruncate("ungrobgwfmsx") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("lwxmvzjowz") - .withMatchConfigurationName("eerclbltbhpw"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.MIRROR) - .withTruncate("eurjwmvwry") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("kiikgpruccwmecbt") - .withMatchConfigurationName("ytrtexegwmrq"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.REDIRECT) - .withTruncate("whvycfjncin") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("q") - .withMatchConfigurationName("jwjuriarsb"))), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("lanhzcknjxizba") - .withSequenceNumber(7000496485104697500L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("opmotdsf")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays.asList("lyo", "zyfbkmvldzmxojz", "vmaigbqkvhyejth")) - .withInnerVlans( - Arrays.asList("cb", "ergwlckihbam", "qsokknpug")) - .withVlanGroupNames(Arrays.asList("dizcrj", "x"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays.asList("xgkrswksykkbxk", "xbbwlmnwz")) - .withIpGroupNames( - Arrays - .asList( - "vuqddlgg", - "q", - "olgzubakdlkv", - "gcmfnsffetpkmixw"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("yjmlxppdndzkfe", "uiiu")) - .withPortGroupNames(Arrays.asList("fkcjytqdcizeqqfo"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("eum")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("cdhlywkho")) - .withInnerVlans( - Arrays - .asList("unzxezriw", "oewapcqksaaapxjh", "itibenwsdf")) - .withVlanGroupNames(Arrays.asList("aahlfr"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays.asList("pireszyaqgomlbmf", "geokfekcjj")) - .withIpGroupNames( - Arrays - .asList("yeahhhutpulnrfcq", "fmcihpinowr", "rjpxptch"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts( - Arrays - .asList( - "epnqvxgvohdb", - "hhxmoevvud", - "epfhgannvwx", - "hpjhubohxvzga")) - .withPortGroupNames( - Arrays - .asList( - "rhhogalgxnw", "mzvztauebpa", "qxfcssanybzzgh"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("qpmquxpjhcf", "arad", "iovmufzgugrblwal")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays.asList("nqebaotbptgc", "manxx", "wqfmdqecvta")) - .withInnerVlans( - Arrays - .asList( - "zmnobfeww", - "sibxovuqo", - "jrkblndyclwgycv", - "qnzjcyqqz")) - .withVlanGroupNames(Arrays.asList("btbw", "alb", "dpisjdl"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues( - Arrays.asList("ooubsfxipj", "opskgocjomlupfa")) - .withIpGroupNames(Arrays.asList("jcdhus"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts( - Arrays.asList("mlgbbfjmdgjv", "lhmpm", "eftyaphqeofytl")) - .withPortGroupNames(Arrays.asList("owm", "mcqixuanccqvjf"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.LOG) - .withTruncate("gdqyxajc") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("avqcwy") - .withMatchConfigurationName("qzkmqc"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.REPLICATE) - .withTruncate("nkiixepbntq") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("fgsqxile") - .withMatchConfigurationName("jsewrz"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.DROP) - .withTruncate("qynttwknh") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("bsyogjmqjhgcyd") - .withMatchConfigurationName("nm"))), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("jbssfcri") - .withSequenceNumber(5139041492172174883L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("osgjzscuez", "livdfwg", "j")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("f", "rxggezkhzp")) - .withInnerVlans(Arrays.asList("issenerru", "yzaivnpsjnpckpl")) - .withVlanGroupNames( - Arrays.asList("duonbdawsa", "pl", "vmnb", "xjarsbb"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("ailxqkdyqjvzvcg", "dspzesfkqqxuhv")) - .withIpGroupNames( - Arrays - .asList("brouszxac", "wukokgoojj", "uktubcmunhgbtzv"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays.asList("cpxpyafrwr", "orogeuv", "krspnrsjsemlz")) - .withPortGroupNames( - Arrays.asList("snqpljpete", "utikelpmwgrpu", "wu"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("tzuaedrlhxgcq", "yrhkvxzzmiem", "yftgpqoswgfqv")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("pakbqyhlsor")) - .withInnerVlans(Arrays.asList("meqagkncjmyb")) - .withVlanGroupNames( - Arrays - .asList( - "vztnjawrhulemm", "mbwppxirxbkitzmn", "itaxju"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("cemegdzdvyljubv")) - .withIpGroupNames( - Arrays - .asList( - "zufldifnivlutg", - "maac", - "auhvcgzxhklsq", - "toiyygktsrjyx"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("krfnkcni", "kswxmfu", "qmwmwwp")) - .withPortGroupNames(Arrays.asList("motahbqsvnk"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("zvogtde", "j")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("kvaeuwqdwxhhlbm", "phfxnrpdhewoky")) - .withInnerVlans(Arrays.asList("kx", "sy", "b")) - .withVlanGroupNames(Arrays.asList("btodjfyxb", "kvwzdmvddqwc"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("awnjdvvlrhoc")) - .withIpGroupNames(Arrays.asList("vxundqzbvbps"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("ecnxfxp", "sowbeb", "nbwutlvuwmsu")) - .withPortGroupNames(Arrays.asList("tihtgrafjajvkyxm"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.COUNT) - .withTruncate("ozf") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("bkurklpiig") - .withMatchConfigurationName("zkeutu"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.REPLICATE) - .withTruncate("lzjwaqdzq") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("uwxyllzzzevtz") - .withMatchConfigurationName("czochwbekmuynfp"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.REDIRECT) - .withTruncate("hiys") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("kslhr") - .withMatchConfigurationName("kiwlwkfflaqwmwq"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.DROP) - .withTruncate("lteatn") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("zjxnjtqbgysibt") - .withMatchConfigurationName("vxw"))))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("jdbtqyhkxu") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays.asList("qgbbjvovoaw", "gjsmbc", "loygsabdgdheron")), - new IpGroupProperties() - .withName("unr") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("atqhgzu", "xtrvfdbqs", "gqj", "vitp")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("ffavdhpiwr") - .withVlans(Arrays.asList("k", "jwbyfdwfbw")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("qtmg") - .withPorts(Arrays.asList("drmegajrzc", "wymzskwqk", "g")), - new PortGroupProperties() - .withName("eiphgliupqs") - .withPorts( - Arrays - .asList("bkjlcaxsqcomji", "i", "ncevxxkdevpxi", "ziizmeqmdu")), - new PortGroupProperties() - .withName("vodqxxpqhmlqib") - .withPorts(Arrays.asList("mcvrj", "znotd", "fqvpbqsdqkpsbqsb", "m")))), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("tazgcxsv") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes( - Arrays - .asList( - "fylamxowbgcjoyut", "hlkarvtipquksxik", "sgofunswhpce")), - new IpGroupProperties() - .withName("gvm") - .withIpAddressType(IpAddressType.IPV4) - .withIpPrefixes(Arrays.asList("xn", "dfkkedeetxtpwcv", "i")), - new IpGroupProperties() - .withName("sunjzijaciwmm") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("onbz")), - new IpGroupProperties() - .withName("nfzyviiwsuanz") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("if", "zqqhbtfloilmkfb", "oiipjpn")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("uoi") - .withVlans(Arrays.asList("psxntugfwi")), - new VlanGroupProperties() - .withName("nry") - .withVlans(Arrays.asList("cfmvswxv", "el", "ifqhdx", "wwulkrybpaevy")), - new VlanGroupProperties() - .withName("yjecrqkwakkch") - .withVlans(Arrays.asList("ulborcxuibsdq", "dyblpe", "t", "m")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("eoqhbjql") - .withPorts(Arrays.asList("lerufollcshju", "ihbymjjvtpne")), - new PortGroupProperties() - .withName("vjeazrah") - .withPorts(Arrays.asList("bimyiieqa", "cthtpq")), - new PortGroupProperties() - .withName("zdo") - .withPorts(Arrays.asList("kdi", "vflgzhc", "jg", "ahcrxofgrutv")))))); - model = BinaryData.fromObject(model).toObject(NetworkTapRulePatchableProperties.class); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("ny", model.tapRulesUrl()); - Assertions.assertEquals("vqmvyumgmmu", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(6829595867395722232L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals("tt", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "elvxgwzz", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "tlcjgpvcqz", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "v", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.DESTINATION_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "wwd", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "zeyxryearmhp", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions - .assertEquals( - EncapsulationType.GTPV1, - model.matchConfigurations().get(0).matchConditions().get(0).encapsulationType()); - Assertions - .assertEquals( - PortType.SOURCE_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "yoseqcazisvbr", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "vjztaflvsmfj", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions - .assertEquals(TapRuleActionType.REPLICATE, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("ungrobgwfmsx", model.matchConfigurations().get(0).actions().get(0).truncate()); - Assertions - .assertEquals( - BooleanEnumProperty.TRUE, model.matchConfigurations().get(0).actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("lwxmvzjowz", model.matchConfigurations().get(0).actions().get(0).destinationId()); - Assertions - .assertEquals("eerclbltbhpw", model.matchConfigurations().get(0).actions().get(0).matchConfigurationName()); - Assertions.assertEquals("jdbtqyhkxu", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV6, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals( - "qgbbjvovoaw", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions.assertEquals("ffavdhpiwr", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions.assertEquals("k", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("qtmg", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions - .assertEquals("drmegajrzc", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePropertiesTests.java deleted file mode 100644 index 22e530855d9a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulePropertiesTests.java +++ /dev/null @@ -1,702 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkTapRuleProperties; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.EncapsulationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleAction; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.PollingIntervalInSeconds; -import com.azure.resourcemanager.managednetworkfabric.models.PortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import com.azure.resourcemanager.managednetworkfabric.models.PrefixType; -import com.azure.resourcemanager.managednetworkfabric.models.SourceDestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.TapRuleActionType; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapRuleProperties model = - BinaryData - .fromString( - "{\"networkTapId\":\"efvulblmr\",\"pollingIntervalInSeconds\":120,\"lastSyncedTime\":\"2021-07-05T15:45:44Z\",\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"MAT\",\"configurationType\":\"File\",\"tapRulesUrl\":\"fqd\",\"matchConfigurations\":[{\"matchConfigurationName\":\"lobha\",\"sequenceNumber\":5148991493805101380,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"bmx\",\"djmzezbjesylslur\",\"qfygpny\"],\"portGroupNames\":[\"zu\",\"sc\"]},\"protocolTypes\":[\"yvouprsytq\",\"ss\"],\"vlanMatchCondition\":{\"vlans\":[\"wfnivrxpfduio\",\"hgyqvpbfj\",\"oqzucfzluczdq\",\"urbormvh\"],\"innerVlans\":[\"elbprn\",\"ujywzcqyggmn\"],\"vlanGroupNames\":[\"hbngqiwyej\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"rehkunsbfjhh\"],\"ipGroupNames\":[\"pkvegeatt\",\"zkgtzqn\",\"qsttewuvcysjeuf\",\"x\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"npiyuxlv\",\"h\"],\"portGroupNames\":[\"vbwonleqf\",\"vtlrvbstph\",\"ykunin\"]},\"protocolTypes\":[\"nrjdszdbu\"],\"vlanMatchCondition\":{\"vlans\":[\"qppoqvgpnew\",\"hwfwjnox\",\"oxtfn\",\"essfepgckncj\"],\"innerVlans\":[\"snvbtqdxfm\",\"ym\",\"n\"],\"vlanGroupNames\":[\"uqllbsupubdxckd\",\"hzwhcukv\",\"osj\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"qfy\",\"yt\",\"slyekcgn\",\"uarlcjiwgsxfaioc\"],\"ipGroupNames\":[\"ujjgnfgrzxbarc\",\"paefzqsy\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"esmfucrtfodq\",\"uauzmz\",\"vrtrfz\",\"hezvhjudxdyy\"],\"portGroupNames\":[\"mahswtvdkxbqssgf\",\"nf\",\"dxbvwf\"]},\"protocolTypes\":[\"hivdrija\",\"xndmuvar\",\"lmzjotprrmu\",\"cuhtuzlxiwy\"],\"vlanMatchCondition\":{\"vlans\":[\"rpfctwrapcz\",\"ojqyvzes\",\"pi\"],\"innerVlans\":[\"jqyowaadc\",\"dazabundtse\"],\"vlanGroupNames\":[\"upw\",\"lzyckremgjlm\",\"vdorsirx\",\"hyrkqakofajfr\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"nwt\",\"yrqsh\",\"xbcejop\"],\"ipGroupNames\":[\"l\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"imtcvvf\",\"rdytzfslxizhq\"],\"portGroupNames\":[\"gobliqemcdiiisk\",\"bonxxupj\",\"vtrkfkg\"]},\"protocolTypes\":[\"qnnp\",\"wkosnyxigf\",\"ujjcxgdqmrlhn\",\"kwopswnyinxupr\"],\"vlanMatchCondition\":{\"vlans\":[\"wjezbfqployuekdc\",\"vuftrsvjmnsvu\",\"njktv\",\"lefcjis\"],\"innerVlans\":[\"dbxotfb\"],\"vlanGroupNames\":[\"pqoclannmxynlsuq\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"Prefix\",\"ipPrefixValues\":[\"gvp\",\"trgjjkt\"],\"ipGroupNames\":[\"fhok\",\"mmculwkq\",\"cru\"]}}],\"actions\":[{\"type\":\"Goto\",\"truncate\":\"lsgaojbtqpq\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"tpzp\",\"matchConfigurationName\":\"zflmcdsgxcelujis\"},{\"type\":\"Log\",\"truncate\":\"unxhfwlfxzfwugeu\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"ecexkgrvfpsjdmn\",\"matchConfigurationName\":\"yt\"},{\"type\":\"Mirror\",\"truncate\":\"fyxcnwawoxcgzbej\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"fopfjxdwdrpazqjk\",\"matchConfigurationName\":\"mbwotfcuu\"}]},{\"matchConfigurationName\":\"tjigpgayiawohf\",\"sequenceNumber\":4543441888525990494,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"aidzrpvsgloi\",\"vslvivqsuvwten\",\"gpijpk\"],\"portGroupNames\":[\"oa\"]},\"protocolTypes\":[\"kui\",\"juf\",\"ekiooanduewfhv\",\"x\"],\"vlanMatchCondition\":{\"vlans\":[\"ub\",\"jzabbwz\",\"vzuaixc\"],\"innerVlans\":[\"ixspsaigavkm\",\"yxzerejr\"],\"vlanGroupNames\":[\"jbyetjxryoptaei\",\"whlbecgihzbpem\",\"rrabovrwwxywp\",\"hspbo\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"peswyhhmifjuajx\",\"wvcmmpeglyuq\",\"cmlae\"],\"ipGroupNames\":[\"bqufpnezsjzayml\",\"rorh\",\"ogzmsimehtcuuwdh\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"xtnsugisn\"],\"portGroupNames\":[\"nwnghojov\",\"eyym\"]},\"protocolTypes\":[\"ixxfsfpcr\",\"nuguefxx\",\"jt\"],\"vlanMatchCondition\":{\"vlans\":[\"eywetkrhlolmcn\",\"epfgsvbbvaqdl\",\"npetlrnrde\",\"aw\"],\"innerVlans\":[\"eh\"],\"vlanGroupNames\":[\"dxljzvdovbrble\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"cd\",\"cbnygd\",\"c\"],\"ipGroupNames\":[\"bpwyykd\",\"gq\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"nidmjqmvytg\"],\"portGroupNames\":[\"larh\",\"twvcazekdzd\"]},\"protocolTypes\":[\"zjwztsmpchgg\"],\"vlanMatchCondition\":{\"vlans\":[\"gfyatig\"],\"innerVlans\":[\"rrkdknczgor\",\"wnvojtvmdev\",\"lhqvbk\",\"rbpyhssrl\"],\"vlanGroupNames\":[\"kpkocm\",\"ccebxxopyicyvspe\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"vrccpum\",\"dhg\"],\"ipGroupNames\":[\"rdyddtpfcudvaf\"]}}],\"actions\":[{\"type\":\"Goto\",\"truncate\":\"enqnxhgkordwzej\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"zvcmbpwd\",\"matchConfigurationName\":\"dayprldidwmtffb\"}]},{\"matchConfigurationName\":\"zldzchubagwnl\",\"sequenceNumber\":2309549565762307691,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"jtc\"],\"portGroupNames\":[\"qpojpsucmximc\",\"qxynqj\",\"satkyvscb\",\"ngcrusxhircpgcvs\"]},\"protocolTypes\":[\"jbj\",\"lpy\",\"klkvuznadvh\",\"lieo\"],\"vlanMatchCondition\":{\"vlans\":[\"xxbhtpsyioq\",\"mqwtqszzgy\"],\"innerVlans\":[\"kawanvm\"],\"vlanGroupNames\":[\"gjqcrbkompnbnfg\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"gcmahi\",\"fryawkch\",\"apitskshfyftt\"],\"ipGroupNames\":[\"ep\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"bggcj\",\"zhblivw\"],\"portGroupNames\":[\"udymymbhdosmbng\"]},\"protocolTypes\":[\"gxzduvxdmxe\"],\"vlanMatchCondition\":{\"vlans\":[\"dmnrsenxoirx\"],\"innerVlans\":[\"miploisj\",\"zsoxznntwgk\"],\"vlanGroupNames\":[\"hpsapzupz\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"ghximk\",\"fmxpqkjnp\",\"riwntotcxmmq\"],\"ipGroupNames\":[\"jkyjrexw\",\"onbexft\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"gzgrnq\"],\"portGroupNames\":[\"ozuumr\",\"gjq\",\"acan\"]},\"protocolTypes\":[\"yxzxjmkanbclazof\",\"exvtemasp\",\"anydsc\"],\"vlanMatchCondition\":{\"vlans\":[\"dpwjcbhaahntof\"],\"innerVlans\":[\"hpfixoskkzdf\"],\"vlanGroupNames\":[\"ujybsrwz\",\"mr\",\"t\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"nmgikesmkw\",\"zgfragjh\"],\"ipGroupNames\":[\"xlobkdbtqhv\",\"mniiqyholh\"]}},{\"encapsulationType\":\"None\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"UDP\",\"ports\":[\"nq\",\"lct\",\"wp\"],\"portGroupNames\":[\"krkqgvxrktjc\",\"igcwtspanbqxase\",\"chefpgeed\"]},\"protocolTypes\":[\"ruholae\",\"wcgi\"],\"vlanMatchCondition\":{\"vlans\":[\"maabsqqlonb\",\"aowcahdkm\",\"jsmihrijezbfsjwf\"],\"innerVlans\":[\"lkvbgukbsv\",\"wyo\",\"ygnbknhjgclxaxwc\"],\"vlanGroupNames\":[\"spsdz\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"oaqipmnxclfrs\",\"zrn\",\"u\",\"wvpu\"],\"ipGroupNames\":[\"dtbfmekjc\",\"ginxdvmaoy\",\"xf\",\"gyxzmxynofxl\"]}}],\"actions\":[{\"type\":\"Log\",\"truncate\":\"tdnzujsjirkrpskc\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"of\",\"matchConfigurationName\":\"ivd\"},{\"type\":\"Count\",\"truncate\":\"kpaxnlsfg\",\"isTimestampEnabled\":\"False\",\"destinationId\":\"accptbzetxy\",\"matchConfigurationName\":\"xic\"},{\"type\":\"Redirect\",\"truncate\":\"jwyuveox\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"wahdrdvhaztkxbi\",\"matchConfigurationName\":\"fgxmbr\"}]},{\"matchConfigurationName\":\"mw\",\"sequenceNumber\":7651949824921393012,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"rtxtfdag\"],\"portGroupNames\":[\"co\",\"zzertkounzsiy\",\"hubymfp\",\"pikzebq\"]},\"protocolTypes\":[\"yw\",\"kqowsdlkhczygp\",\"gf\"],\"vlanMatchCondition\":{\"vlans\":[\"ojhhylxdevfiyy\",\"otuzbybwjmtftc\"],\"innerVlans\":[\"nirupkqnst\",\"aqpibjg\"],\"vlanGroupNames\":[\"wmehfxrttxbmsenn\",\"fab\",\"camalect\"]},\"ipCondition\":{\"type\":\"SourceIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"xmsynbkd\",\"nyufxuzmsvzyq\",\"brnxhjtlxfikj\"],\"ipGroupNames\":[\"ravwwuasn\"]}},{\"encapsulationType\":\"GTPv1\",\"portCondition\":{\"portType\":\"SourcePort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"ozpcjcnwjzbqblx\"],\"portGroupNames\":[\"vdsvoqizawwsds\"]},\"protocolTypes\":[\"fhjxsawo\",\"auf\",\"hxfqkmw\"],\"vlanMatchCondition\":{\"vlans\":[\"yoybm\"],\"innerVlans\":[\"to\"],\"vlanGroupNames\":[\"zdaiovrb\",\"rpqphkvyyzad\"]},\"ipCondition\":{\"type\":\"DestinationIP\",\"prefixType\":\"LongestPrefix\",\"ipPrefixValues\":[\"dtyzvelffohur\",\"wh\"],\"ipGroupNames\":[\"rwpsshrmnkcclp\"]}}],\"actions\":[{\"type\":\"Goto\",\"truncate\":\"scxjfsgmosp\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"xsqcowscuyfqlam\",\"matchConfigurationName\":\"qhsujkafuzp\"},{\"type\":\"Goto\",\"truncate\":\"wnik\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"jgrbrctsvgooc\",\"matchConfigurationName\":\"azmzlpcx\"},{\"type\":\"Redirect\",\"truncate\":\"xxr\",\"isTimestampEnabled\":\"True\",\"destinationId\":\"zfvwjdthkvpyeyoa\",\"matchConfigurationName\":\"nmpnqu\"}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{\"name\":\"fwkyluobdxw\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"lcvqsru\",\"ay\"]},{\"name\":\"vwbzmfxlrymf\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"ywqnpfyd\",\"fbgcny\",\"byxmkhmqyncgaull\",\"styygjq\"]},{\"name\":\"lmwqg\",\"ipAddressType\":\"IPv6\",\"ipPrefixes\":[\"iwxzfvvz\",\"cqfgu\"]}],\"vlanGroups\":[{\"name\":\"xwbmwdukinhlxhg\",\"vlans\":[\"ekzouyvew\",\"pzrdwc\",\"ldohgca\"]},{\"name\":\"xfhhhtestd\",\"vlans\":[\"nnckkpljdshv\",\"fkdxccyijjimhi\",\"zrqnjxm\"]}],\"portGroups\":[{\"name\":\"uy\",\"ports\":[\"wg\",\"uhhqldrdymnswxie\",\"qwqnghxnimvy\"]}]}],\"annotation\":\"rxgunnqgy\"}") - .toObject(NetworkTapRuleProperties.class); - Assertions.assertEquals("rxgunnqgy", model.annotation()); - Assertions.assertEquals(PollingIntervalInSeconds.ONE_TWO_ZERO, model.pollingIntervalInSeconds()); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("fqd", model.tapRulesUrl()); - Assertions.assertEquals("lobha", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(5148991493805101380L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals( - "yvouprsytq", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "wfnivrxpfduio", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "elbprn", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "hbngqiwyej", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.SOURCE_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.LONGEST_PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "rehkunsbfjhh", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "pkvegeatt", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions - .assertEquals( - EncapsulationType.GTPV1, - model.matchConfigurations().get(0).matchConditions().get(0).encapsulationType()); - Assertions - .assertEquals( - PortType.SOURCE_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "bmx", model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "zu", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions.assertEquals(TapRuleActionType.GOTO, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("lsgaojbtqpq", model.matchConfigurations().get(0).actions().get(0).truncate()); - Assertions - .assertEquals( - BooleanEnumProperty.TRUE, model.matchConfigurations().get(0).actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("tpzp", model.matchConfigurations().get(0).actions().get(0).destinationId()); - Assertions - .assertEquals( - "zflmcdsgxcelujis", model.matchConfigurations().get(0).actions().get(0).matchConfigurationName()); - Assertions.assertEquals("fwkyluobdxw", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV6, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals("lcvqsru", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions - .assertEquals("xwbmwdukinhlxhg", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("ekzouyvew", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("uy", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("wg", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapRuleProperties model = - new NetworkTapRuleProperties() - .withAnnotation("rxgunnqgy") - .withPollingIntervalInSeconds(PollingIntervalInSeconds.ONE_TWO_ZERO) - .withConfigurationType(ConfigurationType.FILE) - .withTapRulesUrl("fqd") - .withMatchConfigurations( - Arrays - .asList( - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("lobha") - .withSequenceNumber(5148991493805101380L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("yvouprsytq", "ss")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "wfnivrxpfduio", - "hgyqvpbfj", - "oqzucfzluczdq", - "urbormvh")) - .withInnerVlans(Arrays.asList("elbprn", "ujywzcqyggmn")) - .withVlanGroupNames(Arrays.asList("hbngqiwyej"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("rehkunsbfjhh")) - .withIpGroupNames( - Arrays - .asList( - "pkvegeatt", "zkgtzqn", "qsttewuvcysjeuf", "x"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("bmx", "djmzezbjesylslur", "qfygpny")) - .withPortGroupNames(Arrays.asList("zu", "sc"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("nrjdszdbu")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "qppoqvgpnew", "hwfwjnox", "oxtfn", "essfepgckncj")) - .withInnerVlans(Arrays.asList("snvbtqdxfm", "ym", "n")) - .withVlanGroupNames( - Arrays.asList("uqllbsupubdxckd", "hzwhcukv", "osj"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("qfy", "yt", "slyekcgn", "uarlcjiwgsxfaioc")) - .withIpGroupNames(Arrays.asList("ujjgnfgrzxbarc", "paefzqsy"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("npiyuxlv", "h")) - .withPortGroupNames( - Arrays.asList("vbwonleqf", "vtlrvbstph", "ykunin"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("hivdrija", "xndmuvar", "lmzjotprrmu", "cuhtuzlxiwy")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("rpfctwrapcz", "ojqyvzes", "pi")) - .withInnerVlans(Arrays.asList("jqyowaadc", "dazabundtse")) - .withVlanGroupNames( - Arrays - .asList( - "upw", - "lzyckremgjlm", - "vdorsirx", - "hyrkqakofajfr"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("nwt", "yrqsh", "xbcejop")) - .withIpGroupNames(Arrays.asList("l"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays - .asList( - "esmfucrtfodq", "uauzmz", "vrtrfz", "hezvhjudxdyy")) - .withPortGroupNames( - Arrays.asList("mahswtvdkxbqssgf", "nf", "dxbvwf"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays - .asList( - "qnnp", "wkosnyxigf", "ujjcxgdqmrlhn", "kwopswnyinxupr")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "wjezbfqployuekdc", - "vuftrsvjmnsvu", - "njktv", - "lefcjis")) - .withInnerVlans(Arrays.asList("dbxotfb")) - .withVlanGroupNames(Arrays.asList("pqoclannmxynlsuq"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.PREFIX) - .withIpPrefixValues(Arrays.asList("gvp", "trgjjkt")) - .withIpGroupNames(Arrays.asList("fhok", "mmculwkq", "cru"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("imtcvvf", "rdytzfslxizhq")) - .withPortGroupNames( - Arrays.asList("gobliqemcdiiisk", "bonxxupj", "vtrkfkg"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.GOTO) - .withTruncate("lsgaojbtqpq") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("tpzp") - .withMatchConfigurationName("zflmcdsgxcelujis"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.LOG) - .withTruncate("unxhfwlfxzfwugeu") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("ecexkgrvfpsjdmn") - .withMatchConfigurationName("yt"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.MIRROR) - .withTruncate("fyxcnwawoxcgzbej") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("fopfjxdwdrpazqjk") - .withMatchConfigurationName("mbwotfcuu"))), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("tjigpgayiawohf") - .withSequenceNumber(4543441888525990494L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("kui", "juf", "ekiooanduewfhv", "x")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("ub", "jzabbwz", "vzuaixc")) - .withInnerVlans(Arrays.asList("ixspsaigavkm", "yxzerejr")) - .withVlanGroupNames( - Arrays - .asList( - "jbyetjxryoptaei", - "whlbecgihzbpem", - "rrabovrwwxywp", - "hspbo"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("peswyhhmifjuajx", "wvcmmpeglyuq", "cmlae")) - .withIpGroupNames( - Arrays - .asList("bqufpnezsjzayml", "rorh", "ogzmsimehtcuuwdh"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts( - Arrays.asList("aidzrpvsgloi", "vslvivqsuvwten", "gpijpk")) - .withPortGroupNames(Arrays.asList("oa"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("ixxfsfpcr", "nuguefxx", "jt")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList( - "eywetkrhlolmcn", - "epfgsvbbvaqdl", - "npetlrnrde", - "aw")) - .withInnerVlans(Arrays.asList("eh")) - .withVlanGroupNames(Arrays.asList("dxljzvdovbrble"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("cd", "cbnygd", "c")) - .withIpGroupNames(Arrays.asList("bpwyykd", "gq"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("xtnsugisn")) - .withPortGroupNames(Arrays.asList("nwnghojov", "eyym"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("zjwztsmpchgg")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("gfyatig")) - .withInnerVlans( - Arrays - .asList( - "rrkdknczgor", - "wnvojtvmdev", - "lhqvbk", - "rbpyhssrl")) - .withVlanGroupNames( - Arrays.asList("kpkocm", "ccebxxopyicyvspe"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("vrccpum", "dhg")) - .withIpGroupNames(Arrays.asList("rdyddtpfcudvaf"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("nidmjqmvytg")) - .withPortGroupNames(Arrays.asList("larh", "twvcazekdzd"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.GOTO) - .withTruncate("enqnxhgkordwzej") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("zvcmbpwd") - .withMatchConfigurationName("dayprldidwmtffb"))), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("zldzchubagwnl") - .withSequenceNumber(2309549565762307691L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("jbj", "lpy", "klkvuznadvh", "lieo")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("xxbhtpsyioq", "mqwtqszzgy")) - .withInnerVlans(Arrays.asList("kawanvm")) - .withVlanGroupNames(Arrays.asList("gjqcrbkompnbnfg"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("gcmahi", "fryawkch", "apitskshfyftt")) - .withIpGroupNames(Arrays.asList("ep"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("jtc")) - .withPortGroupNames( - Arrays - .asList( - "qpojpsucmximc", - "qxynqj", - "satkyvscb", - "ngcrusxhircpgcvs"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("gxzduvxdmxe")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("dmnrsenxoirx")) - .withInnerVlans(Arrays.asList("miploisj", "zsoxznntwgk")) - .withVlanGroupNames(Arrays.asList("hpsapzupz"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("ghximk", "fmxpqkjnp", "riwntotcxmmq")) - .withIpGroupNames(Arrays.asList("jkyjrexw", "onbexft"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("bggcj", "zhblivw")) - .withPortGroupNames(Arrays.asList("udymymbhdosmbng"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes( - Arrays.asList("yxzxjmkanbclazof", "exvtemasp", "anydsc")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("dpwjcbhaahntof")) - .withInnerVlans(Arrays.asList("hpfixoskkzdf")) - .withVlanGroupNames(Arrays.asList("ujybsrwz", "mr", "t"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("nmgikesmkw", "zgfragjh")) - .withIpGroupNames(Arrays.asList("xlobkdbtqhv", "mniiqyholh"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("gzgrnq")) - .withPortGroupNames(Arrays.asList("ozuumr", "gjq", "acan"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("ruholae", "wcgi")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans( - Arrays - .asList("maabsqqlonb", "aowcahdkm", "jsmihrijezbfsjwf")) - .withInnerVlans( - Arrays.asList("lkvbgukbsv", "wyo", "ygnbknhjgclxaxwc")) - .withVlanGroupNames(Arrays.asList("spsdz"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("oaqipmnxclfrs", "zrn", "u", "wvpu")) - .withIpGroupNames( - Arrays - .asList( - "dtbfmekjc", "ginxdvmaoy", "xf", "gyxzmxynofxl"))) - .withEncapsulationType(EncapsulationType.NONE) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.UDP) - .withPorts(Arrays.asList("nq", "lct", "wp")) - .withPortGroupNames( - Arrays - .asList( - "krkqgvxrktjc", "igcwtspanbqxase", "chefpgeed"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.LOG) - .withTruncate("tdnzujsjirkrpskc") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("of") - .withMatchConfigurationName("ivd"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.COUNT) - .withTruncate("kpaxnlsfg") - .withIsTimestampEnabled(BooleanEnumProperty.FALSE) - .withDestinationId("accptbzetxy") - .withMatchConfigurationName("xic"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.REDIRECT) - .withTruncate("jwyuveox") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("wahdrdvhaztkxbi") - .withMatchConfigurationName("fgxmbr"))), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("mw") - .withSequenceNumber(7651949824921393012L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("yw", "kqowsdlkhczygp", "gf")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("ojhhylxdevfiyy", "otuzbybwjmtftc")) - .withInnerVlans(Arrays.asList("nirupkqnst", "aqpibjg")) - .withVlanGroupNames( - Arrays.asList("wmehfxrttxbmsenn", "fab", "camalect"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.SOURCE_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues( - Arrays.asList("xmsynbkd", "nyufxuzmsvzyq", "brnxhjtlxfikj")) - .withIpGroupNames(Arrays.asList("ravwwuasn"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("rtxtfdag")) - .withPortGroupNames( - Arrays - .asList("co", "zzertkounzsiy", "hubymfp", "pikzebq"))), - new NetworkTapRuleMatchCondition() - .withProtocolTypes(Arrays.asList("fhjxsawo", "auf", "hxfqkmw")) - .withVlanMatchCondition( - new VlanMatchCondition() - .withVlans(Arrays.asList("yoybm")) - .withInnerVlans(Arrays.asList("to")) - .withVlanGroupNames(Arrays.asList("zdaiovrb", "rpqphkvyyzad"))) - .withIpCondition( - new IpMatchCondition() - .withType(SourceDestinationType.DESTINATION_IP) - .withPrefixType(PrefixType.LONGEST_PREFIX) - .withIpPrefixValues(Arrays.asList("dtyzvelffohur", "wh")) - .withIpGroupNames(Arrays.asList("rwpsshrmnkcclp"))) - .withEncapsulationType(EncapsulationType.GTPV1) - .withPortCondition( - new PortCondition() - .withPortType(PortType.SOURCE_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("ozpcjcnwjzbqblx")) - .withPortGroupNames(Arrays.asList("vdsvoqizawwsds"))))) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction() - .withType(TapRuleActionType.GOTO) - .withTruncate("scxjfsgmosp") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("xsqcowscuyfqlam") - .withMatchConfigurationName("qhsujkafuzp"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.GOTO) - .withTruncate("wnik") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("jgrbrctsvgooc") - .withMatchConfigurationName("azmzlpcx"), - new NetworkTapRuleAction() - .withType(TapRuleActionType.REDIRECT) - .withTruncate("xxr") - .withIsTimestampEnabled(BooleanEnumProperty.TRUE) - .withDestinationId("zfvwjdthkvpyeyoa") - .withMatchConfigurationName("nmpnqu"))))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties() - .withName("fwkyluobdxw") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("lcvqsru", "ay")), - new IpGroupProperties() - .withName("vwbzmfxlrymf") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes( - Arrays.asList("ywqnpfyd", "fbgcny", "byxmkhmqyncgaull", "styygjq")), - new IpGroupProperties() - .withName("lmwqg") - .withIpAddressType(IpAddressType.IPV6) - .withIpPrefixes(Arrays.asList("iwxzfvvz", "cqfgu")))) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties() - .withName("xwbmwdukinhlxhg") - .withVlans(Arrays.asList("ekzouyvew", "pzrdwc", "ldohgca")), - new VlanGroupProperties() - .withName("xfhhhtestd") - .withVlans(Arrays.asList("nnckkpljdshv", "fkdxccyijjimhi", "zrqnjxm")))) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties() - .withName("uy") - .withPorts(Arrays.asList("wg", "uhhqldrdymnswxie", "qwqnghxnimvy")))))); - model = BinaryData.fromObject(model).toObject(NetworkTapRuleProperties.class); - Assertions.assertEquals("rxgunnqgy", model.annotation()); - Assertions.assertEquals(PollingIntervalInSeconds.ONE_TWO_ZERO, model.pollingIntervalInSeconds()); - Assertions.assertEquals(ConfigurationType.FILE, model.configurationType()); - Assertions.assertEquals("fqd", model.tapRulesUrl()); - Assertions.assertEquals("lobha", model.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(5148991493805101380L, model.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV6, model.matchConfigurations().get(0).ipAddressType()); - Assertions - .assertEquals( - "yvouprsytq", model.matchConfigurations().get(0).matchConditions().get(0).protocolTypes().get(0)); - Assertions - .assertEquals( - "wfnivrxpfduio", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().vlans().get(0)); - Assertions - .assertEquals( - "elbprn", - model.matchConfigurations().get(0).matchConditions().get(0).vlanMatchCondition().innerVlans().get(0)); - Assertions - .assertEquals( - "hbngqiwyej", - model - .matchConfigurations() - .get(0) - .matchConditions() - .get(0) - .vlanMatchCondition() - .vlanGroupNames() - .get(0)); - Assertions - .assertEquals( - SourceDestinationType.SOURCE_IP, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().type()); - Assertions - .assertEquals( - PrefixType.LONGEST_PREFIX, - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().prefixType()); - Assertions - .assertEquals( - "rehkunsbfjhh", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipPrefixValues().get(0)); - Assertions - .assertEquals( - "pkvegeatt", - model.matchConfigurations().get(0).matchConditions().get(0).ipCondition().ipGroupNames().get(0)); - Assertions - .assertEquals( - EncapsulationType.GTPV1, - model.matchConfigurations().get(0).matchConditions().get(0).encapsulationType()); - Assertions - .assertEquals( - PortType.SOURCE_PORT, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portType()); - Assertions - .assertEquals( - Layer4Protocol.TCP, - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().layer4Protocol()); - Assertions - .assertEquals( - "bmx", model.matchConfigurations().get(0).matchConditions().get(0).portCondition().ports().get(0)); - Assertions - .assertEquals( - "zu", - model.matchConfigurations().get(0).matchConditions().get(0).portCondition().portGroupNames().get(0)); - Assertions.assertEquals(TapRuleActionType.GOTO, model.matchConfigurations().get(0).actions().get(0).type()); - Assertions.assertEquals("lsgaojbtqpq", model.matchConfigurations().get(0).actions().get(0).truncate()); - Assertions - .assertEquals( - BooleanEnumProperty.TRUE, model.matchConfigurations().get(0).actions().get(0).isTimestampEnabled()); - Assertions.assertEquals("tpzp", model.matchConfigurations().get(0).actions().get(0).destinationId()); - Assertions - .assertEquals( - "zflmcdsgxcelujis", model.matchConfigurations().get(0).actions().get(0).matchConfigurationName()); - Assertions.assertEquals("fwkyluobdxw", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).name()); - Assertions - .assertEquals( - IpAddressType.IPV6, model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipAddressType()); - Assertions - .assertEquals("lcvqsru", model.dynamicMatchConfigurations().get(0).ipGroups().get(0).ipPrefixes().get(0)); - Assertions - .assertEquals("xwbmwdukinhlxhg", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).name()); - Assertions - .assertEquals("ekzouyvew", model.dynamicMatchConfigurations().get(0).vlanGroups().get(0).vlans().get(0)); - Assertions.assertEquals("uy", model.dynamicMatchConfigurations().get(0).portGroups().get(0).name()); - Assertions.assertEquals("wg", model.dynamicMatchConfigurations().get(0).portGroups().get(0).ports().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesCreateMockTests.java deleted file mode 100644 index 9a20428dc0a7..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesCreateMockTests.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRule; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleAction; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.PollingIntervalInSeconds; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -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 NetworkTapRulesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"networkTapId\":\"lbhkij\",\"pollingIntervalInSeconds\":30,\"lastSyncedTime\":\"2021-09-19T16:32:15Z\",\"configurationState\":\"ErrorDeprovisioning\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"Disabled\",\"configurationType\":\"File\",\"tapRulesUrl\":\"ppuhk\",\"matchConfigurations\":[{\"matchConfigurationName\":\"kzvjyvobevfbmxz\",\"sequenceNumber\":8738446998224680215,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{},{}],\"actions\":[{},{},{},{}]},{\"matchConfigurationName\":\"jioby\",\"sequenceNumber\":8837962596253650169,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{}],\"actions\":[{},{},{}]},{\"matchConfigurationName\":\"uyxhcwubtego\",\"sequenceNumber\":1449814886318601810,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{},{},{}],\"actions\":[{}]},{\"matchConfigurationName\":\"frgiplxrifbsbk\",\"sequenceNumber\":102468891735930069,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{},{},{},{}],\"actions\":[{},{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{},{},{},{}],\"vlanGroups\":[{},{}],\"portGroups\":[{},{}]}],\"annotation\":\"tuufknarscxn\"},\"location\":\"pjinz\",\"tags\":{\"nn\":\"rsm\",\"wwqchxowppvux\":\"wnwoxve\"},\"id\":\"actoqqehn\",\"name\":\"ir\",\"type\":\"gnvuolv\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkTapRule response = - manager - .networkTapRules() - .define("exnpoaeruywfh") - .withRegion("wpv") - .withExistingResourceGroup("ektnhyylipvqpqu") - .withTags(mapOf("snu", "fcstucmiqs")) - .withPollingIntervalInSeconds(PollingIntervalInSeconds.ONE_TWO_ZERO) - .withConfigurationType(ConfigurationType.FILE) - .withTapRulesUrl("usmk") - .withMatchConfigurations( - Arrays - .asList( - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("pwpbnjc") - .withSequenceNumber(1103251243591374149L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions(Arrays.asList(new NetworkTapRuleMatchCondition())) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction())), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("vnddllbwnmv") - .withSequenceNumber(7195752086688648646L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions(Arrays.asList(new NetworkTapRuleMatchCondition())) - .withActions(Arrays.asList(new NetworkTapRuleAction())), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("sdouzohihqlwy") - .withSequenceNumber(7450751315453937711L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions(Arrays.asList(new NetworkTapRuleMatchCondition())) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction())))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups(Arrays.asList(new IpGroupProperties(), new IpGroupProperties())) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties())) - .withPortGroups(Arrays.asList(new PortGroupProperties())))) - .withAnnotation("uepgqztakovs") - .create(); - - Assertions.assertEquals("pjinz", response.location()); - Assertions.assertEquals("rsm", response.tags().get("nn")); - Assertions.assertEquals(PollingIntervalInSeconds.THREE_ZERO, response.pollingIntervalInSeconds()); - Assertions.assertEquals(ConfigurationType.FILE, response.configurationType()); - Assertions.assertEquals("ppuhk", response.tapRulesUrl()); - Assertions.assertEquals("kzvjyvobevfbmxz", response.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(8738446998224680215L, response.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, response.matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("tuufknarscxn", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index a82e1cb43931..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRule; -import com.azure.resourcemanager.managednetworkfabric.models.PollingIntervalInSeconds; -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 NetworkTapRulesGetByResourceGroupWithResponseMockTests { - @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\":{\"networkTapId\":\"xufuwcajyezlk\",\"pollingIntervalInSeconds\":30,\"lastSyncedTime\":\"2021-11-10T05:27:16Z\",\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Updating\",\"administrativeState\":\"Disabled\",\"configurationType\":\"File\",\"tapRulesUrl\":\"pmbp\",\"matchConfigurations\":[{\"matchConfigurationName\":\"xwrf\",\"sequenceNumber\":117301016748507123,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{}],\"actions\":[{},{},{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{},{},{}],\"vlanGroups\":[{}],\"portGroups\":[{},{},{}]},{\"ipGroups\":[{},{},{}],\"vlanGroups\":[{},{},{}],\"portGroups\":[{}]}],\"annotation\":\"vk\"},\"location\":\"eytphnazpgvfcubx\",\"tags\":{\"fuupqkrzvd\":\"hedbqrlbyhz\",\"hhpwxghwwfq\":\"pcevbkkgqfjwg\"},\"id\":\"wysmsqqmdajsqe\",\"name\":\"xftyifadsliifdr\",\"type\":\"sr\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkTapRule response = - manager - .networkTapRules() - .getByResourceGroupWithResponse("njdrnfgtm", "pblhnxqvzz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("eytphnazpgvfcubx", response.location()); - Assertions.assertEquals("hedbqrlbyhz", response.tags().get("fuupqkrzvd")); - Assertions.assertEquals(PollingIntervalInSeconds.THREE_ZERO, response.pollingIntervalInSeconds()); - Assertions.assertEquals(ConfigurationType.FILE, response.configurationType()); - Assertions.assertEquals("pmbp", response.tapRulesUrl()); - Assertions.assertEquals("xwrf", response.matchConfigurations().get(0).matchConfigurationName()); - Assertions.assertEquals(117301016748507123L, response.matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, response.matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("vk", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesListByResourceGroupMockTests.java deleted file mode 100644 index 11f8b0790510..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesListByResourceGroupMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRule; -import com.azure.resourcemanager.managednetworkfabric.models.PollingIntervalInSeconds; -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 NetworkTapRulesListByResourceGroupMockTests { - @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\":{\"networkTapId\":\"snxmfooin\",\"pollingIntervalInSeconds\":30,\"lastSyncedTime\":\"2021-02-27T22:48:53Z\",\"configurationState\":\"Deprovisioning\",\"provisioningState\":\"Failed\",\"administrativeState\":\"RMA\",\"configurationType\":\"Inline\",\"tapRulesUrl\":\"cbrewtf\",\"matchConfigurations\":[{\"matchConfigurationName\":\"sxn\",\"sequenceNumber\":1785607433239352405,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{},{}],\"actions\":[{},{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{}],\"vlanGroups\":[{},{},{},{}],\"portGroups\":[{}]},{\"ipGroups\":[{},{}],\"vlanGroups\":[{},{}],\"portGroups\":[{},{}]},{\"ipGroups\":[{}],\"vlanGroups\":[{},{},{},{}],\"portGroups\":[{},{},{},{}]},{\"ipGroups\":[{},{},{},{}],\"vlanGroups\":[{},{}],\"portGroups\":[{},{},{},{}]}],\"annotation\":\"tl\"},\"location\":\"ayxujzoxgakqt\",\"tags\":{\"zwedm\":\"uc\",\"x\":\"hulxgce\",\"hmmgblqyfg\":\"anudvqannenxg\",\"pqifsgzfgxwf\":\"b\"},\"id\":\"jiqpdsohwnna\",\"name\":\"ooghjxhppp\",\"type\":\"ksqiwlmegjtose\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.networkTapRules().listByResourceGroup("jspb", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ayxujzoxgakqt", response.iterator().next().location()); - Assertions.assertEquals("uc", response.iterator().next().tags().get("zwedm")); - Assertions - .assertEquals(PollingIntervalInSeconds.THREE_ZERO, response.iterator().next().pollingIntervalInSeconds()); - Assertions.assertEquals(ConfigurationType.INLINE, response.iterator().next().configurationType()); - Assertions.assertEquals("cbrewtf", response.iterator().next().tapRulesUrl()); - Assertions - .assertEquals("sxn", response.iterator().next().matchConfigurations().get(0).matchConfigurationName()); - Assertions - .assertEquals( - 1785607433239352405L, response.iterator().next().matchConfigurations().get(0).sequenceNumber()); - Assertions - .assertEquals(IpAddressType.IPV6, response.iterator().next().matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("tl", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesListMockTests.java deleted file mode 100644 index 359df861ac4a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesListMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRule; -import com.azure.resourcemanager.managednetworkfabric.models.PollingIntervalInSeconds; -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 NetworkTapRulesListMockTests { - @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\":{\"networkTapId\":\"oygowdzizz\",\"pollingIntervalInSeconds\":30,\"lastSyncedTime\":\"2021-03-19T02:50:44Z\",\"configurationState\":\"ErrorDeprovisioning\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"Disabled\",\"configurationType\":\"File\",\"tapRulesUrl\":\"rtasepiplpexh\",\"matchConfigurations\":[{\"matchConfigurationName\":\"tl\",\"sequenceNumber\":1853565870713824775,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{},{},{}],\"actions\":[{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{}],\"vlanGroups\":[{}],\"portGroups\":[{},{}]},{\"ipGroups\":[{},{},{}],\"vlanGroups\":[{},{},{},{}],\"portGroups\":[{},{},{}]},{\"ipGroups\":[{}],\"vlanGroups\":[{}],\"portGroups\":[{},{},{},{}]}],\"annotation\":\"ybt\"},\"location\":\"mxdmppibvwqjc\",\"tags\":{\"l\":\"fyoqfvmvw\",\"tyxlsycckj\":\"muzltnneolghgte\",\"c\":\"qdtykcaocjuuxqnk\"},\"id\":\"mrwc\",\"name\":\"ynjcvewl\",\"type\":\"jrnaktj\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkTapRules().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mxdmppibvwqjc", response.iterator().next().location()); - Assertions.assertEquals("fyoqfvmvw", response.iterator().next().tags().get("l")); - Assertions - .assertEquals(PollingIntervalInSeconds.THREE_ZERO, response.iterator().next().pollingIntervalInSeconds()); - Assertions.assertEquals(ConfigurationType.FILE, response.iterator().next().configurationType()); - Assertions.assertEquals("rtasepiplpexh", response.iterator().next().tapRulesUrl()); - Assertions.assertEquals("tl", response.iterator().next().matchConfigurations().get(0).matchConfigurationName()); - Assertions - .assertEquals( - 1853565870713824775L, response.iterator().next().matchConfigurations().get(0).sequenceNumber()); - Assertions - .assertEquals(IpAddressType.IPV6, response.iterator().next().matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("ybt", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesListResultTests.java deleted file mode 100644 index 9e11a9590ded..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesListResultTests.java +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkTapRuleInner; -import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType; -import com.azure.resourcemanager.managednetworkfabric.models.IpAddressType; -import com.azure.resourcemanager.managednetworkfabric.models.IpGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleAction; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchCondition; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRuleMatchConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapRulesListResult; -import com.azure.resourcemanager.managednetworkfabric.models.PollingIntervalInSeconds; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapRulesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapRulesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"networkTapId\":\"rywusrjzhdtrs\",\"pollingIntervalInSeconds\":90,\"lastSyncedTime\":\"2021-02-18T22:54:23Z\",\"configurationState\":\"ErrorDeprovisioning\",\"provisioningState\":\"Failed\",\"administrativeState\":\"RMA\",\"configurationType\":\"Inline\",\"tapRulesUrl\":\"r\",\"matchConfigurations\":[{\"matchConfigurationName\":\"tqiljknnkynkstdt\",\"sequenceNumber\":7155323017509192647,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{},{},{},{}],\"actions\":[{},{}]},{\"matchConfigurationName\":\"jyihjcwwvaos\",\"sequenceNumber\":3529772796591328335,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{}],\"actions\":[{},{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{},{}],\"vlanGroups\":[{},{}],\"portGroups\":[{},{},{},{}]},{\"ipGroups\":[{}],\"vlanGroups\":[{},{},{}],\"portGroups\":[{}]}],\"annotation\":\"uwnrd\"},\"location\":\"zlaihsujtg\",\"tags\":{\"liqwzutiyelrnhh\":\"szamijxejpd\",\"hqsznsyov\":\"t\"},\"id\":\"mqcudptoqw\",\"name\":\"nf\",\"type\":\"kjthl\"},{\"properties\":{\"networkTapId\":\"m\",\"pollingIntervalInSeconds\":120,\"lastSyncedTime\":\"2021-05-11T17:48:08Z\",\"configurationState\":\"Deprovisioning\",\"provisioningState\":\"Updating\",\"administrativeState\":\"RMA\",\"configurationType\":\"Inline\",\"tapRulesUrl\":\"u\",\"matchConfigurations\":[{\"matchConfigurationName\":\"njmo\",\"sequenceNumber\":7228921951854777537,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{}],\"actions\":[{}]},{\"matchConfigurationName\":\"tmnkxjouwfzc\",\"sequenceNumber\":8345278573361085323,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{}],\"actions\":[{},{},{},{}]},{\"matchConfigurationName\":\"nuhcfhepisq\",\"sequenceNumber\":7683103186205990817,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{},{}],\"actions\":[{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{},{},{},{}],\"vlanGroups\":[{},{},{},{}],\"portGroups\":[{},{},{},{}]},{\"ipGroups\":[{},{}],\"vlanGroups\":[{},{},{}],\"portGroups\":[{},{}]},{\"ipGroups\":[{}],\"vlanGroups\":[{},{}],\"portGroups\":[{}]},{\"ipGroups\":[{},{}],\"vlanGroups\":[{}],\"portGroups\":[{},{}]}],\"annotation\":\"esrsixwnlpjc\"},\"location\":\"jgfmyqyyfr\",\"tags\":{\"akidfhmlxrqk\":\"zfpsf\",\"afzvptriysjrg\":\"knumk\",\"wpuqpsrc\":\"r\",\"lvbwatzadrjbjn\":\"kdvvoydwedggwg\"},\"id\":\"oarsrdr\",\"name\":\"i\",\"type\":\"mzc\"},{\"properties\":{\"networkTapId\":\"iapypimr\",\"pollingIntervalInSeconds\":30,\"lastSyncedTime\":\"2021-06-04T10:01:58Z\",\"configurationState\":\"ErrorDeprovisioning\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"RMA\",\"configurationType\":\"File\",\"tapRulesUrl\":\"nytkmlfupjzc\",\"matchConfigurations\":[{\"matchConfigurationName\":\"joy\",\"sequenceNumber\":7264135782871254964,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{},{}],\"actions\":[{},{},{}]},{\"matchConfigurationName\":\"aktnytkb\",\"sequenceNumber\":6525366924338920838,\"ipAddressType\":\"IPv4\",\"matchConditions\":[{},{},{}],\"actions\":[{},{},{},{}]},{\"matchConfigurationName\":\"j\",\"sequenceNumber\":5551475977673705084,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{}],\"actions\":[{},{}]},{\"matchConfigurationName\":\"hcikhl\",\"sequenceNumber\":5349944693025104116,\"ipAddressType\":\"IPv6\",\"matchConditions\":[{},{},{}],\"actions\":[{},{},{}]}],\"dynamicMatchConfigurations\":[{\"ipGroups\":[{},{},{}],\"vlanGroups\":[{},{},{},{}],\"portGroups\":[{},{}]},{\"ipGroups\":[{},{},{},{}],\"vlanGroups\":[{},{},{},{}],\"portGroups\":[{},{},{}]}],\"annotation\":\"toidhb\"},\"location\":\"trapw\",\"tags\":{\"u\":\"utjsjzelsriem\",\"ycvldeehcbsaip\":\"meakosy\",\"kegbvbbdledf\":\"suo\"},\"id\":\"lzvsluazzxfjveu\",\"name\":\"pxzee\",\"type\":\"pup\"}],\"nextLink\":\"cboxraq\"}") - .toObject(NetworkTapRulesListResult.class); - Assertions.assertEquals("zlaihsujtg", model.value().get(0).location()); - Assertions.assertEquals("szamijxejpd", model.value().get(0).tags().get("liqwzutiyelrnhh")); - Assertions.assertEquals(PollingIntervalInSeconds.NINE_ZERO, model.value().get(0).pollingIntervalInSeconds()); - Assertions.assertEquals(ConfigurationType.INLINE, model.value().get(0).configurationType()); - Assertions.assertEquals("r", model.value().get(0).tapRulesUrl()); - Assertions - .assertEquals( - "tqiljknnkynkstdt", model.value().get(0).matchConfigurations().get(0).matchConfigurationName()); - Assertions - .assertEquals(7155323017509192647L, model.value().get(0).matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.value().get(0).matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("uwnrd", model.value().get(0).annotation()); - Assertions.assertEquals("cboxraq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapRulesListResult model = - new NetworkTapRulesListResult() - .withValue( - Arrays - .asList( - new NetworkTapRuleInner() - .withLocation("zlaihsujtg") - .withTags(mapOf("liqwzutiyelrnhh", "szamijxejpd", "hqsznsyov", "t")) - .withPollingIntervalInSeconds(PollingIntervalInSeconds.NINE_ZERO) - .withConfigurationType(ConfigurationType.INLINE) - .withTapRulesUrl("r") - .withMatchConfigurations( - Arrays - .asList( - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("tqiljknnkynkstdt") - .withSequenceNumber(7155323017509192647L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition())) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction(), new NetworkTapRuleAction())), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("jyihjcwwvaos") - .withSequenceNumber(3529772796591328335L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions(Arrays.asList(new NetworkTapRuleMatchCondition())) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction())))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays.asList(new IpGroupProperties(), new IpGroupProperties())) - .withVlanGroups( - Arrays.asList(new VlanGroupProperties(), new VlanGroupProperties())) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties(), - new PortGroupProperties(), - new PortGroupProperties(), - new PortGroupProperties())), - new CommonDynamicMatchConfiguration() - .withIpGroups(Arrays.asList(new IpGroupProperties())) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties())) - .withPortGroups(Arrays.asList(new PortGroupProperties())))) - .withAnnotation("uwnrd"), - new NetworkTapRuleInner() - .withLocation("jgfmyqyyfr") - .withTags( - mapOf( - "akidfhmlxrqk", - "zfpsf", - "afzvptriysjrg", - "knumk", - "wpuqpsrc", - "r", - "lvbwatzadrjbjn", - "kdvvoydwedggwg")) - .withPollingIntervalInSeconds(PollingIntervalInSeconds.ONE_TWO_ZERO) - .withConfigurationType(ConfigurationType.INLINE) - .withTapRulesUrl("u") - .withMatchConfigurations( - Arrays - .asList( - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("njmo") - .withSequenceNumber(7228921951854777537L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition())) - .withActions(Arrays.asList(new NetworkTapRuleAction())), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("tmnkxjouwfzc") - .withSequenceNumber(8345278573361085323L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition())) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction())), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("nuhcfhepisq") - .withSequenceNumber(7683103186205990817L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition())) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction(), new NetworkTapRuleAction())))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties(), - new IpGroupProperties(), - new IpGroupProperties(), - new IpGroupProperties())) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties())) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties(), - new PortGroupProperties(), - new PortGroupProperties(), - new PortGroupProperties())), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays.asList(new IpGroupProperties(), new IpGroupProperties())) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties())) - .withPortGroups( - Arrays - .asList(new PortGroupProperties(), new PortGroupProperties())), - new CommonDynamicMatchConfiguration() - .withIpGroups(Arrays.asList(new IpGroupProperties())) - .withVlanGroups( - Arrays.asList(new VlanGroupProperties(), new VlanGroupProperties())) - .withPortGroups(Arrays.asList(new PortGroupProperties())), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays.asList(new IpGroupProperties(), new IpGroupProperties())) - .withVlanGroups(Arrays.asList(new VlanGroupProperties())) - .withPortGroups( - Arrays - .asList(new PortGroupProperties(), new PortGroupProperties())))) - .withAnnotation("esrsixwnlpjc"), - new NetworkTapRuleInner() - .withLocation("trapw") - .withTags( - mapOf("u", "utjsjzelsriem", "ycvldeehcbsaip", "meakosy", "kegbvbbdledf", "suo")) - .withPollingIntervalInSeconds(PollingIntervalInSeconds.THREE_ZERO) - .withConfigurationType(ConfigurationType.FILE) - .withTapRulesUrl("nytkmlfupjzc") - .withMatchConfigurations( - Arrays - .asList( - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("joy") - .withSequenceNumber(7264135782871254964L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition())) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction())), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("aktnytkb") - .withSequenceNumber(6525366924338920838L) - .withIpAddressType(IpAddressType.IPV4) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition())) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction())), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("j") - .withSequenceNumber(5551475977673705084L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions(Arrays.asList(new NetworkTapRuleMatchCondition())) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction(), new NetworkTapRuleAction())), - new NetworkTapRuleMatchConfiguration() - .withMatchConfigurationName("hcikhl") - .withSequenceNumber(5349944693025104116L) - .withIpAddressType(IpAddressType.IPV6) - .withMatchConditions( - Arrays - .asList( - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition(), - new NetworkTapRuleMatchCondition())) - .withActions( - Arrays - .asList( - new NetworkTapRuleAction(), - new NetworkTapRuleAction(), - new NetworkTapRuleAction())))) - .withDynamicMatchConfigurations( - Arrays - .asList( - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties(), - new IpGroupProperties(), - new IpGroupProperties())) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties())) - .withPortGroups( - Arrays - .asList(new PortGroupProperties(), new PortGroupProperties())), - new CommonDynamicMatchConfiguration() - .withIpGroups( - Arrays - .asList( - new IpGroupProperties(), - new IpGroupProperties(), - new IpGroupProperties(), - new IpGroupProperties())) - .withVlanGroups( - Arrays - .asList( - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties(), - new VlanGroupProperties())) - .withPortGroups( - Arrays - .asList( - new PortGroupProperties(), - new PortGroupProperties(), - new PortGroupProperties())))) - .withAnnotation("toidhb"))) - .withNextLink("cboxraq"); - model = BinaryData.fromObject(model).toObject(NetworkTapRulesListResult.class); - Assertions.assertEquals("zlaihsujtg", model.value().get(0).location()); - Assertions.assertEquals("szamijxejpd", model.value().get(0).tags().get("liqwzutiyelrnhh")); - Assertions.assertEquals(PollingIntervalInSeconds.NINE_ZERO, model.value().get(0).pollingIntervalInSeconds()); - Assertions.assertEquals(ConfigurationType.INLINE, model.value().get(0).configurationType()); - Assertions.assertEquals("r", model.value().get(0).tapRulesUrl()); - Assertions - .assertEquals( - "tqiljknnkynkstdt", model.value().get(0).matchConfigurations().get(0).matchConfigurationName()); - Assertions - .assertEquals(7155323017509192647L, model.value().get(0).matchConfigurations().get(0).sequenceNumber()); - Assertions.assertEquals(IpAddressType.IPV4, model.value().get(0).matchConfigurations().get(0).ipAddressType()); - Assertions.assertEquals("uwnrd", model.value().get(0).annotation()); - Assertions.assertEquals("cboxraq", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesResyncMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesResyncMockTests.java deleted file mode 100644 index b720abe09df5..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesResyncMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -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 NetworkTapRulesResyncMockTests { - @Test - public void testResync() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Succeeded\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager.networkTapRules().resync("nuahhkedvb", "bdujpshiszivryc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesUpdateAdministrativeStateMockTests.java deleted file mode 100644 index 980cc9baa935..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NetworkTapRulesUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Failed\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .networkTapRules() - .updateAdministrativeState( - "pigla", - "heqjc", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("mc")) - .withState(EnableDisableState.DISABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesValidateConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesValidateConfigurationMockTests.java deleted file mode 100644 index 94c868dc75d3..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapRulesValidateConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationResponse; -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 NetworkTapRulesValidateConfigurationMockTests { - @Test - public void testValidateConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"DeferredControl\",\"url\":\"yocybrlwdmpsdfs\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateConfigurationResponse response = - manager.networkTapRules().validateConfiguration("z", "orvsgmkkeles", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("yocybrlwdmpsdfs", response.url()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsCreateMockTests.java deleted file mode 100644 index a6d699d70402..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsCreateMockTests.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.IsolationDomainProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTap; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapPropertiesDestinationsItem; -import com.azure.resourcemanager.managednetworkfabric.models.PollingType; -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 NetworkTapsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"networkPacketBrokerId\":\"yq\",\"sourceTapRuleId\":\"aqjhokhijghpv\",\"destinations\":[{\"name\":\"x\",\"destinationType\":\"Direct\",\"destinationId\":\"atbwya\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"blh\",\"fqw\"]},\"destinationTapRuleId\":\"nxtpzdgyilwu\"},{\"name\":\"l\",\"destinationType\":\"Direct\",\"destinationId\":\"bxo\",\"isolationDomainProperties\":{\"encapsulation\":\"GRE\",\"neighborGroupIds\":[\"lgjfhviahokea\",\"madyoctmdauoscc\"]},\"destinationTapRuleId\":\"bestntoeteufg\"}],\"pollingType\":\"Push\",\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"Enabled\",\"annotation\":\"frfugthcdbzoxhoi\"},\"location\":\"pbogpbwefox\",\"tags\":{\"mzupqkrqeqjtzawe\":\"ijpkbr\",\"djixkepla\":\"rvgit\",\"yqvmhtyafcv\":\"ohnizvvekpq\",\"ooqekzxqrzsng\":\"osovxm\"},\"id\":\"tlbsnlfplxjrhkwh\",\"name\":\"orhwuujymyjvkoy\",\"type\":\"gtou\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkTap response = - manager - .networkTaps() - .define("ncxje") - .withRegion("wcpqkpgbssjq") - .withExistingResourceGroup("y") - .withNetworkPacketBrokerId("mawxrg") - .withDestinations( - Arrays - .asList( - new NetworkTapPropertiesDestinationsItem() - .withName("kxzcvuttyihpsr") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("ojwjanzolqqp") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("ojupqlu", "xkzdnotg"))) - .withDestinationTapRuleId("wisqfif"), - new NetworkTapPropertiesDestinationsItem() - .withName("tqvypki") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("ezbceimscoty") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("wqmraih"))) - .withDestinationTapRuleId("cjvzlgclia"), - new NetworkTapPropertiesDestinationsItem() - .withName("wxvihyi") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("xex") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.GRE) - .withNeighborGroupIds(Arrays.asList("ymgkirfzvtzrq", "ilipmuu"))) - .withDestinationTapRuleId("ekzspufhwpkpejf"), - new NetworkTapPropertiesDestinationsItem() - .withName("wrq") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("rsm") - .withIsolationDomainProperties( - new IsolationDomainProperties() - .withEncapsulation(Encapsulation.NONE) - .withNeighborGroupIds(Arrays.asList("fajptjhwr", "wrakappafj"))) - .withDestinationTapRuleId("ccqjaefrzqwyt"))) - .withTags(mapOf("pbko", "cvdzytsd", "p", "pujcr", "wyppnularnuppr", "jzbuvmfsfruenqfn")) - .withPollingType(PollingType.PUSH) - .withAnnotation("jchz") - .create(); - - Assertions.assertEquals("pbogpbwefox", response.location()); - Assertions.assertEquals("ijpkbr", response.tags().get("mzupqkrqeqjtzawe")); - Assertions.assertEquals("yq", response.networkPacketBrokerId()); - Assertions.assertEquals("x", response.destinations().get(0).name()); - Assertions.assertEquals(DestinationType.DIRECT, response.destinations().get(0).destinationType()); - Assertions.assertEquals("atbwya", response.destinations().get(0).destinationId()); - Assertions - .assertEquals( - Encapsulation.NONE, response.destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions - .assertEquals("blh", response.destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("nxtpzdgyilwu", response.destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals(PollingType.PUSH, response.pollingType()); - Assertions.assertEquals("frfugthcdbzoxhoi", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index e856b64f1da8..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTap; -import com.azure.resourcemanager.managednetworkfabric.models.PollingType; -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 NetworkTapsGetByResourceGroupWithResponseMockTests { - @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\":{\"networkPacketBrokerId\":\"zgwywyxbwuam\",\"sourceTapRuleId\":\"opqqiyjrehe\",\"destinations\":[{\"name\":\"engmxpjkuqbngrom\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"dzyyal\",\"isolationDomainProperties\":{\"encapsulation\":\"None\",\"neighborGroupIds\":[\"qfwuplfjkbaxv\",\"seimuipggt\"]},\"destinationTapRuleId\":\"xbfhb\"},{\"name\":\"ldziph\",\"destinationType\":\"Direct\",\"destinationId\":\"fz\",\"isolationDomainProperties\":{\"encapsulation\":\"GRE\",\"neighborGroupIds\":[\"amvritjjhqv\",\"pqgncgw\"]},\"destinationTapRuleId\":\"btkafcnfit\"},{\"name\":\"ck\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"yjdvyxxbawjgyn\",\"isolationDomainProperties\":{\"encapsulation\":\"GRE\",\"neighborGroupIds\":[\"ridqlynxbdisje\",\"vgcfhchgjo\"]},\"destinationTapRuleId\":\"hdibzvpdjy\"}],\"pollingType\":\"Push\",\"configurationState\":\"Provisioned\",\"provisioningState\":\"Updating\",\"administrativeState\":\"Enabled\",\"annotation\":\"nqonjbbhwsf\"},\"location\":\"zykz\",\"tags\":{\"pjjnblbkakni\":\"dslpbyejsg\",\"irttqils\":\"wbddnddctkjcqhx\",\"leiyemjips\":\"abqtjchxsfwe\",\"m\":\"ekdqqwcspfhrndq\"},\"id\":\"oslqgsdqnqqzq\",\"name\":\"vgno\",\"type\":\"tkgoyn\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkTap response = - manager - .networkTaps() - .getByResourceGroupWithResponse("tvnlbkizebbrwlp", "qmisoiqge", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zykz", response.location()); - Assertions.assertEquals("dslpbyejsg", response.tags().get("pjjnblbkakni")); - Assertions.assertEquals("zgwywyxbwuam", response.networkPacketBrokerId()); - Assertions.assertEquals("engmxpjkuqbngrom", response.destinations().get(0).name()); - Assertions.assertEquals(DestinationType.ISOLATION_DOMAIN, response.destinations().get(0).destinationType()); - Assertions.assertEquals("dzyyal", response.destinations().get(0).destinationId()); - Assertions - .assertEquals( - Encapsulation.NONE, response.destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions - .assertEquals( - "qfwuplfjkbaxv", response.destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("xbfhb", response.destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals(PollingType.PUSH, response.pollingType()); - Assertions.assertEquals("nqonjbbhwsf", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsListByResourceGroupMockTests.java deleted file mode 100644 index e1aceb3a7106..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTap; -import com.azure.resourcemanager.managednetworkfabric.models.PollingType; -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 NetworkTapsListByResourceGroupMockTests { - @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\":{\"networkPacketBrokerId\":\"mfkctpaiwh\",\"sourceTapRuleId\":\"wyx\",\"destinations\":[{\"name\":\"imwnuvjdywpfx\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"kmnjt\",\"isolationDomainProperties\":{\"encapsulation\":\"GRE\",\"neighborGroupIds\":[\"dbckns\",\"jtmpdkcbpkiguv\",\"aitkcendwg\",\"ssctnppx\"]},\"destinationTapRuleId\":\"ysqenfw\"}],\"pollingType\":\"Pull\",\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Enabled\",\"annotation\":\"vzmvnbc\"},\"location\":\"ssxuu\",\"tags\":{\"nnen\":\"fsukpkiealbck\",\"razwkcohjxoc\":\"cezt\",\"uudr\":\"mvuamorhkne\"},\"id\":\"izznkrarjii\",\"name\":\"pbychcwhlhdzdcrl\",\"type\":\"cmeyxypxlzcr\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.networkTaps().listByResourceGroup("aarwphbuzmvjiltl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ssxuu", response.iterator().next().location()); - Assertions.assertEquals("fsukpkiealbck", response.iterator().next().tags().get("nnen")); - Assertions.assertEquals("mfkctpaiwh", response.iterator().next().networkPacketBrokerId()); - Assertions.assertEquals("imwnuvjdywpfx", response.iterator().next().destinations().get(0).name()); - Assertions - .assertEquals( - DestinationType.ISOLATION_DOMAIN, response.iterator().next().destinations().get(0).destinationType()); - Assertions.assertEquals("kmnjt", response.iterator().next().destinations().get(0).destinationId()); - Assertions - .assertEquals( - Encapsulation.GRE, - response.iterator().next().destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions - .assertEquals( - "dbckns", - response.iterator().next().destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("ysqenfw", response.iterator().next().destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals(PollingType.PULL, response.iterator().next().pollingType()); - Assertions.assertEquals("vzmvnbc", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsListMockTests.java deleted file mode 100644 index 7bf87edad174..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.Encapsulation; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTap; -import com.azure.resourcemanager.managednetworkfabric.models.PollingType; -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 NetworkTapsListMockTests { - @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\":{\"networkPacketBrokerId\":\"mfvjz\",\"sourceTapRuleId\":\"etpdezebvtkgzjna\",\"destinations\":[{\"name\":\"hei\",\"destinationType\":\"Direct\",\"destinationId\":\"cxuounzzckogcv\",\"isolationDomainProperties\":{\"encapsulation\":\"GRE\",\"neighborGroupIds\":[\"nyofts\",\"diydwklkuamxho\"]},\"destinationTapRuleId\":\"nqeonyi\"}],\"pollingType\":\"Push\",\"configurationState\":\"Provisioned\",\"provisioningState\":\"Failed\",\"administrativeState\":\"MAT\",\"annotation\":\"wzlwellhmppf\"},\"location\":\"rfuzedud\",\"tags\":{\"a\":\"dv\",\"mimbcflhycluou\":\"fvjv\"},\"id\":\"vrqvxnoa\",\"name\":\"ariv\",\"type\":\"zezeew\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkTaps().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("rfuzedud", response.iterator().next().location()); - Assertions.assertEquals("dv", response.iterator().next().tags().get("a")); - Assertions.assertEquals("mfvjz", response.iterator().next().networkPacketBrokerId()); - Assertions.assertEquals("hei", response.iterator().next().destinations().get(0).name()); - Assertions - .assertEquals(DestinationType.DIRECT, response.iterator().next().destinations().get(0).destinationType()); - Assertions.assertEquals("cxuounzzckogcv", response.iterator().next().destinations().get(0).destinationId()); - Assertions - .assertEquals( - Encapsulation.GRE, - response.iterator().next().destinations().get(0).isolationDomainProperties().encapsulation()); - Assertions - .assertEquals( - "nyofts", - response.iterator().next().destinations().get(0).isolationDomainProperties().neighborGroupIds().get(0)); - Assertions.assertEquals("nqeonyi", response.iterator().next().destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals(PollingType.PUSH, response.iterator().next().pollingType()); - Assertions.assertEquals("wzlwellhmppf", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsListResultTests.java deleted file mode 100644 index 0976ae765fab..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsListResultTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkTapInner; -import com.azure.resourcemanager.managednetworkfabric.models.DestinationType; -import com.azure.resourcemanager.managednetworkfabric.models.IsolationDomainProperties; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapPropertiesDestinationsItem; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapsListResult; -import com.azure.resourcemanager.managednetworkfabric.models.PollingType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTapsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkTapsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"networkPacketBrokerId\":\"mslub\",\"sourceTapRuleId\":\"nyfuysjhv\",\"destinations\":[{\"name\":\"lfswarmybwmro\",\"destinationType\":\"Direct\",\"destinationId\":\"syqnipehfww\",\"isolationDomainProperties\":{},\"destinationTapRuleId\":\"nxiajuvj\"},{\"name\":\"fjisosfzlnraxnf\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"ax\",\"isolationDomainProperties\":{},\"destinationTapRuleId\":\"jixgofqdqws\"},{\"name\":\"ihuvrqpbxdoicqpk\",\"destinationType\":\"IsolationDomain\",\"destinationId\":\"dprpensbmzjrituk\",\"isolationDomainProperties\":{},\"destinationTapRuleId\":\"hbfexmizz\"}],\"pollingType\":\"Push\",\"configurationState\":\"Accepted\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Disabled\",\"annotation\":\"ndu\"},\"location\":\"uwdvolxt\",\"tags\":{\"s\":\"ic\",\"mjfgoxedrmra\":\"lzbki\",\"yiog\":\"hvchvv\",\"wxcsmx\":\"ntnwzruzso\"},\"id\":\"lcappnvcebspci\",\"name\":\"yomhkdwuwedupb\",\"type\":\"mzkwhjjsqwhae\"}],\"nextLink\":\"fv\"}") - .toObject(NetworkTapsListResult.class); - Assertions.assertEquals("uwdvolxt", model.value().get(0).location()); - Assertions.assertEquals("ic", model.value().get(0).tags().get("s")); - Assertions.assertEquals("mslub", model.value().get(0).networkPacketBrokerId()); - Assertions.assertEquals("lfswarmybwmro", model.value().get(0).destinations().get(0).name()); - Assertions.assertEquals(DestinationType.DIRECT, model.value().get(0).destinations().get(0).destinationType()); - Assertions.assertEquals("syqnipehfww", model.value().get(0).destinations().get(0).destinationId()); - Assertions.assertEquals("nxiajuvj", model.value().get(0).destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals(PollingType.PUSH, model.value().get(0).pollingType()); - Assertions.assertEquals("ndu", model.value().get(0).annotation()); - Assertions.assertEquals("fv", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkTapsListResult model = - new NetworkTapsListResult() - .withValue( - Arrays - .asList( - new NetworkTapInner() - .withLocation("uwdvolxt") - .withTags( - mapOf("s", "ic", "mjfgoxedrmra", "lzbki", "yiog", "hvchvv", "wxcsmx", "ntnwzruzso")) - .withNetworkPacketBrokerId("mslub") - .withDestinations( - Arrays - .asList( - new NetworkTapPropertiesDestinationsItem() - .withName("lfswarmybwmro") - .withDestinationType(DestinationType.DIRECT) - .withDestinationId("syqnipehfww") - .withIsolationDomainProperties(new IsolationDomainProperties()) - .withDestinationTapRuleId("nxiajuvj"), - new NetworkTapPropertiesDestinationsItem() - .withName("fjisosfzlnraxnf") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("ax") - .withIsolationDomainProperties(new IsolationDomainProperties()) - .withDestinationTapRuleId("jixgofqdqws"), - new NetworkTapPropertiesDestinationsItem() - .withName("ihuvrqpbxdoicqpk") - .withDestinationType(DestinationType.ISOLATION_DOMAIN) - .withDestinationId("dprpensbmzjrituk") - .withIsolationDomainProperties(new IsolationDomainProperties()) - .withDestinationTapRuleId("hbfexmizz"))) - .withPollingType(PollingType.PUSH) - .withAnnotation("ndu"))) - .withNextLink("fv"); - model = BinaryData.fromObject(model).toObject(NetworkTapsListResult.class); - Assertions.assertEquals("uwdvolxt", model.value().get(0).location()); - Assertions.assertEquals("ic", model.value().get(0).tags().get("s")); - Assertions.assertEquals("mslub", model.value().get(0).networkPacketBrokerId()); - Assertions.assertEquals("lfswarmybwmro", model.value().get(0).destinations().get(0).name()); - Assertions.assertEquals(DestinationType.DIRECT, model.value().get(0).destinations().get(0).destinationType()); - Assertions.assertEquals("syqnipehfww", model.value().get(0).destinations().get(0).destinationId()); - Assertions.assertEquals("nxiajuvj", model.value().get(0).destinations().get(0).destinationTapRuleId()); - Assertions.assertEquals(PollingType.PUSH, model.value().get(0).pollingType()); - Assertions.assertEquals("ndu", model.value().get(0).annotation()); - Assertions.assertEquals("fv", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsResyncMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsResyncMockTests.java deleted file mode 100644 index d77e65fd81fa..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsResyncMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -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 NetworkTapsResyncMockTests { - @Test - public void testResync() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Failed\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager.networkTaps().resync("fyfmjckc", "ybhsgqiumkt", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsUpdateAdministrativeStateMockTests.java deleted file mode 100644 index a7c4c61a96ba..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkTapsUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -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 NetworkTapsUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"configurationState\":\"Failed\",\"successfulDevices\":[\"vuwbbzcmpbymsgcl\"],\"failedDevices\":[\"r\"]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForDeviceUpdate response = - manager - .networkTaps() - .updateAdministrativeState( - "rblksddb", - "hgvj", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("ikws", "xrsox", "xuuypdcg")) - .withState(EnableDisableState.ENABLE), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vuwbbzcmpbymsgcl", response.successfulDevices().get(0)); - Assertions.assertEquals("r", response.failedDevices().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectInnerTests.java deleted file mode 100644 index 25256db5bb3a..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectInnerTests.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.IsManagementType; -import com.azure.resourcemanager.managednetworkfabric.models.Layer2Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.NniType; -import com.azure.resourcemanager.managednetworkfabric.models.NpbStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkToNetworkInterconnectInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkToNetworkInterconnectInner model = - BinaryData - .fromString( - "{\"properties\":{\"nniType\":\"CE\",\"isManagementType\":\"True\",\"useOptionB\":\"True\",\"layer2Configuration\":{\"mtu\":1949455088,\"interfaces\":[\"pks\"]},\"optionBLayer3Configuration\":{\"peerASN\":7536887124477859873,\"vlanId\":714826878,\"fabricASN\":1912644543968720806,\"primaryIpv4Prefix\":\"zqv\",\"primaryIpv6Prefix\":\"czyayubtgmbxi\",\"secondaryIpv4Prefix\":\"hragpxmib\",\"secondaryIpv6Prefix\":\"nupoyryefqmwovyz\"},\"npbStaticRouteConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":1125325680,\"multiplier\":1384150954},\"ipv4Routes\":[{\"prefix\":\"eegvyieztkutnj\",\"nextHop\":[\"l\",\"kkreh\"]}],\"ipv6Routes\":[{\"prefix\":\"mjodu\",\"nextHop\":[\"vulxfar\",\"rvjlgd\",\"zvj\"]},{\"prefix\":\"wahoyiyaxqvjw\",\"nextHop\":[\"wtc\"]},{\"prefix\":\"kddn\",\"nextHop\":[\"vbooqbmdqrxy\",\"laetscflwtjdtlr\",\"e\",\"ooy\"]}]},\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"xdtzcqipsdudgco\",\"importIpv6RoutePolicyId\":\"omehx\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"tolamlbijuxkq\",\"exportIpv6RoutePolicyId\":\"czipvwdtgck\"},\"egressAclId\":\"qiqdlratrkwxoau\",\"ingressAclId\":\"suykznhrfgsl\",\"configurationState\":\"ErrorProvisioning\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"RMA\"},\"id\":\"f\",\"name\":\"ihuioaeo\",\"type\":\"pajtfeyvkbd\"}") - .toObject(NetworkToNetworkInterconnectInner.class); - Assertions.assertEquals(NniType.CE, model.nniType()); - Assertions.assertEquals(IsManagementType.TRUE, model.isManagementType()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.useOptionB()); - Assertions.assertEquals(1949455088, model.layer2Configuration().mtu()); - Assertions.assertEquals("pks", model.layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("zqv", model.optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("czyayubtgmbxi", model.optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("hragpxmib", model.optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("nupoyryefqmwovyz", model.optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(7536887124477859873L, model.optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(714826878, model.optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals(1125325680, model.npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1384150954, model.npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("eegvyieztkutnj", model.npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("l", model.npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("mjodu", model.npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("vulxfar", model.npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("xdtzcqipsdudgco", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("omehx", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("tolamlbijuxkq", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("czipvwdtgck", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("qiqdlratrkwxoau", model.egressAclId()); - Assertions.assertEquals("suykznhrfgsl", model.ingressAclId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkToNetworkInterconnectInner model = - new NetworkToNetworkInterconnectInner() - .withNniType(NniType.CE) - .withIsManagementType(IsManagementType.TRUE) - .withUseOptionB(BooleanEnumProperty.TRUE) - .withLayer2Configuration( - new Layer2Configuration().withMtu(1949455088).withInterfaces(Arrays.asList("pks"))) - .withOptionBLayer3Configuration( - new NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration() - .withPrimaryIpv4Prefix("zqv") - .withPrimaryIpv6Prefix("czyayubtgmbxi") - .withSecondaryIpv4Prefix("hragpxmib") - .withSecondaryIpv6Prefix("nupoyryefqmwovyz") - .withPeerAsn(7536887124477859873L) - .withVlanId(714826878)) - .withNpbStaticRouteConfiguration( - new NpbStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1125325680).withMultiplier(1384150954)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("eegvyieztkutnj") - .withNextHop(Arrays.asList("l", "kkreh")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("mjodu") - .withNextHop(Arrays.asList("vulxfar", "rvjlgd", "zvj")), - new StaticRouteProperties() - .withPrefix("wahoyiyaxqvjw") - .withNextHop(Arrays.asList("wtc")), - new StaticRouteProperties() - .withPrefix("kddn") - .withNextHop(Arrays.asList("vbooqbmdqrxy", "laetscflwtjdtlr", "e", "ooy"))))) - .withImportRoutePolicy( - new ImportRoutePolicyInformation() - .withImportIpv4RoutePolicyId("xdtzcqipsdudgco") - .withImportIpv6RoutePolicyId("omehx")) - .withExportRoutePolicy( - new ExportRoutePolicyInformation() - .withExportIpv4RoutePolicyId("tolamlbijuxkq") - .withExportIpv6RoutePolicyId("czipvwdtgck")) - .withEgressAclId("qiqdlratrkwxoau") - .withIngressAclId("suykznhrfgsl"); - model = BinaryData.fromObject(model).toObject(NetworkToNetworkInterconnectInner.class); - Assertions.assertEquals(NniType.CE, model.nniType()); - Assertions.assertEquals(IsManagementType.TRUE, model.isManagementType()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.useOptionB()); - Assertions.assertEquals(1949455088, model.layer2Configuration().mtu()); - Assertions.assertEquals("pks", model.layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("zqv", model.optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("czyayubtgmbxi", model.optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("hragpxmib", model.optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("nupoyryefqmwovyz", model.optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(7536887124477859873L, model.optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(714826878, model.optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals(1125325680, model.npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1384150954, model.npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("eegvyieztkutnj", model.npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("l", model.npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("mjodu", model.npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("vulxfar", model.npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("xdtzcqipsdudgco", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("omehx", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("tolamlbijuxkq", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("czipvwdtgck", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("qiqdlratrkwxoau", model.egressAclId()); - Assertions.assertEquals("suykznhrfgsl", model.ingressAclId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPatchTests.java deleted file mode 100644 index b577f15e7eb9..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPatchTests.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.Layer2Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPatch; -import com.azure.resourcemanager.managednetworkfabric.models.NpbStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.OptionBLayer3Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkToNetworkInterconnectPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkToNetworkInterconnectPatch model = - BinaryData - .fromString( - "{\"properties\":{\"layer2Configuration\":{\"mtu\":900871116,\"interfaces\":[\"xxcrxoxdjxld\",\"a\",\"yyi\"]},\"optionBLayer3Configuration\":{\"peerASN\":8054036118396352474,\"vlanId\":1445832439,\"fabricASN\":1738690679590398351,\"primaryIpv4Prefix\":\"bvxvza\",\"primaryIpv6Prefix\":\"doyqx\",\"secondaryIpv4Prefix\":\"nkfthmcxqqxmyz\",\"secondaryIpv6Prefix\":\"a\"},\"npbStaticRouteConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":2046617315,\"multiplier\":1805323615},\"ipv4Routes\":[{\"prefix\":\"qr\",\"nextHop\":[\"a\"]}],\"ipv6Routes\":[{\"prefix\":\"znllaslk\",\"nextHop\":[\"hjqjpv\",\"aihxjtgzgtaiywbq\",\"roigbsfsgsaenwld\",\"mhljqlxspm\"]},{\"prefix\":\"jc\",\"nextHop\":[\"y\",\"dsxebuhsxrz\"]},{\"prefix\":\"mgsdaluyckhefrbh\",\"nextHop\":[\"uerbgpxebjl\"]},{\"prefix\":\"dcaytujraxd\",\"nextHop\":[\"ryjmgtnsewou\"]}]},\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"msvvylj\",\"importIpv6RoutePolicyId\":\"kepo\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"qqylmpctwjwds\",\"exportIpv6RoutePolicyId\":\"zmk\"},\"egressAclId\":\"rxxxoteehkhowgom\",\"ingressAclId\":\"hxow\"},\"id\":\"c\",\"name\":\"apnpxraqawbmp\",\"type\":\"p\"}") - .toObject(NetworkToNetworkInterconnectPatch.class); - Assertions.assertEquals(900871116, model.layer2Configuration().mtu()); - Assertions.assertEquals("xxcrxoxdjxld", model.layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("bvxvza", model.optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("doyqx", model.optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("nkfthmcxqqxmyz", model.optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("a", model.optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(8054036118396352474L, model.optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(1445832439, model.optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals(2046617315, model.npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1805323615, model.npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("qr", model.npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("a", model.npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("znllaslk", model.npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("hjqjpv", model.npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("msvvylj", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("kepo", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("qqylmpctwjwds", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("zmk", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("rxxxoteehkhowgom", model.egressAclId()); - Assertions.assertEquals("hxow", model.ingressAclId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkToNetworkInterconnectPatch model = - new NetworkToNetworkInterconnectPatch() - .withLayer2Configuration( - new Layer2Configuration() - .withMtu(900871116) - .withInterfaces(Arrays.asList("xxcrxoxdjxld", "a", "yyi"))) - .withOptionBLayer3Configuration( - new OptionBLayer3Configuration() - .withPrimaryIpv4Prefix("bvxvza") - .withPrimaryIpv6Prefix("doyqx") - .withSecondaryIpv4Prefix("nkfthmcxqqxmyz") - .withSecondaryIpv6Prefix("a") - .withPeerAsn(8054036118396352474L) - .withVlanId(1445832439)) - .withNpbStaticRouteConfiguration( - new NpbStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(2046617315).withMultiplier(1805323615)) - .withIpv4Routes( - Arrays.asList(new StaticRouteProperties().withPrefix("qr").withNextHop(Arrays.asList("a")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("znllaslk") - .withNextHop( - Arrays - .asList( - "hjqjpv", "aihxjtgzgtaiywbq", "roigbsfsgsaenwld", "mhljqlxspm")), - new StaticRouteProperties() - .withPrefix("jc") - .withNextHop(Arrays.asList("y", "dsxebuhsxrz")), - new StaticRouteProperties() - .withPrefix("mgsdaluyckhefrbh") - .withNextHop(Arrays.asList("uerbgpxebjl")), - new StaticRouteProperties() - .withPrefix("dcaytujraxd") - .withNextHop(Arrays.asList("ryjmgtnsewou"))))) - .withImportRoutePolicy( - new ImportRoutePolicyInformation() - .withImportIpv4RoutePolicyId("msvvylj") - .withImportIpv6RoutePolicyId("kepo")) - .withExportRoutePolicy( - new ExportRoutePolicyInformation() - .withExportIpv4RoutePolicyId("qqylmpctwjwds") - .withExportIpv6RoutePolicyId("zmk")) - .withEgressAclId("rxxxoteehkhowgom") - .withIngressAclId("hxow"); - model = BinaryData.fromObject(model).toObject(NetworkToNetworkInterconnectPatch.class); - Assertions.assertEquals(900871116, model.layer2Configuration().mtu()); - Assertions.assertEquals("xxcrxoxdjxld", model.layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("bvxvza", model.optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("doyqx", model.optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("nkfthmcxqqxmyz", model.optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("a", model.optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(8054036118396352474L, model.optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(1445832439, model.optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals(2046617315, model.npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1805323615, model.npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("qr", model.npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("a", model.npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("znllaslk", model.npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("hjqjpv", model.npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("msvvylj", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("kepo", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("qqylmpctwjwds", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("zmk", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("rxxxoteehkhowgom", model.egressAclId()); - Assertions.assertEquals("hxow", model.ingressAclId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPatchablePropertiesTests.java deleted file mode 100644 index 8ac9fd2121bc..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPatchablePropertiesTests.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.Layer2Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.NpbStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.OptionBLayer3Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkToNetworkInterconnectPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkToNetworkInterconnectPatchableProperties model = - BinaryData - .fromString( - "{\"layer2Configuration\":{\"mtu\":1117433456,\"interfaces\":[\"ocvvujexayglxrk\",\"jnmzp\",\"slavxjfiuof\",\"ieidzlv\"]},\"optionBLayer3Configuration\":{\"peerASN\":7453153406196405101,\"vlanId\":1065564623,\"fabricASN\":542794385312423541,\"primaryIpv4Prefix\":\"yhydvikmfn\",\"primaryIpv6Prefix\":\"millxgjs\",\"secondaryIpv4Prefix\":\"zwgsoriobije\",\"secondaryIpv6Prefix\":\"dye\"},\"npbStaticRouteConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":1616248740,\"multiplier\":1318748653},\"ipv4Routes\":[{\"prefix\":\"wybriopdwe\",\"nextHop\":[\"tnorwaigsioct\"]},{\"prefix\":\"kmv\",\"nextHop\":[\"nx\"]},{\"prefix\":\"zfffhtjnwo\",\"nextHop\":[\"tfjxtvlx\",\"zqfcwrriomxee\"]},{\"prefix\":\"wyhjmbjiqegmxdbs\",\"nextHop\":[\"cwhpy\"]}],\"ipv6Routes\":[{\"prefix\":\"gdetszwcanzbjek\",\"nextHop\":[\"yckyvne\",\"smuffiwjb\",\"tvbpzujqj\"]},{\"prefix\":\"otdxpo\",\"nextHop\":[\"slhwuusieckty\",\"h\",\"uxidhhxomilddxj\"]}]},\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"gxwjwil\",\"importIpv6RoutePolicyId\":\"rslaatep\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"jjzgxqgqw\",\"exportIpv6RoutePolicyId\":\"rhgtvhv\"},\"egressAclId\":\"qykbkkt\",\"ingressAclId\":\"zejogmkorvvmvm\"}") - .toObject(NetworkToNetworkInterconnectPatchableProperties.class); - Assertions.assertEquals(1117433456, model.layer2Configuration().mtu()); - Assertions.assertEquals("ocvvujexayglxrk", model.layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("yhydvikmfn", model.optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("millxgjs", model.optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("zwgsoriobije", model.optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("dye", model.optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(7453153406196405101L, model.optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(1065564623, model.optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals(1616248740, model.npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1318748653, model.npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("wybriopdwe", model.npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals("tnorwaigsioct", model.npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("gdetszwcanzbjek", model.npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("yckyvne", model.npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("gxwjwil", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("rslaatep", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("jjzgxqgqw", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("rhgtvhv", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("qykbkkt", model.egressAclId()); - Assertions.assertEquals("zejogmkorvvmvm", model.ingressAclId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkToNetworkInterconnectPatchableProperties model = - new NetworkToNetworkInterconnectPatchableProperties() - .withLayer2Configuration( - new Layer2Configuration() - .withMtu(1117433456) - .withInterfaces(Arrays.asList("ocvvujexayglxrk", "jnmzp", "slavxjfiuof", "ieidzlv"))) - .withOptionBLayer3Configuration( - new OptionBLayer3Configuration() - .withPrimaryIpv4Prefix("yhydvikmfn") - .withPrimaryIpv6Prefix("millxgjs") - .withSecondaryIpv4Prefix("zwgsoriobije") - .withSecondaryIpv6Prefix("dye") - .withPeerAsn(7453153406196405101L) - .withVlanId(1065564623)) - .withNpbStaticRouteConfiguration( - new NpbStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1616248740).withMultiplier(1318748653)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("wybriopdwe") - .withNextHop(Arrays.asList("tnorwaigsioct")), - new StaticRouteProperties().withPrefix("kmv").withNextHop(Arrays.asList("nx")), - new StaticRouteProperties() - .withPrefix("zfffhtjnwo") - .withNextHop(Arrays.asList("tfjxtvlx", "zqfcwrriomxee")), - new StaticRouteProperties() - .withPrefix("wyhjmbjiqegmxdbs") - .withNextHop(Arrays.asList("cwhpy")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("gdetszwcanzbjek") - .withNextHop(Arrays.asList("yckyvne", "smuffiwjb", "tvbpzujqj")), - new StaticRouteProperties() - .withPrefix("otdxpo") - .withNextHop(Arrays.asList("slhwuusieckty", "h", "uxidhhxomilddxj"))))) - .withImportRoutePolicy( - new ImportRoutePolicyInformation() - .withImportIpv4RoutePolicyId("gxwjwil") - .withImportIpv6RoutePolicyId("rslaatep")) - .withExportRoutePolicy( - new ExportRoutePolicyInformation() - .withExportIpv4RoutePolicyId("jjzgxqgqw") - .withExportIpv6RoutePolicyId("rhgtvhv")) - .withEgressAclId("qykbkkt") - .withIngressAclId("zejogmkorvvmvm"); - model = BinaryData.fromObject(model).toObject(NetworkToNetworkInterconnectPatchableProperties.class); - Assertions.assertEquals(1117433456, model.layer2Configuration().mtu()); - Assertions.assertEquals("ocvvujexayglxrk", model.layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("yhydvikmfn", model.optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("millxgjs", model.optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("zwgsoriobije", model.optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("dye", model.optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(7453153406196405101L, model.optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(1065564623, model.optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals(1616248740, model.npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1318748653, model.npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("wybriopdwe", model.npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals("tnorwaigsioct", model.npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("gdetszwcanzbjek", model.npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("yckyvne", model.npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("gxwjwil", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("rslaatep", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("jjzgxqgqw", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("rhgtvhv", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("qykbkkt", model.egressAclId()); - Assertions.assertEquals("zejogmkorvvmvm", model.ingressAclId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPropertiesOptionBLayer3ConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPropertiesOptionBLayer3ConfigurationTests.java deleted file mode 100644 index 97e999fc53dc..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPropertiesOptionBLayer3ConfigurationTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration; -import org.junit.jupiter.api.Assertions; - -public final class NetworkToNetworkInterconnectPropertiesOptionBLayer3ConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration model = - BinaryData - .fromString( - "{\"peerASN\":8932988459385064197,\"vlanId\":1349785118,\"fabricASN\":9052438089668649681,\"primaryIpv4Prefix\":\"mbrwg\",\"primaryIpv6Prefix\":\"xljbkhxsd\",\"secondaryIpv4Prefix\":\"au\",\"secondaryIpv6Prefix\":\"dmhweqjfyxydgto\"}") - .toObject(NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration.class); - Assertions.assertEquals("mbrwg", model.primaryIpv4Prefix()); - Assertions.assertEquals("xljbkhxsd", model.primaryIpv6Prefix()); - Assertions.assertEquals("au", model.secondaryIpv4Prefix()); - Assertions.assertEquals("dmhweqjfyxydgto", model.secondaryIpv6Prefix()); - Assertions.assertEquals(8932988459385064197L, model.peerAsn()); - Assertions.assertEquals(1349785118, model.vlanId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration model = - new NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration() - .withPrimaryIpv4Prefix("mbrwg") - .withPrimaryIpv6Prefix("xljbkhxsd") - .withSecondaryIpv4Prefix("au") - .withSecondaryIpv6Prefix("dmhweqjfyxydgto") - .withPeerAsn(8932988459385064197L) - .withVlanId(1349785118); - model = - BinaryData - .fromObject(model) - .toObject(NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration.class); - Assertions.assertEquals("mbrwg", model.primaryIpv4Prefix()); - Assertions.assertEquals("xljbkhxsd", model.primaryIpv6Prefix()); - Assertions.assertEquals("au", model.secondaryIpv4Prefix()); - Assertions.assertEquals("dmhweqjfyxydgto", model.secondaryIpv6Prefix()); - Assertions.assertEquals(8932988459385064197L, model.peerAsn()); - Assertions.assertEquals(1349785118, model.vlanId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPropertiesTests.java deleted file mode 100644 index e44b7b0b7b11..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectPropertiesTests.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectProperties; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.IsManagementType; -import com.azure.resourcemanager.managednetworkfabric.models.Layer2Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.NniType; -import com.azure.resourcemanager.managednetworkfabric.models.NpbStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkToNetworkInterconnectPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkToNetworkInterconnectProperties model = - BinaryData - .fromString( - "{\"nniType\":\"NPB\",\"isManagementType\":\"True\",\"useOptionB\":\"True\",\"layer2Configuration\":{\"mtu\":2042385624,\"interfaces\":[\"euuqutkzwtjw\",\"guzytijc\",\"fn\",\"ndegjdydhqkkkbj\"]},\"optionBLayer3Configuration\":{\"peerASN\":5255256923249406133,\"vlanId\":2088501182,\"fabricASN\":7222252540812701471,\"primaryIpv4Prefix\":\"owcnxtpz\",\"primaryIpv6Prefix\":\"yseidtoakatpryt\",\"secondaryIpv4Prefix\":\"hzbqfdpfawrptvcs\",\"secondaryIpv6Prefix\":\"kutzct\"},\"npbStaticRouteConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":2138287856,\"multiplier\":546852754},\"ipv4Routes\":[{\"prefix\":\"tzjgcfjfxtbwj\",\"nextHop\":[\"rmuydgfttmdofg\"]}],\"ipv6Routes\":[{\"prefix\":\"gfuo\",\"nextHop\":[\"nxodwxmdajwiyg\",\"gsevmdm\"]},{\"prefix\":\"enlrstgf\",\"nextHop\":[\"ljdncidtjvamy\",\"znmrgcdogcvucg\"]},{\"prefix\":\"to\",\"nextHop\":[\"whttnzqs\",\"qmebgszplusdekpd\",\"z\",\"ssgpgvo\"]}]},\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"jidbdqzsqunycwzt\",\"importIpv6RoutePolicyId\":\"vws\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"kkyjt\",\"exportIpv6RoutePolicyId\":\"pwpwfkcauxuva\"},\"egressAclId\":\"pfpdof\",\"ingressAclId\":\"kclbtxluevsol\",\"configurationState\":\"Deprovisioning\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"Disabled\"}") - .toObject(NetworkToNetworkInterconnectProperties.class); - Assertions.assertEquals(NniType.NPB, model.nniType()); - Assertions.assertEquals(IsManagementType.TRUE, model.isManagementType()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.useOptionB()); - Assertions.assertEquals(2042385624, model.layer2Configuration().mtu()); - Assertions.assertEquals("euuqutkzwtjw", model.layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("owcnxtpz", model.optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("yseidtoakatpryt", model.optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("hzbqfdpfawrptvcs", model.optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("kutzct", model.optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(5255256923249406133L, model.optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(2088501182, model.optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals(2138287856, model.npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(546852754, model.npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("tzjgcfjfxtbwj", model.npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals("rmuydgfttmdofg", model.npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("gfuo", model.npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions - .assertEquals("nxodwxmdajwiyg", model.npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("jidbdqzsqunycwzt", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("vws", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("kkyjt", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("pwpwfkcauxuva", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("pfpdof", model.egressAclId()); - Assertions.assertEquals("kclbtxluevsol", model.ingressAclId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkToNetworkInterconnectProperties model = - new NetworkToNetworkInterconnectProperties() - .withNniType(NniType.NPB) - .withIsManagementType(IsManagementType.TRUE) - .withUseOptionB(BooleanEnumProperty.TRUE) - .withLayer2Configuration( - new Layer2Configuration() - .withMtu(2042385624) - .withInterfaces(Arrays.asList("euuqutkzwtjw", "guzytijc", "fn", "ndegjdydhqkkkbj"))) - .withOptionBLayer3Configuration( - new NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration() - .withPrimaryIpv4Prefix("owcnxtpz") - .withPrimaryIpv6Prefix("yseidtoakatpryt") - .withSecondaryIpv4Prefix("hzbqfdpfawrptvcs") - .withSecondaryIpv6Prefix("kutzct") - .withPeerAsn(5255256923249406133L) - .withVlanId(2088501182)) - .withNpbStaticRouteConfiguration( - new NpbStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(2138287856).withMultiplier(546852754)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("tzjgcfjfxtbwj") - .withNextHop(Arrays.asList("rmuydgfttmdofg")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("gfuo") - .withNextHop(Arrays.asList("nxodwxmdajwiyg", "gsevmdm")), - new StaticRouteProperties() - .withPrefix("enlrstgf") - .withNextHop(Arrays.asList("ljdncidtjvamy", "znmrgcdogcvucg")), - new StaticRouteProperties() - .withPrefix("to") - .withNextHop(Arrays.asList("whttnzqs", "qmebgszplusdekpd", "z", "ssgpgvo"))))) - .withImportRoutePolicy( - new ImportRoutePolicyInformation() - .withImportIpv4RoutePolicyId("jidbdqzsqunycwzt") - .withImportIpv6RoutePolicyId("vws")) - .withExportRoutePolicy( - new ExportRoutePolicyInformation() - .withExportIpv4RoutePolicyId("kkyjt") - .withExportIpv6RoutePolicyId("pwpwfkcauxuva")) - .withEgressAclId("pfpdof") - .withIngressAclId("kclbtxluevsol"); - model = BinaryData.fromObject(model).toObject(NetworkToNetworkInterconnectProperties.class); - Assertions.assertEquals(NniType.NPB, model.nniType()); - Assertions.assertEquals(IsManagementType.TRUE, model.isManagementType()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.useOptionB()); - Assertions.assertEquals(2042385624, model.layer2Configuration().mtu()); - Assertions.assertEquals("euuqutkzwtjw", model.layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("owcnxtpz", model.optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("yseidtoakatpryt", model.optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("hzbqfdpfawrptvcs", model.optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("kutzct", model.optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(5255256923249406133L, model.optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(2088501182, model.optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals(2138287856, model.npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(546852754, model.npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("tzjgcfjfxtbwj", model.npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals("rmuydgfttmdofg", model.npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("gfuo", model.npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions - .assertEquals("nxodwxmdajwiyg", model.npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("jidbdqzsqunycwzt", model.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("vws", model.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("kkyjt", model.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("pwpwfkcauxuva", model.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("pfpdof", model.egressAclId()); - Assertions.assertEquals("kclbtxluevsol", model.ingressAclId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsCreateMockTests.java deleted file mode 100644 index da4719d9aa54..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsCreateMockTests.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.IsManagementType; -import com.azure.resourcemanager.managednetworkfabric.models.Layer2Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnect; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.NniType; -import com.azure.resourcemanager.managednetworkfabric.models.NpbStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -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 NetworkToNetworkInterconnectsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"nniType\":\"NPB\",\"isManagementType\":\"True\",\"useOptionB\":\"False\",\"layer2Configuration\":{\"mtu\":1968483512,\"interfaces\":[\"jteqlujmmkn\"]},\"optionBLayer3Configuration\":{\"peerASN\":4438901580001692200,\"vlanId\":924454791,\"fabricASN\":6960325120499186636,\"primaryIpv4Prefix\":\"ztasflgme\",\"primaryIpv6Prefix\":\"eohlerptjwvzap\",\"secondaryIpv4Prefix\":\"deeagigbpabacpl\",\"secondaryIpv6Prefix\":\"rjr\"},\"npbStaticRouteConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":2014985311,\"multiplier\":14274432},\"ipv4Routes\":[{\"prefix\":\"zlxlbdu\",\"nextHop\":[\"d\",\"qeyqrlgpkypb\",\"kpardo\",\"dtedxz\"]},{\"prefix\":\"yhbzmgzsyt\",\"nextHop\":[\"fslrxvsqsbqrqb\",\"iqfstkd\"]},{\"prefix\":\"yjzijxefyd\",\"nextHop\":[\"ffkzlchrkiwp\"]},{\"prefix\":\"dnhflxnnitru\",\"nextHop\":[\"tfrdlfewexbrvb\",\"yriyraybi\",\"ksnijclfdprez\"]}],\"ipv6Routes\":[{\"prefix\":\"xeigyddp\",\"nextHop\":[\"mbxerz\"]},{\"prefix\":\"pcr\",\"nextHop\":[\"wvcnmrbizxqldm\",\"zbcujdz\"]}]},\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"ermjemnyuhoqpbf\",\"importIpv6RoutePolicyId\":\"cbweab\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"mkuquvcgvn\",\"exportIpv6RoutePolicyId\":\"lcldoyohu\"},\"egressAclId\":\"uclopn\",\"ingressAclId\":\"sylwsmdo\",\"configurationState\":\"Rejected\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"RMA\"},\"id\":\"bgbhtpo\",\"name\":\"iustkqywab\",\"type\":\"lgrrsk\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkToNetworkInterconnect response = - manager - .networkToNetworkInterconnects() - .define("tvucyackgkavpmgt") - .withExistingNetworkFabric("djeepukuofz", "i") - .withUseOptionB(BooleanEnumProperty.TRUE) - .withNniType(NniType.NPB) - .withIsManagementType(IsManagementType.TRUE) - .withLayer2Configuration( - new Layer2Configuration() - .withMtu(398547649) - .withInterfaces(Arrays.asList("kpcesmurj", "bpnxohagcoj", "my"))) - .withOptionBLayer3Configuration( - new NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration() - .withPrimaryIpv4Prefix("gd") - .withPrimaryIpv6Prefix("b") - .withSecondaryIpv4Prefix("iweyuigyzsebk") - .withSecondaryIpv6Prefix("ykg") - .withPeerAsn(8015179779925025737L) - .withVlanId(1032326080)) - .withNpbStaticRouteConfiguration( - new NpbStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1164527855).withMultiplier(1602290007)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("unypfkvjg") - .withNextHop(Arrays.asList("bbncjxrwaqgmztlr", "b")), - new StaticRouteProperties() - .withPrefix("kwoupmqffgjsqq") - .withNextHop(Arrays.asList("irooglwujobdq", "uppavqo")), - new StaticRouteProperties() - .withPrefix("ijpmegnkrv") - .withNextHop(Arrays.asList("bibtrwg")), - new StaticRouteProperties() - .withPrefix("jfat") - .withNextHop(Arrays.asList("dxqhje", "hg", "myomjeflgnieeq")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("xxxnnduxkepga") - .withNextHop(Arrays.asList("ijbiterqfuterrca", "l", "fqddwwpgc"))))) - .withImportRoutePolicy( - new ImportRoutePolicyInformation() - .withImportIpv4RoutePolicyId("upqkvmyguee") - .withImportIpv6RoutePolicyId("xzwvcvtjdq")) - .withExportRoutePolicy( - new ExportRoutePolicyInformation() - .withExportIpv4RoutePolicyId("wxjafb") - .withExportIpv6RoutePolicyId("p")) - .withEgressAclId("zdbjzxrpx") - .withIngressAclId("raupirvdonka") - .create(); - - Assertions.assertEquals(NniType.NPB, response.nniType()); - Assertions.assertEquals(IsManagementType.TRUE, response.isManagementType()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, response.useOptionB()); - Assertions.assertEquals(1968483512, response.layer2Configuration().mtu()); - Assertions.assertEquals("jteqlujmmkn", response.layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("ztasflgme", response.optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("eohlerptjwvzap", response.optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("deeagigbpabacpl", response.optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("rjr", response.optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(4438901580001692200L, response.optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(924454791, response.optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals( - 2014985311, response.npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(14274432, response.npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("zlxlbdu", response.npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions.assertEquals("d", response.npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("xeigyddp", response.npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("mbxerz", response.npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("ermjemnyuhoqpbf", response.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("cbweab", response.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("mkuquvcgvn", response.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("lcldoyohu", response.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("uclopn", response.egressAclId()); - Assertions.assertEquals("sylwsmdo", response.ingressAclId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsGetWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsGetWithResponseMockTests.java deleted file mode 100644 index d3d0d1b82a30..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsGetWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.IsManagementType; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnect; -import com.azure.resourcemanager.managednetworkfabric.models.NniType; -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 NetworkToNetworkInterconnectsGetWithResponseMockTests { - @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\":{\"nniType\":\"CE\",\"isManagementType\":\"True\",\"useOptionB\":\"False\",\"layer2Configuration\":{\"mtu\":636448224,\"interfaces\":[\"kqv\",\"agnzbkq\",\"bjcdaucso\"]},\"optionBLayer3Configuration\":{\"peerASN\":369336413528690652,\"vlanId\":1458285945,\"fabricASN\":2020115413491199381,\"primaryIpv4Prefix\":\"uepanqdmm\",\"primaryIpv6Prefix\":\"dpgtblmxblc\",\"secondaryIpv4Prefix\":\"v\",\"secondaryIpv6Prefix\":\"peavlcbbulepcgir\"},\"npbStaticRouteConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":1319018236,\"multiplier\":817323597},\"ipv4Routes\":[{\"prefix\":\"xjvipehxlbbur\",\"nextHop\":[\"ovgjipbnnghs\",\"xwjnwgoxenhpyix\",\"brsaeuzsojblyygf\",\"icuydrswq\"]},{\"prefix\":\"teuyqtzo\",\"nextHop\":[\"otrbnvoe\",\"httoqoafdvxrl\",\"srfrxylmdjp\"]},{\"prefix\":\"pipkpcvhqadjca\",\"nextHop\":[\"cgq\",\"ixuqvat\"]}],\"ipv6Routes\":[{\"prefix\":\"voivcktjsc\",\"nextHop\":[\"exybxyrcjgptx\",\"zhyunwmbf\",\"js\"]}]},\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"lwmfudpntps\",\"importIpv6RoutePolicyId\":\"mfktytri\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"eqvefnzvhmiwba\",\"exportIpv6RoutePolicyId\":\"zxcmsceza\"},\"egressAclId\":\"y\",\"ingressAclId\":\"hvt\",\"configurationState\":\"ErrorDeprovisioning\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"Enabled\"},\"id\":\"dxebdhmxbyzfjgre\",\"name\":\"brbmcrtvxjwpvqre\",\"type\":\"luipalqwbrfiovp\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkToNetworkInterconnect response = - manager - .networkToNetworkInterconnects() - .getWithResponse("hkphfzg", "kucwmjmgs", "twmskuqg", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(NniType.CE, response.nniType()); - Assertions.assertEquals(IsManagementType.TRUE, response.isManagementType()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, response.useOptionB()); - Assertions.assertEquals(636448224, response.layer2Configuration().mtu()); - Assertions.assertEquals("kqv", response.layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("uepanqdmm", response.optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("dpgtblmxblc", response.optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("v", response.optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("peavlcbbulepcgir", response.optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(369336413528690652L, response.optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(1458285945, response.optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals( - 1319018236, response.npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(817323597, response.npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("xjvipehxlbbur", response.npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals("ovgjipbnnghs", response.npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("voivcktjsc", response.npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions - .assertEquals("exybxyrcjgptx", response.npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("lwmfudpntps", response.importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("mfktytri", response.importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("eqvefnzvhmiwba", response.exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("zxcmsceza", response.exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("y", response.egressAclId()); - Assertions.assertEquals("hvt", response.ingressAclId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsListByNetworkFabricMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsListByNetworkFabricMockTests.java deleted file mode 100644 index 127bd4c3f088..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsListByNetworkFabricMockTests.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.IsManagementType; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnect; -import com.azure.resourcemanager.managednetworkfabric.models.NniType; -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 NetworkToNetworkInterconnectsListByNetworkFabricMockTests { - @Test - public void testListByNetworkFabric() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"nniType\":\"CE\",\"isManagementType\":\"True\",\"useOptionB\":\"False\",\"layer2Configuration\":{\"mtu\":1077230266,\"interfaces\":[\"dswpvnloopzy\"]},\"optionBLayer3Configuration\":{\"peerASN\":4121931377231335621,\"vlanId\":1850901066,\"fabricASN\":1363288151308393494,\"primaryIpv4Prefix\":\"jlfqzcklvvwv\",\"primaryIpv6Prefix\":\"qtp\",\"secondaryIpv4Prefix\":\"hmlnfvyhdhffn\",\"secondaryIpv6Prefix\":\"mhawbxnlkmazhlew\"},\"npbStaticRouteConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":215443384,\"multiplier\":66450889},\"ipv4Routes\":[{\"prefix\":\"zipyqtm\",\"nextHop\":[\"bctkgmwxz\",\"phzujkqa\",\"bejhxopehel\",\"sykhdapxdiibjj\"]},{\"prefix\":\"uekhh\",\"nextHop\":[\"hxhuhhnrmmfzfkh\"]},{\"prefix\":\"nzjff\",\"nextHop\":[\"htvbskgciedl\",\"vpdtrlsmsr\",\"lfgbu\",\"gchjtpszcawf\"]},{\"prefix\":\"pny\",\"nextHop\":[\"uivrjse\",\"auzrpespebie\",\"zxrusafvflyqau\",\"ohskimn\"]}],\"ipv6Routes\":[{\"prefix\":\"vlqmnwhdhoyvpd\",\"nextHop\":[\"aplpdzriettnm\",\"ufpbfqmlmbyqyek\",\"w\",\"dxz\"]}]},\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"u\",\"importIpv6RoutePolicyId\":\"dogrtfwzecgbx\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"evqjdxiiqwqbvanv\",\"exportIpv6RoutePolicyId\":\"xnaaiitnkruyw\"},\"egressAclId\":\"nksmaebdrxj\",\"ingressAclId\":\"rsea\",\"configurationState\":\"Failed\",\"provisioningState\":\"Accepted\",\"administrativeState\":\"Disabled\"},\"id\":\"rqwfuxntuegy\",\"name\":\"leketk\",\"type\":\"iptqhatfg\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .networkToNetworkInterconnects() - .listByNetworkFabric("ltjdrfiwe", "l", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(NniType.CE, response.iterator().next().nniType()); - Assertions.assertEquals(IsManagementType.TRUE, response.iterator().next().isManagementType()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, response.iterator().next().useOptionB()); - Assertions.assertEquals(1077230266, response.iterator().next().layer2Configuration().mtu()); - Assertions.assertEquals("dswpvnloopzy", response.iterator().next().layer2Configuration().interfaces().get(0)); - Assertions - .assertEquals("jlfqzcklvvwv", response.iterator().next().optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("qtp", response.iterator().next().optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions - .assertEquals( - "hmlnfvyhdhffn", response.iterator().next().optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions - .assertEquals( - "mhawbxnlkmazhlew", response.iterator().next().optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions - .assertEquals(4121931377231335621L, response.iterator().next().optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(1850901066, response.iterator().next().optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals( - 215443384, - response.iterator().next().npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 66450889, response.iterator().next().npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions - .assertEquals( - "zipyqtm", response.iterator().next().npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals( - "bctkgmwxz", - response.iterator().next().npbStaticRouteConfiguration().ipv4Routes().get(0).nextHop().get(0)); - Assertions - .assertEquals( - "vlqmnwhdhoyvpd", - response.iterator().next().npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions - .assertEquals( - "aplpdzriettnm", - response.iterator().next().npbStaticRouteConfiguration().ipv6Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("u", response.iterator().next().importRoutePolicy().importIpv4RoutePolicyId()); - Assertions - .assertEquals("dogrtfwzecgbx", response.iterator().next().importRoutePolicy().importIpv6RoutePolicyId()); - Assertions - .assertEquals("evqjdxiiqwqbvanv", response.iterator().next().exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions - .assertEquals("xnaaiitnkruyw", response.iterator().next().exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("nksmaebdrxj", response.iterator().next().egressAclId()); - Assertions.assertEquals("rsea", response.iterator().next().ingressAclId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsListTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsListTests.java deleted file mode 100644 index 24c6933b2422..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsListTests.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.ExportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.ImportRoutePolicyInformation; -import com.azure.resourcemanager.managednetworkfabric.models.IsManagementType; -import com.azure.resourcemanager.managednetworkfabric.models.Layer2Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration; -import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectsList; -import com.azure.resourcemanager.managednetworkfabric.models.NniType; -import com.azure.resourcemanager.managednetworkfabric.models.NpbStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkToNetworkInterconnectsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkToNetworkInterconnectsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"nniType\":\"NPB\",\"isManagementType\":\"False\",\"useOptionB\":\"True\",\"layer2Configuration\":{\"mtu\":1585075235,\"interfaces\":[\"qliwkmzojf\",\"tyalh\",\"gmknazgbjbh\"]},\"optionBLayer3Configuration\":{\"peerASN\":5190256841350116865,\"vlanId\":1926341544,\"fabricASN\":6522593639815273596,\"primaryIpv4Prefix\":\"rcmmaixpqj\",\"primaryIpv6Prefix\":\"ifhb\",\"secondaryIpv4Prefix\":\"ldtt\",\"secondaryIpv6Prefix\":\"qclnaihtg\"},\"npbStaticRouteConfiguration\":{\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":490136887,\"multiplier\":1889026122},\"ipv4Routes\":[{\"prefix\":\"p\",\"nextHop\":[]},{\"prefix\":\"glxkoikmtrawrqk\",\"nextHop\":[]},{\"prefix\":\"awbunmpaklw\",\"nextHop\":[]},{\"prefix\":\"lweeprne\",\"nextHop\":[]}],\"ipv6Routes\":[{\"prefix\":\"tkaszfjsxscbdu\",\"nextHop\":[]}]},\"importRoutePolicy\":{\"importIpv4RoutePolicyId\":\"grcqebmvrdj\",\"importIpv6RoutePolicyId\":\"lnwsbvvdlsf\"},\"exportRoutePolicy\":{\"exportIpv4RoutePolicyId\":\"qe\",\"exportIpv6RoutePolicyId\":\"fedsbgz\"},\"egressAclId\":\"coinmphymcqi\",\"ingressAclId\":\"ltvdhqnufbx\",\"configurationState\":\"Rejected\",\"provisioningState\":\"Failed\",\"administrativeState\":\"Enabled\"},\"id\":\"ojovfnybydh\",\"name\":\"ihaouwudhua\",\"type\":\"rhjkehw\"}],\"nextLink\":\"mosqircamqprlob\"}") - .toObject(NetworkToNetworkInterconnectsList.class); - Assertions.assertEquals(NniType.NPB, model.value().get(0).nniType()); - Assertions.assertEquals(IsManagementType.FALSE, model.value().get(0).isManagementType()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.value().get(0).useOptionB()); - Assertions.assertEquals(1585075235, model.value().get(0).layer2Configuration().mtu()); - Assertions.assertEquals("qliwkmzojf", model.value().get(0).layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("rcmmaixpqj", model.value().get(0).optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("ifhb", model.value().get(0).optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("ldtt", model.value().get(0).optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("qclnaihtg", model.value().get(0).optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(5190256841350116865L, model.value().get(0).optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(1926341544, model.value().get(0).optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals( - 490136887, - model.value().get(0).npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 1889026122, model.value().get(0).npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("p", model.value().get(0).npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals( - "tkaszfjsxscbdu", model.value().get(0).npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("grcqebmvrdj", model.value().get(0).importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("lnwsbvvdlsf", model.value().get(0).importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("qe", model.value().get(0).exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("fedsbgz", model.value().get(0).exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("coinmphymcqi", model.value().get(0).egressAclId()); - Assertions.assertEquals("ltvdhqnufbx", model.value().get(0).ingressAclId()); - Assertions.assertEquals("mosqircamqprlob", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkToNetworkInterconnectsList model = - new NetworkToNetworkInterconnectsList() - .withValue( - Arrays - .asList( - new NetworkToNetworkInterconnectInner() - .withNniType(NniType.NPB) - .withIsManagementType(IsManagementType.FALSE) - .withUseOptionB(BooleanEnumProperty.TRUE) - .withLayer2Configuration( - new Layer2Configuration() - .withMtu(1585075235) - .withInterfaces(Arrays.asList("qliwkmzojf", "tyalh", "gmknazgbjbh"))) - .withOptionBLayer3Configuration( - new NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration() - .withPrimaryIpv4Prefix("rcmmaixpqj") - .withPrimaryIpv6Prefix("ifhb") - .withSecondaryIpv4Prefix("ldtt") - .withSecondaryIpv6Prefix("qclnaihtg") - .withPeerAsn(5190256841350116865L) - .withVlanId(1926341544)) - .withNpbStaticRouteConfiguration( - new NpbStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration() - .withIntervalInMilliSeconds(490136887) - .withMultiplier(1889026122)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("p") - .withNextHop(Arrays.asList()), - new StaticRouteProperties() - .withPrefix("glxkoikmtrawrqk") - .withNextHop(Arrays.asList()), - new StaticRouteProperties() - .withPrefix("awbunmpaklw") - .withNextHop(Arrays.asList()), - new StaticRouteProperties() - .withPrefix("lweeprne") - .withNextHop(Arrays.asList()))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("tkaszfjsxscbdu") - .withNextHop(Arrays.asList())))) - .withImportRoutePolicy( - new ImportRoutePolicyInformation() - .withImportIpv4RoutePolicyId("grcqebmvrdj") - .withImportIpv6RoutePolicyId("lnwsbvvdlsf")) - .withExportRoutePolicy( - new ExportRoutePolicyInformation() - .withExportIpv4RoutePolicyId("qe") - .withExportIpv6RoutePolicyId("fedsbgz")) - .withEgressAclId("coinmphymcqi") - .withIngressAclId("ltvdhqnufbx"))) - .withNextLink("mosqircamqprlob"); - model = BinaryData.fromObject(model).toObject(NetworkToNetworkInterconnectsList.class); - Assertions.assertEquals(NniType.NPB, model.value().get(0).nniType()); - Assertions.assertEquals(IsManagementType.FALSE, model.value().get(0).isManagementType()); - Assertions.assertEquals(BooleanEnumProperty.TRUE, model.value().get(0).useOptionB()); - Assertions.assertEquals(1585075235, model.value().get(0).layer2Configuration().mtu()); - Assertions.assertEquals("qliwkmzojf", model.value().get(0).layer2Configuration().interfaces().get(0)); - Assertions.assertEquals("rcmmaixpqj", model.value().get(0).optionBLayer3Configuration().primaryIpv4Prefix()); - Assertions.assertEquals("ifhb", model.value().get(0).optionBLayer3Configuration().primaryIpv6Prefix()); - Assertions.assertEquals("ldtt", model.value().get(0).optionBLayer3Configuration().secondaryIpv4Prefix()); - Assertions.assertEquals("qclnaihtg", model.value().get(0).optionBLayer3Configuration().secondaryIpv6Prefix()); - Assertions.assertEquals(5190256841350116865L, model.value().get(0).optionBLayer3Configuration().peerAsn()); - Assertions.assertEquals(1926341544, model.value().get(0).optionBLayer3Configuration().vlanId()); - Assertions - .assertEquals( - 490136887, - model.value().get(0).npbStaticRouteConfiguration().bfdConfiguration().intervalInMilliSeconds()); - Assertions - .assertEquals( - 1889026122, model.value().get(0).npbStaticRouteConfiguration().bfdConfiguration().multiplier()); - Assertions.assertEquals("p", model.value().get(0).npbStaticRouteConfiguration().ipv4Routes().get(0).prefix()); - Assertions - .assertEquals( - "tkaszfjsxscbdu", model.value().get(0).npbStaticRouteConfiguration().ipv6Routes().get(0).prefix()); - Assertions.assertEquals("grcqebmvrdj", model.value().get(0).importRoutePolicy().importIpv4RoutePolicyId()); - Assertions.assertEquals("lnwsbvvdlsf", model.value().get(0).importRoutePolicy().importIpv6RoutePolicyId()); - Assertions.assertEquals("qe", model.value().get(0).exportRoutePolicy().exportIpv4RoutePolicyId()); - Assertions.assertEquals("fedsbgz", model.value().get(0).exportRoutePolicy().exportIpv6RoutePolicyId()); - Assertions.assertEquals("coinmphymcqi", model.value().get(0).egressAclId()); - Assertions.assertEquals("ltvdhqnufbx", model.value().get(0).ingressAclId()); - Assertions.assertEquals("mosqircamqprlob", model.nextLink()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateAdministrativeStateMockTests.java deleted file mode 100644 index 38743bcfcc48..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NetworkToNetworkInterconnectsUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Failed\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager - .networkToNetworkInterconnects() - .updateAdministrativeState( - "il", - "dxcmpdmdsypks", - "rhiehxjou", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("becxuvkbao", "v", "yhgpgjd")) - .withState(EnableDisableState.ENABLE), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NpbStaticRouteConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NpbStaticRouteConfigurationTests.java deleted file mode 100644 index f0c4db8b5e19..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/NpbStaticRouteConfigurationTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.NpbStaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NpbStaticRouteConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NpbStaticRouteConfiguration model = - BinaryData - .fromString( - "{\"bfdConfiguration\":{\"administrativeState\":\"Enabled\",\"intervalInMilliSeconds\":171013724,\"multiplier\":1206192752},\"ipv4Routes\":[{\"prefix\":\"b\",\"nextHop\":[\"bispglqjoxtdah\",\"eaoo\"]}],\"ipv6Routes\":[{\"prefix\":\"jztivfwjlofzek\",\"nextHop\":[\"rmauklaj\",\"cfocz\"]}]}") - .toObject(NpbStaticRouteConfiguration.class); - Assertions.assertEquals(171013724, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1206192752, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("b", model.ipv4Routes().get(0).prefix()); - Assertions.assertEquals("bispglqjoxtdah", model.ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("jztivfwjlofzek", model.ipv6Routes().get(0).prefix()); - Assertions.assertEquals("rmauklaj", model.ipv6Routes().get(0).nextHop().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NpbStaticRouteConfiguration model = - new NpbStaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(171013724).withMultiplier(1206192752)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("b") - .withNextHop(Arrays.asList("bispglqjoxtdah", "eaoo")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("jztivfwjlofzek") - .withNextHop(Arrays.asList("rmauklaj", "cfocz")))); - model = BinaryData.fromObject(model).toObject(NpbStaticRouteConfiguration.class); - Assertions.assertEquals(171013724, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(1206192752, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("b", model.ipv4Routes().get(0).prefix()); - Assertions.assertEquals("bispglqjoxtdah", model.ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("jztivfwjlofzek", model.ipv6Routes().get(0).prefix()); - Assertions.assertEquals("rmauklaj", model.ipv6Routes().get(0).nextHop().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationDisplayTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationDisplayTests.java deleted file mode 100644 index 8d752b54aa31..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationDisplayTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"dlpxiwwgecpvfp\",\"resource\":\"zikvoxloeo\",\"operation\":\"fivxdifb\",\"description\":\"lijhpxukx\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationInnerTests.java deleted file mode 100644 index 324523069b73..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationInnerTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.OperationInner; -import com.azure.resourcemanager.managednetworkfabric.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"flewgsltutbuve\",\"isDataAction\":false,\"display\":{\"provider\":\"bmenxcqs\",\"resource\":\"clykcrudekkbnjre\",\"operation\":\"ptedeuenthshnfi\",\"description\":\"pgpkkhpjnglaqlm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationListResultTests.java deleted file mode 100644 index bcda4e7ce421..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationListResultTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"bnmcvaqycd\",\"isDataAction\":true,\"display\":{\"provider\":\"esdyvf\",\"resource\":\"z\",\"operation\":\"df\",\"description\":\"ktwpd\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"ytabvb\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationsListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationsListMockTests.java deleted file mode 100644 index 1743f1f3e96b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.Operation; -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 OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"qmchlhzngmwem\",\"isDataAction\":true,\"display\":{\"provider\":\"js\",\"resource\":\"bagccvhn\",\"operation\":\"lowep\",\"description\":\"tqoszrwkkxd\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .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); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OptionAPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OptionAPropertiesTests.java deleted file mode 100644 index dc6f597c3c86..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OptionAPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.OptionAProperties; -import org.junit.jupiter.api.Assertions; - -public final class OptionAPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OptionAProperties model = - BinaryData - .fromString( - "{\"mtu\":341229695,\"vlanId\":1997920691,\"peerASN\":5808363193481084491,\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":946572249,\"multiplier\":716093008}}") - .toObject(OptionAProperties.class); - Assertions.assertEquals(341229695, model.mtu()); - Assertions.assertEquals(1997920691, model.vlanId()); - Assertions.assertEquals(5808363193481084491L, model.peerAsn()); - Assertions.assertEquals(946572249, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(716093008, model.bfdConfiguration().multiplier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OptionAProperties model = - new OptionAProperties() - .withMtu(341229695) - .withVlanId(1997920691) - .withPeerAsn(5808363193481084491L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(946572249).withMultiplier(716093008)); - model = BinaryData.fromObject(model).toObject(OptionAProperties.class); - Assertions.assertEquals(341229695, model.mtu()); - Assertions.assertEquals(1997920691, model.vlanId()); - Assertions.assertEquals(5808363193481084491L, model.peerAsn()); - Assertions.assertEquals(946572249, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(716093008, model.bfdConfiguration().multiplier()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OptionBLayer3ConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OptionBLayer3ConfigurationTests.java deleted file mode 100644 index 997730c71aa6..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OptionBLayer3ConfigurationTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.OptionBLayer3Configuration; -import org.junit.jupiter.api.Assertions; - -public final class OptionBLayer3ConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OptionBLayer3Configuration model = - BinaryData - .fromString( - "{\"peerASN\":8546706426959520217,\"vlanId\":105550555,\"fabricASN\":9182440334932785567,\"primaryIpv4Prefix\":\"zpvxak\",\"primaryIpv6Prefix\":\"hpsesrf\",\"secondaryIpv4Prefix\":\"mqiydvxcgdh\",\"secondaryIpv6Prefix\":\"goqg\"}") - .toObject(OptionBLayer3Configuration.class); - Assertions.assertEquals("zpvxak", model.primaryIpv4Prefix()); - Assertions.assertEquals("hpsesrf", model.primaryIpv6Prefix()); - Assertions.assertEquals("mqiydvxcgdh", model.secondaryIpv4Prefix()); - Assertions.assertEquals("goqg", model.secondaryIpv6Prefix()); - Assertions.assertEquals(8546706426959520217L, model.peerAsn()); - Assertions.assertEquals(105550555, model.vlanId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OptionBLayer3Configuration model = - new OptionBLayer3Configuration() - .withPrimaryIpv4Prefix("zpvxak") - .withPrimaryIpv6Prefix("hpsesrf") - .withSecondaryIpv4Prefix("mqiydvxcgdh") - .withSecondaryIpv6Prefix("goqg") - .withPeerAsn(8546706426959520217L) - .withVlanId(105550555); - model = BinaryData.fromObject(model).toObject(OptionBLayer3Configuration.class); - Assertions.assertEquals("zpvxak", model.primaryIpv4Prefix()); - Assertions.assertEquals("hpsesrf", model.primaryIpv6Prefix()); - Assertions.assertEquals("mqiydvxcgdh", model.secondaryIpv4Prefix()); - Assertions.assertEquals("goqg", model.secondaryIpv6Prefix()); - Assertions.assertEquals(8546706426959520217L, model.peerAsn()); - Assertions.assertEquals(105550555, model.vlanId()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OptionBPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OptionBPropertiesTests.java deleted file mode 100644 index dab67b39385b..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/OptionBPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OptionBPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OptionBProperties model = - BinaryData - .fromString( - "{\"importRouteTargets\":[\"bjrmvgo\",\"plehmumk\",\"dllc\",\"dpr\"],\"exportRouteTargets\":[\"kgqggoxsstcivrak\",\"rrynjcwmhly\",\"gnukxrkemjpe\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"lzaudg\",\"tfbclakkuc\"],\"importIpv6RouteTargets\":[\"nhczbutoucgjt\",\"rjwayhicqq\",\"wvgwkslvli\"],\"exportIpv4RouteTargets\":[\"vbia\",\"v\",\"srgekzyqxadyfhb\"],\"exportIpv6RouteTargets\":[\"hojqttbspvkhg\",\"aqjsgyzstujr\",\"xrk\"]}}") - .toObject(OptionBProperties.class); - Assertions.assertEquals("bjrmvgo", model.importRouteTargets().get(0)); - Assertions.assertEquals("kgqggoxsstcivrak", model.exportRouteTargets().get(0)); - Assertions.assertEquals("lzaudg", model.routeTargets().importIpv4RouteTargets().get(0)); - Assertions.assertEquals("nhczbutoucgjt", model.routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("vbia", model.routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("hojqttbspvkhg", model.routeTargets().exportIpv6RouteTargets().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OptionBProperties model = - new OptionBProperties() - .withImportRouteTargets(Arrays.asList("bjrmvgo", "plehmumk", "dllc", "dpr")) - .withExportRouteTargets(Arrays.asList("kgqggoxsstcivrak", "rrynjcwmhly", "gnukxrkemjpe")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("lzaudg", "tfbclakkuc")) - .withImportIpv6RouteTargets(Arrays.asList("nhczbutoucgjt", "rjwayhicqq", "wvgwkslvli")) - .withExportIpv4RouteTargets(Arrays.asList("vbia", "v", "srgekzyqxadyfhb")) - .withExportIpv6RouteTargets(Arrays.asList("hojqttbspvkhg", "aqjsgyzstujr", "xrk"))); - model = BinaryData.fromObject(model).toObject(OptionBProperties.class); - Assertions.assertEquals("bjrmvgo", model.importRouteTargets().get(0)); - Assertions.assertEquals("kgqggoxsstcivrak", model.exportRouteTargets().get(0)); - Assertions.assertEquals("lzaudg", model.routeTargets().importIpv4RouteTargets().get(0)); - Assertions.assertEquals("nhczbutoucgjt", model.routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("vbia", model.routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("hojqttbspvkhg", model.routeTargets().exportIpv6RouteTargets().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/PortConditionTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/PortConditionTests.java deleted file mode 100644 index b84bb8dc4231..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/PortConditionTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.Layer4Protocol; -import com.azure.resourcemanager.managednetworkfabric.models.PortCondition; -import com.azure.resourcemanager.managednetworkfabric.models.PortType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PortConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PortCondition model = - BinaryData - .fromString( - "{\"portType\":\"DestinationPort\",\"layer4Protocol\":\"TCP\",\"ports\":[\"zqdqxt\",\"jw\",\"nyfusfzsvtuikzh\"],\"portGroupNames\":[\"glcfhmlrqryxyn\",\"nzrdpsovwxz\",\"ptgoeiybbabp\",\"hv\"]}") - .toObject(PortCondition.class); - Assertions.assertEquals(PortType.DESTINATION_PORT, model.portType()); - Assertions.assertEquals(Layer4Protocol.TCP, model.layer4Protocol()); - Assertions.assertEquals("zqdqxt", model.ports().get(0)); - Assertions.assertEquals("glcfhmlrqryxyn", model.portGroupNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PortCondition model = - new PortCondition() - .withPortType(PortType.DESTINATION_PORT) - .withLayer4Protocol(Layer4Protocol.TCP) - .withPorts(Arrays.asList("zqdqxt", "jw", "nyfusfzsvtuikzh")) - .withPortGroupNames(Arrays.asList("glcfhmlrqryxyn", "nzrdpsovwxz", "ptgoeiybbabp", "hv")); - model = BinaryData.fromObject(model).toObject(PortCondition.class); - Assertions.assertEquals(PortType.DESTINATION_PORT, model.portType()); - Assertions.assertEquals(Layer4Protocol.TCP, model.layer4Protocol()); - Assertions.assertEquals("zqdqxt", model.ports().get(0)); - Assertions.assertEquals("glcfhmlrqryxyn", model.portGroupNames().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/PortGroupPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/PortGroupPropertiesTests.java deleted file mode 100644 index bc7cba64191c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/PortGroupPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.PortGroupProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PortGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PortGroupProperties model = - BinaryData - .fromString("{\"name\":\"jx\",\"ports\":[\"tf\",\"jgicgaao\",\"pttaqutd\",\"wemxswvruunzz\"]}") - .toObject(PortGroupProperties.class); - Assertions.assertEquals("jx", model.name()); - Assertions.assertEquals("tf", model.ports().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PortGroupProperties model = - new PortGroupProperties() - .withName("jx") - .withPorts(Arrays.asList("tf", "jgicgaao", "pttaqutd", "wemxswvruunzz")); - model = BinaryData.fromObject(model).toObject(PortGroupProperties.class); - Assertions.assertEquals("jx", model.name()); - Assertions.assertEquals("tf", model.ports().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RebootPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RebootPropertiesTests.java deleted file mode 100644 index 17de119e4412..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RebootPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.RebootProperties; -import com.azure.resourcemanager.managednetworkfabric.models.RebootType; -import org.junit.jupiter.api.Assertions; - -public final class RebootPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RebootProperties model = - BinaryData.fromString("{\"rebootType\":\"GracefulRebootWithoutZTP\"}").toObject(RebootProperties.class); - Assertions.assertEquals(RebootType.GRACEFUL_REBOOT_WITHOUT_ZTP, model.rebootType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RebootProperties model = new RebootProperties().withRebootType(RebootType.GRACEFUL_REBOOT_WITHOUT_ZTP); - model = BinaryData.fromObject(model).toObject(RebootProperties.class); - Assertions.assertEquals(RebootType.GRACEFUL_REBOOT_WITHOUT_ZTP, model.rebootType()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCommitConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCommitConfigurationMockTests.java deleted file mode 100644 index 4e53bc262a44..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCommitConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForStateUpdate; -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 RoutePoliciesCommitConfigurationMockTests { - @Test - public void testCommitConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Deprovisioned\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForStateUpdate response = - manager.routePolicies().commitConfiguration("bkr", "ryfnbxwxlhy", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateMockTests.java deleted file mode 100644 index b203bf501188..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateMockTests.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyConditionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementActionProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementConditionProperties; -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 RoutePoliciesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"networkFabricId\":\"gkhvpvbzmy\",\"addressFamilyType\":\"IPv6\",\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Succeeded\",\"administrativeState\":\"RMA\",\"statements\":[{\"sequenceNumber\":3193986094245889194,\"condition\":{\"type\":\"Or\",\"ipPrefixId\":\"fshhc\",\"ipExtendedCommunityIds\":[\"owyhxwhdyfgtwxm\",\"dbzfiacmwmceim\",\"hrfmcjjxxwzdwmju\",\"tnolziohdxyuk\"],\"ipCommunityIds\":[\"fwykrpojenpsff\",\"izefajgble\",\"xpeuahvxfn\",\"cevfbiekydk\"]},\"action\":{\"localPreference\":1106329074647285525,\"actionType\":\"Permit\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"ckvyrvdszriz\"},{\"sequenceNumber\":26122118259696772,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"zzxqtcgswmhzci\",\"ipExtendedCommunityIds\":[\"ykzyirj\",\"ingnfunhtzgxsyi\"],\"ipCommunityIds\":[\"pkudhjztbwzjbqzq\",\"bhznhqzdbzl\",\"dsb\",\"kvprk\"]},\"action\":{\"localPreference\":8963056537060707770,\"actionType\":\"Permit\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"nvgz\"},{\"sequenceNumber\":7480970655890049266,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"e\",\"ipExtendedCommunityIds\":[\"eiuexkpgrmwdwlr\",\"eplpfrecri\"],\"ipCommunityIds\":[\"bafdlsizaob\"]},\"action\":{\"localPreference\":9171526574092017386,\"actionType\":\"Deny\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"xsjsoxuuwuung\"},{\"sequenceNumber\":4504574406271934810,\"condition\":{\"type\":\"Or\",\"ipPrefixId\":\"cpquyi\",\"ipExtendedCommunityIds\":[\"ttvo\",\"wrp\",\"liemitmtkcqixg\"],\"ipCommunityIds\":[\"up\",\"vthuvupdsafqag\",\"wqumecqyianjmv\"]},\"action\":{\"localPreference\":3778582834538277996,\"actionType\":\"Permit\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"huxox\"}],\"annotation\":\"gzvzcfmwfogjrhmt\"},\"location\":\"nhjoclv\",\"tags\":{\"inpixhulfj\":\"tkrmptapyqees\"},\"id\":\"mwhvjbkwr\",\"name\":\"tflotjizviswix\",\"type\":\"vnw\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RoutePolicy response = - manager - .routePolicies() - .define("jufzlgujs") - .withRegion("hrhcfeqjkac") - .withExistingResourceGroup("othfyi") - .withNetworkFabricId("tghmnuzyycqsxyr") - .withTags(mapOf("hvfdosq", "nuckojqoxpw", "cptvkbcykntdzze", "doyqbpzxushmltih", "e", "rzpggs")) - .withAddressFamilyType(AddressFamilyType.IPV4) - .withStatements( - Arrays - .asList( - new RoutePolicyStatementProperties() - .withAnnotation("dl") - .withSequenceNumber(7174890691377290019L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("dm", "adcojfuvmj", "xwazyvib", "oe")) - .withType(RoutePolicyConditionType.AND) - .withIpPrefixId("ochpwwykfy") - .withIpExtendedCommunityIds(Arrays.asList("ztdckwqvckh"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(5925718008505778095L) - .withActionType(RoutePolicyActionType.CONTINUE) - .withIpCommunityProperties(new ActionIpCommunityProperties()) - .withIpExtendedCommunityProperties(new ActionIpExtendedCommunityProperties())), - new RoutePolicyStatementProperties() - .withAnnotation("lfqgfwonbtgpe") - .withSequenceNumber(3067219703660943619L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("tdgdfecju", "cyrwvoohmcw")) - .withType(RoutePolicyConditionType.AND) - .withIpPrefixId("pzrk") - .withIpExtendedCommunityIds(Arrays.asList("yhz", "qeoajnaotav", "m"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(8506325798623700416L) - .withActionType(RoutePolicyActionType.CONTINUE) - .withIpCommunityProperties(new ActionIpCommunityProperties()) - .withIpExtendedCommunityProperties(new ActionIpExtendedCommunityProperties())), - new RoutePolicyStatementProperties() - .withAnnotation("qgvmiproqpy") - .withSequenceNumber(816822279956247943L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds( - Arrays.asList("fgmeqhtngrxfq", "osewfbllegezvwu", "iisms", "g")) - .withType(RoutePolicyConditionType.OR) - .withIpPrefixId("eouftcj") - .withIpExtendedCommunityIds(Arrays.asList("hd", "omscwlcfcpzajg"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(7160010579473024737L) - .withActionType(RoutePolicyActionType.CONTINUE) - .withIpCommunityProperties(new ActionIpCommunityProperties()) - .withIpExtendedCommunityProperties(new ActionIpExtendedCommunityProperties())), - new RoutePolicyStatementProperties() - .withAnnotation("vspknxraidjeddn") - .withSequenceNumber(9128049046337611503L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("yxguykrpzpmwzpl")) - .withType(RoutePolicyConditionType.AND) - .withIpPrefixId("k") - .withIpExtendedCommunityIds( - Arrays.asList("qkmtwu", "qqqtmpgrzcil", "wedllpnoebolhy", "ohcjugduoggx"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(2213682021370389202L) - .withActionType(RoutePolicyActionType.DENY) - .withIpCommunityProperties(new ActionIpCommunityProperties()) - .withIpExtendedCommunityProperties(new ActionIpExtendedCommunityProperties())))) - .withAnnotation("n") - .create(); - - Assertions.assertEquals("nhjoclv", response.location()); - Assertions.assertEquals("tkrmptapyqees", response.tags().get("inpixhulfj")); - Assertions.assertEquals("gkhvpvbzmy", response.networkFabricId()); - Assertions.assertEquals(AddressFamilyType.IPV6, response.addressFamilyType()); - Assertions.assertEquals("ckvyrvdszriz", response.statements().get(0).annotation()); - Assertions.assertEquals(3193986094245889194L, response.statements().get(0).sequenceNumber()); - Assertions.assertEquals("fwykrpojenpsff", response.statements().get(0).condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.OR, response.statements().get(0).condition().type()); - Assertions.assertEquals("fshhc", response.statements().get(0).condition().ipPrefixId()); - Assertions - .assertEquals("owyhxwhdyfgtwxm", response.statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(1106329074647285525L, response.statements().get(0).action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.PERMIT, response.statements().get(0).action().actionType()); - Assertions.assertEquals("gzvzcfmwfogjrhmt", response.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesGetByResourceGroupWithResponseMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index bdcc14b3a0eb..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesGetByResourceGroupWithResponseMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyConditionType; -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 RoutePoliciesGetByResourceGroupWithResponseMockTests { - @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\":{\"networkFabricId\":\"c\",\"addressFamilyType\":\"IPv4\",\"configurationState\":\"Accepted\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"RMA\",\"statements\":[{\"sequenceNumber\":8478441101031024131,\"condition\":{\"type\":\"Or\",\"ipPrefixId\":\"gen\",\"ipExtendedCommunityIds\":[\"xffe\",\"cngjcdykkpnfvz\",\"vt\"],\"ipCommunityIds\":[\"nusqjjcwggj\",\"mlcbmhsfgax\"]},\"action\":{\"localPreference\":3703399213725371460,\"actionType\":\"Continue\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"szxnzjxvdnf\"},{\"sequenceNumber\":6913517984931682319,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"lw\",\"ipExtendedCommunityIds\":[\"z\",\"fxbiqwgm\",\"ynwaofnoiphwaedp\",\"gxjtuhid\"],\"ipCommunityIds\":[\"z\",\"mcqen\",\"jwadvfqrvtymn\",\"wjdmjdphtfpjrbn\"]},\"action\":{\"localPreference\":5341193954054496929,\"actionType\":\"Continue\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"ima\"},{\"sequenceNumber\":2795357146906080604,\"condition\":{\"type\":\"Or\",\"ipPrefixId\":\"epr\",\"ipExtendedCommunityIds\":[\"ktusrpjmevszbj\",\"qktokc\"],\"ipCommunityIds\":[\"mzb\",\"xxdxnhinn\"]},\"action\":{\"localPreference\":6659953453261740285,\"actionType\":\"Deny\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"x\"}],\"annotation\":\"jsfxxkg\"},\"location\":\"zznocrbtazopf\",\"tags\":{\"knppucfvx\":\"fmhm\",\"dumiuxxmrnt\":\"rmxcrhzecn\",\"jabzs\":\"hyjueddtkpysmal\"},\"id\":\"buzaxmkuthooaic\",\"name\":\"szcwwv\",\"type\":\"xvibivhjryppm\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RoutePolicy response = - manager - .routePolicies() - .getByResourceGroupWithResponse("gdoi", "d", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zznocrbtazopf", response.location()); - Assertions.assertEquals("fmhm", response.tags().get("knppucfvx")); - Assertions.assertEquals("c", response.networkFabricId()); - Assertions.assertEquals(AddressFamilyType.IPV4, response.addressFamilyType()); - Assertions.assertEquals("szxnzjxvdnf", response.statements().get(0).annotation()); - Assertions.assertEquals(8478441101031024131L, response.statements().get(0).sequenceNumber()); - Assertions.assertEquals("nusqjjcwggj", response.statements().get(0).condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.OR, response.statements().get(0).condition().type()); - Assertions.assertEquals("gen", response.statements().get(0).condition().ipPrefixId()); - Assertions.assertEquals("xffe", response.statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(3703399213725371460L, response.statements().get(0).action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.CONTINUE, response.statements().get(0).action().actionType()); - Assertions.assertEquals("jsfxxkg", response.annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListByResourceGroupMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListByResourceGroupMockTests.java deleted file mode 100644 index 118ac2d31bb5..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListByResourceGroupMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyConditionType; -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 RoutePoliciesListByResourceGroupMockTests { - @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\":{\"networkFabricId\":\"qfcorajdb\",\"addressFamilyType\":\"IPv6\",\"configurationState\":\"Failed\",\"provisioningState\":\"Failed\",\"administrativeState\":\"RMA\",\"statements\":[{\"sequenceNumber\":8939069278384047837,\"condition\":{\"type\":\"Or\",\"ipPrefixId\":\"vynhmb\",\"ipExtendedCommunityIds\":[\"fxfyzqrsu\"],\"ipCommunityIds\":[\"sudtb\"]},\"action\":{\"localPreference\":6839164776180374009,\"actionType\":\"Continue\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"lyedsormbvirnxey\"},{\"sequenceNumber\":3255422556816107564,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"yidecffjhizwqz\",\"ipExtendedCommunityIds\":[\"wjypioszczswhd\",\"lxppewtl\",\"swul\"],\"ipCommunityIds\":[\"fczwzrxvvbl\",\"npriyttiqdcjg\"]},\"action\":{\"localPreference\":3778611207800585693,\"actionType\":\"Permit\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"woetjrfruc\"}],\"annotation\":\"fwdxbpvbsibz\"},\"location\":\"deyo\",\"tags\":{\"ieshqielbk\":\"othtpaqmf\",\"mgud\":\"m\",\"ecuve\":\"y\",\"kkjvrrvj\":\"lcwdg\"},\"id\":\"hoehyir\",\"name\":\"vr\",\"type\":\"doxpvqpblqubfpe\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.routePolicies().listByResourceGroup("tqxqiqaefu", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("deyo", response.iterator().next().location()); - Assertions.assertEquals("othtpaqmf", response.iterator().next().tags().get("ieshqielbk")); - Assertions.assertEquals("qfcorajdb", response.iterator().next().networkFabricId()); - Assertions.assertEquals(AddressFamilyType.IPV6, response.iterator().next().addressFamilyType()); - Assertions.assertEquals("lyedsormbvirnxey", response.iterator().next().statements().get(0).annotation()); - Assertions.assertEquals(8939069278384047837L, response.iterator().next().statements().get(0).sequenceNumber()); - Assertions - .assertEquals("sudtb", response.iterator().next().statements().get(0).condition().ipCommunityIds().get(0)); - Assertions - .assertEquals( - RoutePolicyConditionType.OR, response.iterator().next().statements().get(0).condition().type()); - Assertions.assertEquals("vynhmb", response.iterator().next().statements().get(0).condition().ipPrefixId()); - Assertions - .assertEquals( - "fxfyzqrsu", - response.iterator().next().statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions - .assertEquals( - 6839164776180374009L, response.iterator().next().statements().get(0).action().localPreference()); - Assertions - .assertEquals( - RoutePolicyActionType.CONTINUE, response.iterator().next().statements().get(0).action().actionType()); - Assertions.assertEquals("fwdxbpvbsibz", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListMockTests.java deleted file mode 100644 index 0d3c0ab35e2c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyConditionType; -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 RoutePoliciesListMockTests { - @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\":{\"networkFabricId\":\"megynheamzlqvaj\",\"addressFamilyType\":\"IPv4\",\"configurationState\":\"DeferredControl\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"RMA\",\"statements\":[{\"sequenceNumber\":7612994205190515504,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"fgqlwwojwvvqcj\",\"ipExtendedCommunityIds\":[\"verbfvehuwe\",\"itqeyonmoig\"],\"ipCommunityIds\":[\"oj\"]},\"action\":{\"localPreference\":4607293649535362986,\"actionType\":\"Permit\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"juypcnbucbej\"},{\"sequenceNumber\":372456818114172365,\"condition\":{\"type\":\"Or\",\"ipPrefixId\":\"pspaxhfuwygssssj\",\"ipExtendedCommunityIds\":[\"epylmssdv\"],\"ipCommunityIds\":[\"cciyzrdjf\"]},\"action\":{\"localPreference\":1960598591150483132,\"actionType\":\"Continue\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"yksdelr\"},{\"sequenceNumber\":5120928967891277285,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"bhtueynxkxqnw\",\"ipExtendedCommunityIds\":[\"qsbncadfapzebjeg\",\"wgverbywu\",\"veisjbpzdwhxputk\"],\"ipCommunityIds\":[\"srwzvdfeya\"]},\"action\":{\"localPreference\":1509508135091447171,\"actionType\":\"Deny\",\"ipCommunityProperties\":{},\"ipExtendedCommunityProperties\":{}},\"annotation\":\"iyjzu\"}],\"annotation\":\"xb\"},\"location\":\"tj\",\"tags\":{\"fyevhurklow\":\"mdypsxkw\",\"lyoix\":\"drvzcl\",\"nqizvsih\":\"ei\"},\"id\":\"mtxjca\",\"name\":\"hs\",\"type\":\"uqqtzrnubod\"}]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.routePolicies().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tj", response.iterator().next().location()); - Assertions.assertEquals("mdypsxkw", response.iterator().next().tags().get("fyevhurklow")); - Assertions.assertEquals("megynheamzlqvaj", response.iterator().next().networkFabricId()); - Assertions.assertEquals(AddressFamilyType.IPV4, response.iterator().next().addressFamilyType()); - Assertions.assertEquals("juypcnbucbej", response.iterator().next().statements().get(0).annotation()); - Assertions.assertEquals(7612994205190515504L, response.iterator().next().statements().get(0).sequenceNumber()); - Assertions - .assertEquals("oj", response.iterator().next().statements().get(0).condition().ipCommunityIds().get(0)); - Assertions - .assertEquals( - RoutePolicyConditionType.AND, response.iterator().next().statements().get(0).condition().type()); - Assertions - .assertEquals("fgqlwwojwvvqcj", response.iterator().next().statements().get(0).condition().ipPrefixId()); - Assertions - .assertEquals( - "verbfvehuwe", - response.iterator().next().statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions - .assertEquals( - 4607293649535362986L, response.iterator().next().statements().get(0).action().localPreference()); - Assertions - .assertEquals( - RoutePolicyActionType.PERMIT, response.iterator().next().statements().get(0).action().actionType()); - Assertions.assertEquals("xb", response.iterator().next().annotation()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListResultTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListResultTests.java deleted file mode 100644 index aeb167619625..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListResultTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.RoutePolicyInner; -import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePoliciesListResult; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementActionProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementConditionProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RoutePoliciesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoutePoliciesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"networkFabricId\":\"mrvnuvqkrrsguogk\",\"addressFamilyType\":\"IPv6\",\"configurationState\":\"Rejected\",\"provisioningState\":\"Deleting\",\"administrativeState\":\"MAT\",\"statements\":[{\"sequenceNumber\":300365337719306636,\"condition\":{},\"action\":{\"actionType\":\"Deny\"},\"annotation\":\"wpftvvqtmvifgcvs\"}],\"annotation\":\"alb\"},\"location\":\"icxgosnx\",\"tags\":{\"zxaoxlhmvjcnnls\":\"tcdf\"},\"id\":\"nucqxhpaqo\",\"name\":\"bvejo\",\"type\":\"soxovlznkleld\"},{\"properties\":{\"networkFabricId\":\"qdlqqhntqrykkxak\",\"addressFamilyType\":\"IPv6\",\"configurationState\":\"Deprovisioned\",\"provisioningState\":\"Failed\",\"administrativeState\":\"Disabled\",\"statements\":[{\"sequenceNumber\":6972584664296828431,\"condition\":{},\"action\":{\"actionType\":\"Permit\"},\"annotation\":\"ccnpxiemacmzt\"}],\"annotation\":\"kxsnnbrysgkt\"},\"location\":\"ocnqbblr\",\"tags\":{\"hocqxugjx\":\"fzghfuifwxudyn\",\"hmhurosdjlzb\":\"gdcrrfbpl\",\"dghq\":\"m\"},\"id\":\"uyaorservpv\",\"name\":\"sorsbegcl\",\"type\":\"ex\"}],\"nextLink\":\"jqzyhzydy\"}") - .toObject(RoutePoliciesListResult.class); - Assertions.assertEquals("icxgosnx", model.value().get(0).location()); - Assertions.assertEquals("tcdf", model.value().get(0).tags().get("zxaoxlhmvjcnnls")); - Assertions.assertEquals("mrvnuvqkrrsguogk", model.value().get(0).networkFabricId()); - Assertions.assertEquals(AddressFamilyType.IPV6, model.value().get(0).addressFamilyType()); - Assertions.assertEquals("wpftvvqtmvifgcvs", model.value().get(0).statements().get(0).annotation()); - Assertions.assertEquals(300365337719306636L, model.value().get(0).statements().get(0).sequenceNumber()); - Assertions - .assertEquals(RoutePolicyActionType.DENY, model.value().get(0).statements().get(0).action().actionType()); - Assertions.assertEquals("alb", model.value().get(0).annotation()); - Assertions.assertEquals("jqzyhzydy", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoutePoliciesListResult model = - new RoutePoliciesListResult() - .withValue( - Arrays - .asList( - new RoutePolicyInner() - .withLocation("icxgosnx") - .withTags(mapOf("zxaoxlhmvjcnnls", "tcdf")) - .withNetworkFabricId("mrvnuvqkrrsguogk") - .withAddressFamilyType(AddressFamilyType.IPV6) - .withStatements( - Arrays - .asList( - new RoutePolicyStatementProperties() - .withAnnotation("wpftvvqtmvifgcvs") - .withSequenceNumber(300365337719306636L) - .withCondition(new StatementConditionProperties()) - .withAction( - new StatementActionProperties() - .withActionType(RoutePolicyActionType.DENY)))) - .withAnnotation("alb"), - new RoutePolicyInner() - .withLocation("ocnqbblr") - .withTags( - mapOf("hocqxugjx", "fzghfuifwxudyn", "hmhurosdjlzb", "gdcrrfbpl", "dghq", "m")) - .withNetworkFabricId("qdlqqhntqrykkxak") - .withAddressFamilyType(AddressFamilyType.IPV6) - .withStatements( - Arrays - .asList( - new RoutePolicyStatementProperties() - .withAnnotation("ccnpxiemacmzt") - .withSequenceNumber(6972584664296828431L) - .withCondition(new StatementConditionProperties()) - .withAction( - new StatementActionProperties() - .withActionType(RoutePolicyActionType.PERMIT)))) - .withAnnotation("kxsnnbrysgkt"))) - .withNextLink("jqzyhzydy"); - model = BinaryData.fromObject(model).toObject(RoutePoliciesListResult.class); - Assertions.assertEquals("icxgosnx", model.value().get(0).location()); - Assertions.assertEquals("tcdf", model.value().get(0).tags().get("zxaoxlhmvjcnnls")); - Assertions.assertEquals("mrvnuvqkrrsguogk", model.value().get(0).networkFabricId()); - Assertions.assertEquals(AddressFamilyType.IPV6, model.value().get(0).addressFamilyType()); - Assertions.assertEquals("wpftvvqtmvifgcvs", model.value().get(0).statements().get(0).annotation()); - Assertions.assertEquals(300365337719306636L, model.value().get(0).statements().get(0).sequenceNumber()); - Assertions - .assertEquals(RoutePolicyActionType.DENY, model.value().get(0).statements().get(0).action().actionType()); - Assertions.assertEquals("alb", model.value().get(0).annotation()); - Assertions.assertEquals("jqzyhzydy", model.nextLink()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateAdministrativeStateMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateAdministrativeStateMockTests.java deleted file mode 100644 index e3d6794a8703..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateAdministrativeStateMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -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 RoutePoliciesUpdateAdministrativeStateMockTests { - @Test - public void testUpdateAdministrativeState() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"configurationState\":\"ErrorProvisioning\",\"successfulDevices\":[\"ffc\",\"tkprxypxtipkd\",\"ebafiq\",\"omev\"],\"failedDevices\":[\"amdvnc\"]}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommonPostActionResponseForDeviceUpdate response = - manager - .routePolicies() - .updateAdministrativeState( - "ouxkia", - "pgugrjxxdl", - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("mwn")) - .withState(EnableDisableState.DISABLE), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ffc", response.successfulDevices().get(0)); - Assertions.assertEquals("amdvnc", response.failedDevices().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesValidateConfigurationMockTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesValidateConfigurationMockTests.java deleted file mode 100644 index b355b315f8d1..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesValidateConfigurationMockTests.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.managednetworkfabric.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.managednetworkfabric.ManagedNetworkFabricManager; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationResponse; -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 RoutePoliciesValidateConfigurationMockTests { - @Test - public void testValidateConfiguration() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"configurationState\":\"Rejected\",\"url\":\"qeylac\"}"; - - 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); - })); - - ManagedNetworkFabricManager manager = - ManagedNetworkFabricManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ValidateConfigurationResponse response = - manager.routePolicies().validateConfiguration("nbutyto", "inignxhzqg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qeylac", response.url()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyInnerTests.java deleted file mode 100644 index 50c7131eae68..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyInnerTests.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.RoutePolicyInner; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyConditionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementActionProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementConditionProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RoutePolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoutePolicyInner model = - BinaryData - .fromString( - "{\"properties\":{\"networkFabricId\":\"oyxontbwdq\",\"addressFamilyType\":\"IPv6\",\"configurationState\":\"Provisioned\",\"provisioningState\":\"Updating\",\"administrativeState\":\"MAT\",\"statements\":[{\"sequenceNumber\":218261522892442603,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"fewxatktwjrppi\",\"ipExtendedCommunityIds\":[\"rqvelrmdcizhvksb\",\"jklwjp\",\"wy\"],\"ipCommunityIds\":[\"ksmpye\",\"zolbfnf\",\"ytfxu\"]},\"action\":{\"localPreference\":3076530262907663120,\"actionType\":\"Continue\",\"ipCommunityProperties\":{\"delete\":{},\"set\":{},\"add\":{}},\"ipExtendedCommunityProperties\":{\"delete\":{},\"set\":{},\"add\":{}}},\"annotation\":\"pwsnliyznghuqzg\"}],\"annotation\":\"glkfvdwrgav\"},\"location\":\"yzse\",\"tags\":{\"fdmc\":\"zukryxpijvapea\"},\"id\":\"dliklxkyoddoq\",\"name\":\"a\",\"type\":\"qtrkicw\"}") - .toObject(RoutePolicyInner.class); - Assertions.assertEquals("yzse", model.location()); - Assertions.assertEquals("zukryxpijvapea", model.tags().get("fdmc")); - Assertions.assertEquals("oyxontbwdq", model.networkFabricId()); - Assertions.assertEquals(AddressFamilyType.IPV6, model.addressFamilyType()); - Assertions.assertEquals("pwsnliyznghuqzg", model.statements().get(0).annotation()); - Assertions.assertEquals(218261522892442603L, model.statements().get(0).sequenceNumber()); - Assertions.assertEquals("ksmpye", model.statements().get(0).condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.AND, model.statements().get(0).condition().type()); - Assertions.assertEquals("fewxatktwjrppi", model.statements().get(0).condition().ipPrefixId()); - Assertions - .assertEquals("rqvelrmdcizhvksb", model.statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(3076530262907663120L, model.statements().get(0).action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.CONTINUE, model.statements().get(0).action().actionType()); - Assertions.assertEquals("glkfvdwrgav", model.annotation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoutePolicyInner model = - new RoutePolicyInner() - .withLocation("yzse") - .withTags(mapOf("fdmc", "zukryxpijvapea")) - .withNetworkFabricId("oyxontbwdq") - .withAddressFamilyType(AddressFamilyType.IPV6) - .withStatements( - Arrays - .asList( - new RoutePolicyStatementProperties() - .withAnnotation("pwsnliyznghuqzg") - .withSequenceNumber(218261522892442603L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("ksmpye", "zolbfnf", "ytfxu")) - .withType(RoutePolicyConditionType.AND) - .withIpPrefixId("fewxatktwjrppi") - .withIpExtendedCommunityIds(Arrays.asList("rqvelrmdcizhvksb", "jklwjp", "wy"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(3076530262907663120L) - .withActionType(RoutePolicyActionType.CONTINUE) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd(new IpCommunityIdList()) - .withDelete(new IpCommunityIdList()) - .withSet(new IpCommunityIdList())) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd(new IpExtendedCommunityIdList()) - .withDelete(new IpExtendedCommunityIdList()) - .withSet(new IpExtendedCommunityIdList()))))) - .withAnnotation("glkfvdwrgav"); - model = BinaryData.fromObject(model).toObject(RoutePolicyInner.class); - Assertions.assertEquals("yzse", model.location()); - Assertions.assertEquals("zukryxpijvapea", model.tags().get("fdmc")); - Assertions.assertEquals("oyxontbwdq", model.networkFabricId()); - Assertions.assertEquals(AddressFamilyType.IPV6, model.addressFamilyType()); - Assertions.assertEquals("pwsnliyznghuqzg", model.statements().get(0).annotation()); - Assertions.assertEquals(218261522892442603L, model.statements().get(0).sequenceNumber()); - Assertions.assertEquals("ksmpye", model.statements().get(0).condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.AND, model.statements().get(0).condition().type()); - Assertions.assertEquals("fewxatktwjrppi", model.statements().get(0).condition().ipPrefixId()); - Assertions - .assertEquals("rqvelrmdcizhvksb", model.statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(3076530262907663120L, model.statements().get(0).action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.CONTINUE, model.statements().get(0).action().actionType()); - Assertions.assertEquals("glkfvdwrgav", model.annotation()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyPatchTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyPatchTests.java deleted file mode 100644 index a07c520b46fe..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyPatchTests.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyConditionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPatch; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementActionProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementConditionProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RoutePolicyPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoutePolicyPatch model = - BinaryData - .fromString( - "{\"properties\":{\"statements\":[{\"sequenceNumber\":1193343706297948220,\"condition\":{\"type\":\"Or\",\"ipPrefixId\":\"sj\",\"ipExtendedCommunityIds\":[\"c\",\"jlwmqc\",\"cabaam\"],\"ipCommunityIds\":[\"dhpmkxdujkxpuqzd\",\"oqywsuarpzhryh\",\"zx\",\"zdsyxb\"]},\"action\":{\"localPreference\":3623976659728232805,\"actionType\":\"Deny\",\"ipCommunityProperties\":{\"delete\":{},\"set\":{},\"add\":{}},\"ipExtendedCommunityProperties\":{\"delete\":{},\"set\":{},\"add\":{}}},\"annotation\":\"ivkdfvj\"},{\"sequenceNumber\":559249206982414700,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"zepirtv\",\"ipExtendedCommunityIds\":[\"qdqbvxqto\"],\"ipCommunityIds\":[\"bopvhcbt\",\"aprjxcon\",\"ick\"]},\"action\":{\"localPreference\":4833157471454895949,\"actionType\":\"Continue\",\"ipCommunityProperties\":{\"delete\":{},\"set\":{},\"add\":{}},\"ipExtendedCommunityProperties\":{\"delete\":{},\"set\":{},\"add\":{}}},\"annotation\":\"zgbjwvrudmp\"},{\"sequenceNumber\":2617010160612516480,\"condition\":{\"type\":\"Or\",\"ipPrefixId\":\"ol\",\"ipExtendedCommunityIds\":[\"abes\",\"yzwphbjks\",\"ecmbaaj\"],\"ipCommunityIds\":[\"rdkqlvzkfekdesb\",\"jqtl\",\"b\",\"jjpduibsrrrq\"]},\"action\":{\"localPreference\":8944424421948080049,\"actionType\":\"Continue\",\"ipCommunityProperties\":{\"delete\":{},\"set\":{},\"add\":{}},\"ipExtendedCommunityProperties\":{\"delete\":{},\"set\":{},\"add\":{}}},\"annotation\":\"ovtuer\"},{\"sequenceNumber\":5041983404964007850,\"condition\":{\"type\":\"Or\",\"ipPrefixId\":\"cxybtdzy\",\"ipExtendedCommunityIds\":[\"aoegj\",\"gpljbnwczsraz\",\"bybicqhxhj\"],\"ipCommunityIds\":[\"pasizzfmugykwuy\",\"uo\"]},\"action\":{\"localPreference\":5126086144561638302,\"actionType\":\"Continue\",\"ipCommunityProperties\":{\"delete\":{},\"set\":{},\"add\":{}},\"ipExtendedCommunityProperties\":{\"delete\":{},\"set\":{},\"add\":{}}},\"annotation\":\"zffpherwj\"}]},\"tags\":{\"ezmzxvfy\":\"wtwona\"}}") - .toObject(RoutePolicyPatch.class); - Assertions.assertEquals("wtwona", model.tags().get("ezmzxvfy")); - Assertions.assertEquals("ivkdfvj", model.statements().get(0).annotation()); - Assertions.assertEquals(1193343706297948220L, model.statements().get(0).sequenceNumber()); - Assertions.assertEquals("dhpmkxdujkxpuqzd", model.statements().get(0).condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.OR, model.statements().get(0).condition().type()); - Assertions.assertEquals("sj", model.statements().get(0).condition().ipPrefixId()); - Assertions.assertEquals("c", model.statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(3623976659728232805L, model.statements().get(0).action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.DENY, model.statements().get(0).action().actionType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoutePolicyPatch model = - new RoutePolicyPatch() - .withTags(mapOf("ezmzxvfy", "wtwona")) - .withStatements( - Arrays - .asList( - new RoutePolicyStatementProperties() - .withAnnotation("ivkdfvj") - .withSequenceNumber(1193343706297948220L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds( - Arrays.asList("dhpmkxdujkxpuqzd", "oqywsuarpzhryh", "zx", "zdsyxb")) - .withType(RoutePolicyConditionType.OR) - .withIpPrefixId("sj") - .withIpExtendedCommunityIds(Arrays.asList("c", "jlwmqc", "cabaam"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(3623976659728232805L) - .withActionType(RoutePolicyActionType.DENY) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd(new IpCommunityIdList()) - .withDelete(new IpCommunityIdList()) - .withSet(new IpCommunityIdList())) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd(new IpExtendedCommunityIdList()) - .withDelete(new IpExtendedCommunityIdList()) - .withSet(new IpExtendedCommunityIdList()))), - new RoutePolicyStatementProperties() - .withAnnotation("zgbjwvrudmp") - .withSequenceNumber(559249206982414700L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("bopvhcbt", "aprjxcon", "ick")) - .withType(RoutePolicyConditionType.AND) - .withIpPrefixId("zepirtv") - .withIpExtendedCommunityIds(Arrays.asList("qdqbvxqto"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(4833157471454895949L) - .withActionType(RoutePolicyActionType.CONTINUE) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd(new IpCommunityIdList()) - .withDelete(new IpCommunityIdList()) - .withSet(new IpCommunityIdList())) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd(new IpExtendedCommunityIdList()) - .withDelete(new IpExtendedCommunityIdList()) - .withSet(new IpExtendedCommunityIdList()))), - new RoutePolicyStatementProperties() - .withAnnotation("ovtuer") - .withSequenceNumber(2617010160612516480L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds( - Arrays.asList("rdkqlvzkfekdesb", "jqtl", "b", "jjpduibsrrrq")) - .withType(RoutePolicyConditionType.OR) - .withIpPrefixId("ol") - .withIpExtendedCommunityIds(Arrays.asList("abes", "yzwphbjks", "ecmbaaj"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(8944424421948080049L) - .withActionType(RoutePolicyActionType.CONTINUE) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd(new IpCommunityIdList()) - .withDelete(new IpCommunityIdList()) - .withSet(new IpCommunityIdList())) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd(new IpExtendedCommunityIdList()) - .withDelete(new IpExtendedCommunityIdList()) - .withSet(new IpExtendedCommunityIdList()))), - new RoutePolicyStatementProperties() - .withAnnotation("zffpherwj") - .withSequenceNumber(5041983404964007850L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("pasizzfmugykwuy", "uo")) - .withType(RoutePolicyConditionType.OR) - .withIpPrefixId("cxybtdzy") - .withIpExtendedCommunityIds( - Arrays.asList("aoegj", "gpljbnwczsraz", "bybicqhxhj"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(5126086144561638302L) - .withActionType(RoutePolicyActionType.CONTINUE) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd(new IpCommunityIdList()) - .withDelete(new IpCommunityIdList()) - .withSet(new IpCommunityIdList())) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd(new IpExtendedCommunityIdList()) - .withDelete(new IpExtendedCommunityIdList()) - .withSet(new IpExtendedCommunityIdList()))))); - model = BinaryData.fromObject(model).toObject(RoutePolicyPatch.class); - Assertions.assertEquals("wtwona", model.tags().get("ezmzxvfy")); - Assertions.assertEquals("ivkdfvj", model.statements().get(0).annotation()); - Assertions.assertEquals(1193343706297948220L, model.statements().get(0).sequenceNumber()); - Assertions.assertEquals("dhpmkxdujkxpuqzd", model.statements().get(0).condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.OR, model.statements().get(0).condition().type()); - Assertions.assertEquals("sj", model.statements().get(0).condition().ipPrefixId()); - Assertions.assertEquals("c", model.statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(3623976659728232805L, model.statements().get(0).action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.DENY, model.statements().get(0).action().actionType()); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyPatchablePropertiesTests.java deleted file mode 100644 index 0c12cfc30540..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyPatchablePropertiesTests.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.RoutePolicyPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyConditionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementActionProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementConditionProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RoutePolicyPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoutePolicyPatchableProperties model = - BinaryData - .fromString( - "{\"statements\":[{\"sequenceNumber\":7397290611576295769,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"hgku\",\"ipExtendedCommunityIds\":[\"zo\"],\"ipCommunityIds\":[\"cfqoyxryqycymz\"]},\"action\":{\"localPreference\":1120552790433937388,\"actionType\":\"Deny\",\"ipCommunityProperties\":{\"delete\":{\"ipCommunityIds\":[\"uzfdh\"]},\"set\":{\"ipCommunityIds\":[\"yciwzkil\"]},\"add\":{\"ipCommunityIds\":[\"dfgesvzohab\",\"rizmadjrsbgail\",\"qovqm\",\"qsxofxqnkiuok\"]}},\"ipExtendedCommunityProperties\":{\"delete\":{\"ipExtendedCommunityIds\":[\"ooiobhiebruptl\"]},\"set\":{\"ipExtendedCommunityIds\":[\"z\",\"aqsos\",\"njlvgrghnh\",\"oxrqhjninpeswv\"]},\"add\":{\"ipExtendedCommunityIds\":[\"gebzqzmcsviujo\"]}}},\"annotation\":\"dvmsnaosxsx\"},{\"sequenceNumber\":4593331377507398475,\"condition\":{\"type\":\"Or\",\"ipPrefixId\":\"vetqhdbitqsbyujs\",\"ipExtendedCommunityIds\":[\"rihumgrmsdbvq\",\"gfygfkgxbdpb\"],\"ipCommunityIds\":[\"wbdpsesboynpy\",\"porrvkxtfctane\",\"inqxdhnpjnezj\",\"g\"]},\"action\":{\"localPreference\":1233192271680973560,\"actionType\":\"Deny\",\"ipCommunityProperties\":{\"delete\":{\"ipCommunityIds\":[\"zwvwetqf\",\"uxvf\",\"uqhngqqxjbsoto\"]},\"set\":{\"ipCommunityIds\":[\"ttujydeatwxp\",\"bx\",\"dhxbboceksramqc\",\"l\"]},\"add\":{\"ipCommunityIds\":[\"lvvkswurx\"]}},\"ipExtendedCommunityProperties\":{\"delete\":{\"ipExtendedCommunityIds\":[\"auimnntf\",\"q\"]},\"set\":{\"ipExtendedCommunityIds\":[\"nbnwi\",\"lqcw\"]},\"add\":{\"ipExtendedCommunityIds\":[\"dqkzstzpzecdl\",\"eirta\"]}}},\"annotation\":\"u\"}]}") - .toObject(RoutePolicyPatchableProperties.class); - Assertions.assertEquals("dvmsnaosxsx", model.statements().get(0).annotation()); - Assertions.assertEquals(7397290611576295769L, model.statements().get(0).sequenceNumber()); - Assertions.assertEquals("cfqoyxryqycymz", model.statements().get(0).condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.AND, model.statements().get(0).condition().type()); - Assertions.assertEquals("hgku", model.statements().get(0).condition().ipPrefixId()); - Assertions.assertEquals("zo", model.statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(1120552790433937388L, model.statements().get(0).action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.DENY, model.statements().get(0).action().actionType()); - Assertions - .assertEquals( - "dfgesvzohab", - model.statements().get(0).action().ipCommunityProperties().add().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "uzfdh", model.statements().get(0).action().ipCommunityProperties().delete().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "yciwzkil", model.statements().get(0).action().ipCommunityProperties().set().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "gebzqzmcsviujo", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .add() - .ipExtendedCommunityIds() - .get(0)); - Assertions - .assertEquals( - "ooiobhiebruptl", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .delete() - .ipExtendedCommunityIds() - .get(0)); - Assertions - .assertEquals( - "z", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .set() - .ipExtendedCommunityIds() - .get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoutePolicyPatchableProperties model = - new RoutePolicyPatchableProperties() - .withStatements( - Arrays - .asList( - new RoutePolicyStatementProperties() - .withAnnotation("dvmsnaosxsx") - .withSequenceNumber(7397290611576295769L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("cfqoyxryqycymz")) - .withType(RoutePolicyConditionType.AND) - .withIpPrefixId("hgku") - .withIpExtendedCommunityIds(Arrays.asList("zo"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(1120552790433937388L) - .withActionType(RoutePolicyActionType.DENY) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd( - new IpCommunityIdList() - .withIpCommunityIds( - Arrays - .asList( - "dfgesvzohab", - "rizmadjrsbgail", - "qovqm", - "qsxofxqnkiuok"))) - .withDelete( - new IpCommunityIdList().withIpCommunityIds(Arrays.asList("uzfdh"))) - .withSet( - new IpCommunityIdList() - .withIpCommunityIds(Arrays.asList("yciwzkil")))) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("gebzqzmcsviujo"))) - .withDelete( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("ooiobhiebruptl"))) - .withSet( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays - .asList( - "z", "aqsos", "njlvgrghnh", "oxrqhjninpeswv"))))), - new RoutePolicyStatementProperties() - .withAnnotation("u") - .withSequenceNumber(4593331377507398475L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds( - Arrays.asList("wbdpsesboynpy", "porrvkxtfctane", "inqxdhnpjnezj", "g")) - .withType(RoutePolicyConditionType.OR) - .withIpPrefixId("vetqhdbitqsbyujs") - .withIpExtendedCommunityIds(Arrays.asList("rihumgrmsdbvq", "gfygfkgxbdpb"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(1233192271680973560L) - .withActionType(RoutePolicyActionType.DENY) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd( - new IpCommunityIdList() - .withIpCommunityIds(Arrays.asList("lvvkswurx"))) - .withDelete( - new IpCommunityIdList() - .withIpCommunityIds( - Arrays.asList("zwvwetqf", "uxvf", "uqhngqqxjbsoto"))) - .withSet( - new IpCommunityIdList() - .withIpCommunityIds( - Arrays - .asList("ttujydeatwxp", "bx", "dhxbboceksramqc", "l")))) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays.asList("dqkzstzpzecdl", "eirta"))) - .withDelete( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("auimnntf", "q"))) - .withSet( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays.asList("nbnwi", "lqcw"))))))); - model = BinaryData.fromObject(model).toObject(RoutePolicyPatchableProperties.class); - Assertions.assertEquals("dvmsnaosxsx", model.statements().get(0).annotation()); - Assertions.assertEquals(7397290611576295769L, model.statements().get(0).sequenceNumber()); - Assertions.assertEquals("cfqoyxryqycymz", model.statements().get(0).condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.AND, model.statements().get(0).condition().type()); - Assertions.assertEquals("hgku", model.statements().get(0).condition().ipPrefixId()); - Assertions.assertEquals("zo", model.statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(1120552790433937388L, model.statements().get(0).action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.DENY, model.statements().get(0).action().actionType()); - Assertions - .assertEquals( - "dfgesvzohab", - model.statements().get(0).action().ipCommunityProperties().add().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "uzfdh", model.statements().get(0).action().ipCommunityProperties().delete().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "yciwzkil", model.statements().get(0).action().ipCommunityProperties().set().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "gebzqzmcsviujo", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .add() - .ipExtendedCommunityIds() - .get(0)); - Assertions - .assertEquals( - "ooiobhiebruptl", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .delete() - .ipExtendedCommunityIds() - .get(0)); - Assertions - .assertEquals( - "z", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .set() - .ipExtendedCommunityIds() - .get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyPropertiesTests.java deleted file mode 100644 index afff5e259197..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyPropertiesTests.java +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.RoutePolicyProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.AddressFamilyType; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyConditionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementActionProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementConditionProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RoutePolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoutePolicyProperties model = - BinaryData - .fromString( - "{\"networkFabricId\":\"qyrgqmndk\",\"addressFamilyType\":\"IPv6\",\"configurationState\":\"ErrorDeprovisioning\",\"provisioningState\":\"Canceled\",\"administrativeState\":\"Disabled\",\"statements\":[{\"sequenceNumber\":4052877502139971257,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"nackitlw\",\"ipExtendedCommunityIds\":[\"ylpzj\",\"ldaqwjun\",\"lnij\"],\"ipCommunityIds\":[\"brdsypotnpkb\",\"zpkodngvnqdjg\",\"btwgn\"]},\"action\":{\"localPreference\":8728466696349694954,\"actionType\":\"Permit\",\"ipCommunityProperties\":{\"delete\":{\"ipCommunityIds\":[\"b\"]},\"set\":{\"ipCommunityIds\":[\"nrirpiiuvc\",\"o\"]},\"add\":{\"ipCommunityIds\":[\"ucqsdgbxcwtvmij\",\"cpkkjlamyvwprj\",\"aih\",\"nnlb\"]}},\"ipExtendedCommunityProperties\":{\"delete\":{\"ipExtendedCommunityIds\":[\"cbqetfz\",\"ppvolzayjw\",\"unj\",\"mprklatwiuujxsuj\"]},\"set\":{\"ipExtendedCommunityIds\":[\"xeegxbnjnc\",\"epdp\",\"ymgbfmd\",\"uyyaescjxna\"]},\"add\":{\"ipExtendedCommunityIds\":[\"qbkxdtbfkihainz\",\"efkzlxvco\",\"cgoeozlibcbnu\"]}}},\"annotation\":\"u\"},{\"sequenceNumber\":5323136357112538745,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"qlho\",\"ipExtendedCommunityIds\":[\"neli\"],\"ipCommunityIds\":[\"ibtkqj\",\"jcajgofytk\",\"hk\"]},\"action\":{\"localPreference\":5414711331365155959,\"actionType\":\"Continue\",\"ipCommunityProperties\":{\"delete\":{\"ipCommunityIds\":[\"tdy\",\"lglhelwruklfq\",\"xspxgogypbztgae\",\"jnskvct\"]},\"set\":{\"ipCommunityIds\":[\"mb\"]},\"add\":{\"ipCommunityIds\":[\"hlvrycyxrnwu\",\"fajnpdw\",\"jggkwdepem\"]}},\"ipExtendedCommunityProperties\":{\"delete\":{\"ipExtendedCommunityIds\":[\"iqii\",\"xcor\"]},\"set\":{\"ipExtendedCommunityIds\":[\"yhgtrttcuayiq\",\"lnkmmxzifbqgqex\",\"wqzr\",\"gqrqkkvfy\"]},\"add\":{\"ipExtendedCommunityIds\":[\"bpwainpgobothx\",\"ewhpnyjt\",\"qgzyvextc\",\"slroldow\"]}}},\"annotation\":\"hdlr\"}],\"annotation\":\"io\"}") - .toObject(RoutePolicyProperties.class); - Assertions.assertEquals("io", model.annotation()); - Assertions.assertEquals("qyrgqmndk", model.networkFabricId()); - Assertions.assertEquals(AddressFamilyType.IPV6, model.addressFamilyType()); - Assertions.assertEquals("u", model.statements().get(0).annotation()); - Assertions.assertEquals(4052877502139971257L, model.statements().get(0).sequenceNumber()); - Assertions.assertEquals("brdsypotnpkb", model.statements().get(0).condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.AND, model.statements().get(0).condition().type()); - Assertions.assertEquals("nackitlw", model.statements().get(0).condition().ipPrefixId()); - Assertions.assertEquals("ylpzj", model.statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(8728466696349694954L, model.statements().get(0).action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.PERMIT, model.statements().get(0).action().actionType()); - Assertions - .assertEquals( - "ucqsdgbxcwtvmij", - model.statements().get(0).action().ipCommunityProperties().add().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "b", model.statements().get(0).action().ipCommunityProperties().delete().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "nrirpiiuvc", model.statements().get(0).action().ipCommunityProperties().set().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "qbkxdtbfkihainz", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .add() - .ipExtendedCommunityIds() - .get(0)); - Assertions - .assertEquals( - "cbqetfz", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .delete() - .ipExtendedCommunityIds() - .get(0)); - Assertions - .assertEquals( - "xeegxbnjnc", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .set() - .ipExtendedCommunityIds() - .get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoutePolicyProperties model = - new RoutePolicyProperties() - .withAnnotation("io") - .withNetworkFabricId("qyrgqmndk") - .withAddressFamilyType(AddressFamilyType.IPV6) - .withStatements( - Arrays - .asList( - new RoutePolicyStatementProperties() - .withAnnotation("u") - .withSequenceNumber(4052877502139971257L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("brdsypotnpkb", "zpkodngvnqdjg", "btwgn")) - .withType(RoutePolicyConditionType.AND) - .withIpPrefixId("nackitlw") - .withIpExtendedCommunityIds(Arrays.asList("ylpzj", "ldaqwjun", "lnij"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(8728466696349694954L) - .withActionType(RoutePolicyActionType.PERMIT) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd( - new IpCommunityIdList() - .withIpCommunityIds( - Arrays - .asList( - "ucqsdgbxcwtvmij", - "cpkkjlamyvwprj", - "aih", - "nnlb"))) - .withDelete( - new IpCommunityIdList().withIpCommunityIds(Arrays.asList("b"))) - .withSet( - new IpCommunityIdList() - .withIpCommunityIds(Arrays.asList("nrirpiiuvc", "o")))) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays - .asList( - "qbkxdtbfkihainz", "efkzlxvco", "cgoeozlibcbnu"))) - .withDelete( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays - .asList( - "cbqetfz", - "ppvolzayjw", - "unj", - "mprklatwiuujxsuj"))) - .withSet( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays - .asList( - "xeegxbnjnc", "epdp", "ymgbfmd", "uyyaescjxna"))))), - new RoutePolicyStatementProperties() - .withAnnotation("hdlr") - .withSequenceNumber(5323136357112538745L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("ibtkqj", "jcajgofytk", "hk")) - .withType(RoutePolicyConditionType.AND) - .withIpPrefixId("qlho") - .withIpExtendedCommunityIds(Arrays.asList("neli"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(5414711331365155959L) - .withActionType(RoutePolicyActionType.CONTINUE) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd( - new IpCommunityIdList() - .withIpCommunityIds( - Arrays.asList("hlvrycyxrnwu", "fajnpdw", "jggkwdepem"))) - .withDelete( - new IpCommunityIdList() - .withIpCommunityIds( - Arrays - .asList( - "tdy", - "lglhelwruklfq", - "xspxgogypbztgae", - "jnskvct"))) - .withSet( - new IpCommunityIdList().withIpCommunityIds(Arrays.asList("mb")))) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays - .asList( - "bpwainpgobothx", - "ewhpnyjt", - "qgzyvextc", - "slroldow"))) - .withDelete( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("iqii", "xcor"))) - .withSet( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays - .asList( - "yhgtrttcuayiq", - "lnkmmxzifbqgqex", - "wqzr", - "gqrqkkvfy"))))))); - model = BinaryData.fromObject(model).toObject(RoutePolicyProperties.class); - Assertions.assertEquals("io", model.annotation()); - Assertions.assertEquals("qyrgqmndk", model.networkFabricId()); - Assertions.assertEquals(AddressFamilyType.IPV6, model.addressFamilyType()); - Assertions.assertEquals("u", model.statements().get(0).annotation()); - Assertions.assertEquals(4052877502139971257L, model.statements().get(0).sequenceNumber()); - Assertions.assertEquals("brdsypotnpkb", model.statements().get(0).condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.AND, model.statements().get(0).condition().type()); - Assertions.assertEquals("nackitlw", model.statements().get(0).condition().ipPrefixId()); - Assertions.assertEquals("ylpzj", model.statements().get(0).condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(8728466696349694954L, model.statements().get(0).action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.PERMIT, model.statements().get(0).action().actionType()); - Assertions - .assertEquals( - "ucqsdgbxcwtvmij", - model.statements().get(0).action().ipCommunityProperties().add().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "b", model.statements().get(0).action().ipCommunityProperties().delete().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "nrirpiiuvc", model.statements().get(0).action().ipCommunityProperties().set().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "qbkxdtbfkihainz", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .add() - .ipExtendedCommunityIds() - .get(0)); - Assertions - .assertEquals( - "cbqetfz", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .delete() - .ipExtendedCommunityIds() - .get(0)); - Assertions - .assertEquals( - "xeegxbnjnc", - model - .statements() - .get(0) - .action() - .ipExtendedCommunityProperties() - .set() - .ipExtendedCommunityIds() - .get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyStatementPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyStatementPropertiesTests.java deleted file mode 100644 index 60b40f4ccabc..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePolicyStatementPropertiesTests.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyConditionType; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementActionProperties; -import com.azure.resourcemanager.managednetworkfabric.models.StatementConditionProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RoutePolicyStatementPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoutePolicyStatementProperties model = - BinaryData - .fromString( - "{\"sequenceNumber\":4122338443565753396,\"condition\":{\"type\":\"And\",\"ipPrefixId\":\"au\",\"ipExtendedCommunityIds\":[\"udzpsjqrmlujmt\"],\"ipCommunityIds\":[\"ofwuzeb\",\"qvmpjb\",\"zyenfspet\",\"eudwkhdlckdoxocj\"]},\"action\":{\"localPreference\":4325038435220146940,\"actionType\":\"Deny\",\"ipCommunityProperties\":{\"delete\":{\"ipCommunityIds\":[\"ortwwyjm\",\"vrlhfxmrhjn\",\"h\"]},\"set\":{\"ipCommunityIds\":[\"wkdywkszavuafan\"]},\"add\":{\"ipCommunityIds\":[\"tptplkossjbzvx\",\"zw\"]}},\"ipExtendedCommunityProperties\":{\"delete\":{\"ipExtendedCommunityIds\":[\"fgti\",\"czhfjdcc\",\"nyuvbtcuhjcgjt\",\"kntomnlz\"]},\"set\":{\"ipExtendedCommunityIds\":[\"bszsbzrrxey\"]},\"add\":{\"ipExtendedCommunityIds\":[\"owlrmbdctqxav\",\"joezvw\",\"ryzgavpln\"]}}},\"annotation\":\"dfiekkiskyy\"}") - .toObject(RoutePolicyStatementProperties.class); - Assertions.assertEquals("dfiekkiskyy", model.annotation()); - Assertions.assertEquals(4122338443565753396L, model.sequenceNumber()); - Assertions.assertEquals("ofwuzeb", model.condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.AND, model.condition().type()); - Assertions.assertEquals("au", model.condition().ipPrefixId()); - Assertions.assertEquals("udzpsjqrmlujmt", model.condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(4325038435220146940L, model.action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.DENY, model.action().actionType()); - Assertions.assertEquals("tptplkossjbzvx", model.action().ipCommunityProperties().add().ipCommunityIds().get(0)); - Assertions.assertEquals("ortwwyjm", model.action().ipCommunityProperties().delete().ipCommunityIds().get(0)); - Assertions - .assertEquals("wkdywkszavuafan", model.action().ipCommunityProperties().set().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "owlrmbdctqxav", model.action().ipExtendedCommunityProperties().add().ipExtendedCommunityIds().get(0)); - Assertions - .assertEquals( - "fgti", model.action().ipExtendedCommunityProperties().delete().ipExtendedCommunityIds().get(0)); - Assertions - .assertEquals( - "bszsbzrrxey", model.action().ipExtendedCommunityProperties().set().ipExtendedCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoutePolicyStatementProperties model = - new RoutePolicyStatementProperties() - .withAnnotation("dfiekkiskyy") - .withSequenceNumber(4122338443565753396L) - .withCondition( - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("ofwuzeb", "qvmpjb", "zyenfspet", "eudwkhdlckdoxocj")) - .withType(RoutePolicyConditionType.AND) - .withIpPrefixId("au") - .withIpExtendedCommunityIds(Arrays.asList("udzpsjqrmlujmt"))) - .withAction( - new StatementActionProperties() - .withLocalPreference(4325038435220146940L) - .withActionType(RoutePolicyActionType.DENY) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd( - new IpCommunityIdList().withIpCommunityIds(Arrays.asList("tptplkossjbzvx", "zw"))) - .withDelete( - new IpCommunityIdList() - .withIpCommunityIds(Arrays.asList("ortwwyjm", "vrlhfxmrhjn", "h"))) - .withSet(new IpCommunityIdList().withIpCommunityIds(Arrays.asList("wkdywkszavuafan")))) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays.asList("owlrmbdctqxav", "joezvw", "ryzgavpln"))) - .withDelete( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds( - Arrays.asList("fgti", "czhfjdcc", "nyuvbtcuhjcgjt", "kntomnlz"))) - .withSet( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("bszsbzrrxey"))))); - model = BinaryData.fromObject(model).toObject(RoutePolicyStatementProperties.class); - Assertions.assertEquals("dfiekkiskyy", model.annotation()); - Assertions.assertEquals(4122338443565753396L, model.sequenceNumber()); - Assertions.assertEquals("ofwuzeb", model.condition().ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.AND, model.condition().type()); - Assertions.assertEquals("au", model.condition().ipPrefixId()); - Assertions.assertEquals("udzpsjqrmlujmt", model.condition().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals(4325038435220146940L, model.action().localPreference()); - Assertions.assertEquals(RoutePolicyActionType.DENY, model.action().actionType()); - Assertions.assertEquals("tptplkossjbzvx", model.action().ipCommunityProperties().add().ipCommunityIds().get(0)); - Assertions.assertEquals("ortwwyjm", model.action().ipCommunityProperties().delete().ipCommunityIds().get(0)); - Assertions - .assertEquals("wkdywkszavuafan", model.action().ipCommunityProperties().set().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "owlrmbdctqxav", model.action().ipExtendedCommunityProperties().add().ipExtendedCommunityIds().get(0)); - Assertions - .assertEquals( - "fgti", model.action().ipExtendedCommunityProperties().delete().ipExtendedCommunityIds().get(0)); - Assertions - .assertEquals( - "bszsbzrrxey", model.action().ipExtendedCommunityProperties().set().ipExtendedCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RouteTargetInformationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RouteTargetInformationTests.java deleted file mode 100644 index 2fe12dcc8a26..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RouteTargetInformationTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RouteTargetInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RouteTargetInformation model = - BinaryData - .fromString( - "{\"importIpv4RouteTargets\":[\"pwwobtdphti\"],\"importIpv6RouteTargets\":[\"fofwan\",\"hks\"],\"exportIpv4RouteTargets\":[\"w\",\"zcgwdfriw\",\"ybjpozoks\",\"vgllixdgby\"],\"exportIpv6RouteTargets\":[\"ewqkjvxprwpxs\",\"ohutxlcsk\"]}") - .toObject(RouteTargetInformation.class); - Assertions.assertEquals("pwwobtdphti", model.importIpv4RouteTargets().get(0)); - Assertions.assertEquals("fofwan", model.importIpv6RouteTargets().get(0)); - Assertions.assertEquals("w", model.exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("ewqkjvxprwpxs", model.exportIpv6RouteTargets().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RouteTargetInformation model = - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("pwwobtdphti")) - .withImportIpv6RouteTargets(Arrays.asList("fofwan", "hks")) - .withExportIpv4RouteTargets(Arrays.asList("w", "zcgwdfriw", "ybjpozoks", "vgllixdgby")) - .withExportIpv6RouteTargets(Arrays.asList("ewqkjvxprwpxs", "ohutxlcsk")); - model = BinaryData.fromObject(model).toObject(RouteTargetInformation.class); - Assertions.assertEquals("pwwobtdphti", model.importIpv4RouteTargets().get(0)); - Assertions.assertEquals("fofwan", model.importIpv6RouteTargets().get(0)); - Assertions.assertEquals("w", model.exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("ewqkjvxprwpxs", model.exportIpv6RouteTargets().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RulePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RulePropertiesTests.java deleted file mode 100644 index 2efe73f41f90..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/RulePropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.Action; -import com.azure.resourcemanager.managednetworkfabric.models.RuleProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RuleProperties model = - BinaryData - .fromString("{\"action\":\"Deny\",\"addressList\":[\"f\",\"jkpdxphlkksnm\",\"zvyfijdkzuqnwsi\"]}") - .toObject(RuleProperties.class); - Assertions.assertEquals(Action.DENY, model.action()); - Assertions.assertEquals("f", model.addressList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RuleProperties model = - new RuleProperties() - .withAction(Action.DENY) - .withAddressList(Arrays.asList("f", "jkpdxphlkksnm", "zvyfijdkzuqnwsi")); - model = BinaryData.fromObject(model).toObject(RuleProperties.class); - Assertions.assertEquals(Action.DENY, model.action()); - Assertions.assertEquals("f", model.addressList().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StatementActionPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StatementActionPropertiesTests.java deleted file mode 100644 index 564fa9f7ef53..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StatementActionPropertiesTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; -import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyActionType; -import com.azure.resourcemanager.managednetworkfabric.models.StatementActionProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StatementActionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StatementActionProperties model = - BinaryData - .fromString( - "{\"localPreference\":2144559147599140910,\"actionType\":\"Deny\",\"ipCommunityProperties\":{\"delete\":{\"ipCommunityIds\":[\"hbcycgqakcsihxvt\",\"cwwfopxp\",\"yxnsbubwh\",\"qqgugwluxahtq\"]},\"set\":{\"ipCommunityIds\":[\"hwq\",\"qwebagm\",\"pkephujeucosvkke\"]},\"add\":{\"ipCommunityIds\":[\"ypaxpjp\",\"illgnu\",\"ezfpffbuqxkn\"]}},\"ipExtendedCommunityProperties\":{\"delete\":{\"ipExtendedCommunityIds\":[\"bg\",\"yojfchicpare\",\"zoksgqhb\"]},\"set\":{\"ipExtendedCommunityIds\":[\"xilozblkcrfldfl\",\"wtkbptsflot\"]},\"add\":{\"ipExtendedCommunityIds\":[\"wgftshfgmuxuqia\"]}}}") - .toObject(StatementActionProperties.class); - Assertions.assertEquals(2144559147599140910L, model.localPreference()); - Assertions.assertEquals(RoutePolicyActionType.DENY, model.actionType()); - Assertions.assertEquals("ypaxpjp", model.ipCommunityProperties().add().ipCommunityIds().get(0)); - Assertions.assertEquals("hbcycgqakcsihxvt", model.ipCommunityProperties().delete().ipCommunityIds().get(0)); - Assertions.assertEquals("hwq", model.ipCommunityProperties().set().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "wgftshfgmuxuqia", model.ipExtendedCommunityProperties().add().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals("bg", model.ipExtendedCommunityProperties().delete().ipExtendedCommunityIds().get(0)); - Assertions - .assertEquals( - "xilozblkcrfldfl", model.ipExtendedCommunityProperties().set().ipExtendedCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StatementActionProperties model = - new StatementActionProperties() - .withLocalPreference(2144559147599140910L) - .withActionType(RoutePolicyActionType.DENY) - .withIpCommunityProperties( - new ActionIpCommunityProperties() - .withAdd( - new IpCommunityIdList() - .withIpCommunityIds(Arrays.asList("ypaxpjp", "illgnu", "ezfpffbuqxkn"))) - .withDelete( - new IpCommunityIdList() - .withIpCommunityIds( - Arrays.asList("hbcycgqakcsihxvt", "cwwfopxp", "yxnsbubwh", "qqgugwluxahtq"))) - .withSet( - new IpCommunityIdList() - .withIpCommunityIds(Arrays.asList("hwq", "qwebagm", "pkephujeucosvkke")))) - .withIpExtendedCommunityProperties( - new ActionIpExtendedCommunityProperties() - .withAdd( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("wgftshfgmuxuqia"))) - .withDelete( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("bg", "yojfchicpare", "zoksgqhb"))) - .withSet( - new IpExtendedCommunityIdList() - .withIpExtendedCommunityIds(Arrays.asList("xilozblkcrfldfl", "wtkbptsflot")))); - model = BinaryData.fromObject(model).toObject(StatementActionProperties.class); - Assertions.assertEquals(2144559147599140910L, model.localPreference()); - Assertions.assertEquals(RoutePolicyActionType.DENY, model.actionType()); - Assertions.assertEquals("ypaxpjp", model.ipCommunityProperties().add().ipCommunityIds().get(0)); - Assertions.assertEquals("hbcycgqakcsihxvt", model.ipCommunityProperties().delete().ipCommunityIds().get(0)); - Assertions.assertEquals("hwq", model.ipCommunityProperties().set().ipCommunityIds().get(0)); - Assertions - .assertEquals( - "wgftshfgmuxuqia", model.ipExtendedCommunityProperties().add().ipExtendedCommunityIds().get(0)); - Assertions.assertEquals("bg", model.ipExtendedCommunityProperties().delete().ipExtendedCommunityIds().get(0)); - Assertions - .assertEquals( - "xilozblkcrfldfl", model.ipExtendedCommunityProperties().set().ipExtendedCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StatementConditionPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StatementConditionPropertiesTests.java deleted file mode 100644 index c775ad470436..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StatementConditionPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyConditionType; -import com.azure.resourcemanager.managednetworkfabric.models.StatementConditionProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StatementConditionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StatementConditionProperties model = - BinaryData - .fromString( - "{\"type\":\"Or\",\"ipPrefixId\":\"nfff\",\"ipExtendedCommunityIds\":[\"daw\",\"lmlcufbbjiu\"],\"ipCommunityIds\":[\"fhoajjylsyqyjn\"]}") - .toObject(StatementConditionProperties.class); - Assertions.assertEquals("fhoajjylsyqyjn", model.ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.OR, model.type()); - Assertions.assertEquals("nfff", model.ipPrefixId()); - Assertions.assertEquals("daw", model.ipExtendedCommunityIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StatementConditionProperties model = - new StatementConditionProperties() - .withIpCommunityIds(Arrays.asList("fhoajjylsyqyjn")) - .withType(RoutePolicyConditionType.OR) - .withIpPrefixId("nfff") - .withIpExtendedCommunityIds(Arrays.asList("daw", "lmlcufbbjiu")); - model = BinaryData.fromObject(model).toObject(StatementConditionProperties.class); - Assertions.assertEquals("fhoajjylsyqyjn", model.ipCommunityIds().get(0)); - Assertions.assertEquals(RoutePolicyConditionType.OR, model.type()); - Assertions.assertEquals("nfff", model.ipPrefixId()); - Assertions.assertEquals("daw", model.ipExtendedCommunityIds().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StaticRouteConfigurationTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StaticRouteConfigurationTests.java deleted file mode 100644 index d2ed95b7ccb6..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StaticRouteConfigurationTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StaticRouteConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StaticRouteConfiguration model = - BinaryData - .fromString( - "{\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":720936037,\"multiplier\":337381733},\"ipv4Routes\":[{\"prefix\":\"bknlzcl\",\"nextHop\":[\"zeyowmndcovdwzqa\",\"xzanhmk\",\"fruwkud\",\"bcpftxudqyemebun\"]}],\"ipv6Routes\":[{\"prefix\":\"mcirtneemm\",\"nextHop\":[\"uwcgxefnoha\",\"tranizerwgu\"]},{\"prefix\":\"asmxubvfbngf\",\"nextHop\":[\"cefhpriylfmpzt\",\"aud\",\"vhl\",\"dculregp\"]}]}") - .toObject(StaticRouteConfiguration.class); - Assertions.assertEquals(720936037, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(337381733, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("bknlzcl", model.ipv4Routes().get(0).prefix()); - Assertions.assertEquals("zeyowmndcovdwzqa", model.ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("mcirtneemm", model.ipv6Routes().get(0).prefix()); - Assertions.assertEquals("uwcgxefnoha", model.ipv6Routes().get(0).nextHop().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StaticRouteConfiguration model = - new StaticRouteConfiguration() - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(720936037).withMultiplier(337381733)) - .withIpv4Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("bknlzcl") - .withNextHop( - Arrays.asList("zeyowmndcovdwzqa", "xzanhmk", "fruwkud", "bcpftxudqyemebun")))) - .withIpv6Routes( - Arrays - .asList( - new StaticRouteProperties() - .withPrefix("mcirtneemm") - .withNextHop(Arrays.asList("uwcgxefnoha", "tranizerwgu")), - new StaticRouteProperties() - .withPrefix("asmxubvfbngf") - .withNextHop(Arrays.asList("cefhpriylfmpzt", "aud", "vhl", "dculregp")))); - model = BinaryData.fromObject(model).toObject(StaticRouteConfiguration.class); - Assertions.assertEquals(720936037, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(337381733, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("bknlzcl", model.ipv4Routes().get(0).prefix()); - Assertions.assertEquals("zeyowmndcovdwzqa", model.ipv4Routes().get(0).nextHop().get(0)); - Assertions.assertEquals("mcirtneemm", model.ipv6Routes().get(0).prefix()); - Assertions.assertEquals("uwcgxefnoha", model.ipv6Routes().get(0).nextHop().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StaticRoutePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StaticRoutePropertiesTests.java deleted file mode 100644 index 9dbaf2061572..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/StaticRoutePropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StaticRoutePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StaticRouteProperties model = - BinaryData - .fromString("{\"prefix\":\"tmojhvrztnvgyshq\",\"nextHop\":[\"grt\",\"mewjzlpyk\"]}") - .toObject(StaticRouteProperties.class); - Assertions.assertEquals("tmojhvrztnvgyshq", model.prefix()); - Assertions.assertEquals("grt", model.nextHop().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StaticRouteProperties model = - new StaticRouteProperties().withPrefix("tmojhvrztnvgyshq").withNextHop(Arrays.asList("grt", "mewjzlpyk")); - model = BinaryData.fromObject(model).toObject(StaticRouteProperties.class); - Assertions.assertEquals("tmojhvrztnvgyshq", model.prefix()); - Assertions.assertEquals("grt", model.nextHop().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/SupportedConnectorPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/SupportedConnectorPropertiesTests.java deleted file mode 100644 index 273362fff732..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/SupportedConnectorPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.SupportedConnectorProperties; -import org.junit.jupiter.api.Assertions; - -public final class SupportedConnectorPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SupportedConnectorProperties model = - BinaryData - .fromString("{\"connectorType\":\"uw\",\"maxSpeedInMbps\":792068826}") - .toObject(SupportedConnectorProperties.class); - Assertions.assertEquals("uw", model.connectorType()); - Assertions.assertEquals(792068826, model.maxSpeedInMbps()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SupportedConnectorProperties model = - new SupportedConnectorProperties().withConnectorType("uw").withMaxSpeedInMbps(792068826); - model = BinaryData.fromObject(model).toObject(SupportedConnectorProperties.class); - Assertions.assertEquals("uw", model.connectorType()); - Assertions.assertEquals(792068826, model.maxSpeedInMbps()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/SupportedVersionPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/SupportedVersionPropertiesTests.java deleted file mode 100644 index d5e8c5f4551c..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/SupportedVersionPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; -import com.azure.resourcemanager.managednetworkfabric.models.SupportedVersionProperties; -import org.junit.jupiter.api.Assertions; - -public final class SupportedVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SupportedVersionProperties model = - BinaryData - .fromString( - "{\"version\":\"vorbalkjnbk\",\"vendorOsVersion\":\"h\",\"vendorFirmwareVersion\":\"tqstqkqsygxiyne\",\"isDefault\":\"False\"}") - .toObject(SupportedVersionProperties.class); - Assertions.assertEquals("vorbalkjnbk", model.version()); - Assertions.assertEquals("h", model.vendorOsVersion()); - Assertions.assertEquals("tqstqkqsygxiyne", model.vendorFirmwareVersion()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.isDefault()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SupportedVersionProperties model = - new SupportedVersionProperties() - .withVersion("vorbalkjnbk") - .withVendorOsVersion("h") - .withVendorFirmwareVersion("tqstqkqsygxiyne") - .withIsDefault(BooleanEnumProperty.FALSE); - model = BinaryData.fromObject(model).toObject(SupportedVersionProperties.class); - Assertions.assertEquals("vorbalkjnbk", model.version()); - Assertions.assertEquals("h", model.vendorOsVersion()); - Assertions.assertEquals("tqstqkqsygxiyne", model.vendorFirmwareVersion()); - Assertions.assertEquals(BooleanEnumProperty.FALSE, model.isDefault()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/TagsUpdateTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/TagsUpdateTests.java deleted file mode 100644 index 8b2a2e878424..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/TagsUpdateTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.TagsUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagsUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagsUpdate model = - BinaryData - .fromString( - "{\"tags\":{\"jjukyrdnqodxah\":\"emeluclv\",\"qnvzoqgyipemch\":\"xhqf\",\"lghwzhome\":\"avsczuejdtxp\"}}") - .toObject(TagsUpdate.class); - Assertions.assertEquals("emeluclv", model.tags().get("jjukyrdnqodxah")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagsUpdate model = - new TagsUpdate() - .withTags(mapOf("jjukyrdnqodxah", "emeluclv", "qnvzoqgyipemch", "xhqf", "lghwzhome", "avsczuejdtxp")); - model = BinaryData.fromObject(model).toObject(TagsUpdate.class); - Assertions.assertEquals("emeluclv", model.tags().get("jjukyrdnqodxah")); - } - - @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/UpdateAdministrativeStateTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/UpdateAdministrativeStateTests.java deleted file mode 100644 index b99a0a790056..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/UpdateAdministrativeStateTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateAdministrativeStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateAdministrativeState model = - BinaryData - .fromString("{\"state\":\"Enable\",\"resourceIds\":[\"rhvyeld\"]}") - .toObject(UpdateAdministrativeState.class); - Assertions.assertEquals("rhvyeld", model.resourceIds().get(0)); - Assertions.assertEquals(EnableDisableState.ENABLE, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateAdministrativeState model = - new UpdateAdministrativeState() - .withResourceIds(Arrays.asList("rhvyeld")) - .withState(EnableDisableState.ENABLE); - model = BinaryData.fromObject(model).toObject(UpdateAdministrativeState.class); - Assertions.assertEquals("rhvyeld", model.resourceIds().get(0)); - Assertions.assertEquals(EnableDisableState.ENABLE, model.state()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/UpdateDeviceAdministrativeStateTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/UpdateDeviceAdministrativeStateTests.java deleted file mode 100644 index 3063a3f0fdca..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/UpdateDeviceAdministrativeStateTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.DeviceAdministrativeState; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateDeviceAdministrativeState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateDeviceAdministrativeStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateDeviceAdministrativeState model = - BinaryData - .fromString("{\"state\":\"Resync\",\"resourceIds\":[\"cao\"]}") - .toObject(UpdateDeviceAdministrativeState.class); - Assertions.assertEquals("cao", model.resourceIds().get(0)); - Assertions.assertEquals(DeviceAdministrativeState.RESYNC, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateDeviceAdministrativeState model = - new UpdateDeviceAdministrativeState() - .withResourceIds(Arrays.asList("cao")) - .withState(DeviceAdministrativeState.RESYNC); - model = BinaryData.fromObject(model).toObject(UpdateDeviceAdministrativeState.class); - Assertions.assertEquals("cao", model.resourceIds().get(0)); - Assertions.assertEquals(DeviceAdministrativeState.RESYNC, model.state()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/UpdateVersionTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/UpdateVersionTests.java deleted file mode 100644 index a7906f9a8cf3..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/UpdateVersionTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersion; -import org.junit.jupiter.api.Assertions; - -public final class UpdateVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateVersion model = BinaryData.fromString("{\"version\":\"olbuauktwieope\"}").toObject(UpdateVersion.class); - Assertions.assertEquals("olbuauktwieope", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateVersion model = new UpdateVersion().withVersion("olbuauktwieope"); - model = BinaryData.fromObject(model).toObject(UpdateVersion.class); - Assertions.assertEquals("olbuauktwieope", model.version()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ValidateConfigurationPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ValidateConfigurationPropertiesTests.java deleted file mode 100644 index 946613ebda69..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ValidateConfigurationPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateAction; -import com.azure.resourcemanager.managednetworkfabric.models.ValidateConfigurationProperties; -import org.junit.jupiter.api.Assertions; - -public final class ValidateConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateConfigurationProperties model = - BinaryData - .fromString("{\"validateAction\":\"Connectivity\"}") - .toObject(ValidateConfigurationProperties.class); - Assertions.assertEquals(ValidateAction.CONNECTIVITY, model.validateAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateConfigurationProperties model = - new ValidateConfigurationProperties().withValidateAction(ValidateAction.CONNECTIVITY); - model = BinaryData.fromObject(model).toObject(ValidateConfigurationProperties.class); - Assertions.assertEquals(ValidateAction.CONNECTIVITY, model.validateAction()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ValidateConfigurationResponseInnerTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ValidateConfigurationResponseInnerTests.java deleted file mode 100644 index 549d10403439..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/ValidateConfigurationResponseInnerTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.fluent.models.ValidateConfigurationResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class ValidateConfigurationResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateConfigurationResponseInner model = - BinaryData - .fromString("{\"configurationState\":\"Rejected\",\"url\":\"kukjtasb\"}") - .toObject(ValidateConfigurationResponseInner.class); - Assertions.assertEquals("kukjtasb", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateConfigurationResponseInner model = new ValidateConfigurationResponseInner().withUrl("kukjtasb"); - model = BinaryData.fromObject(model).toObject(ValidateConfigurationResponseInner.class); - Assertions.assertEquals("kukjtasb", model.url()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VlanGroupPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VlanGroupPropertiesTests.java deleted file mode 100644 index 07d874c77d1e..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VlanGroupPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.VlanGroupProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VlanGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VlanGroupProperties model = - BinaryData - .fromString("{\"name\":\"xwaxfewzjkj\",\"vlans\":[\"deqvhp\",\"ylkkshkbffmbm\",\"zjrgyww\"]}") - .toObject(VlanGroupProperties.class); - Assertions.assertEquals("xwaxfewzjkj", model.name()); - Assertions.assertEquals("deqvhp", model.vlans().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VlanGroupProperties model = - new VlanGroupProperties() - .withName("xwaxfewzjkj") - .withVlans(Arrays.asList("deqvhp", "ylkkshkbffmbm", "zjrgyww")); - model = BinaryData.fromObject(model).toObject(VlanGroupProperties.class); - Assertions.assertEquals("xwaxfewzjkj", model.name()); - Assertions.assertEquals("deqvhp", model.vlans().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VlanMatchConditionTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VlanMatchConditionTests.java deleted file mode 100644 index a9be8cea4e43..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VlanMatchConditionTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.VlanMatchCondition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VlanMatchConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VlanMatchCondition model = - BinaryData - .fromString( - "{\"vlans\":[\"lfmk\",\"scazuawxtzxpu\"],\"innerVlans\":[\"abzxrvxcushsp\",\"aivmxyasflvgs\",\"zwywako\",\"hknsmjbl\"],\"vlanGroupNames\":[\"hlnymzotq\",\"ryuzcbmqqv\",\"mv\",\"fgtayxonsup\"]}") - .toObject(VlanMatchCondition.class); - Assertions.assertEquals("lfmk", model.vlans().get(0)); - Assertions.assertEquals("abzxrvxcushsp", model.innerVlans().get(0)); - Assertions.assertEquals("hlnymzotq", model.vlanGroupNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VlanMatchCondition model = - new VlanMatchCondition() - .withVlans(Arrays.asList("lfmk", "scazuawxtzxpu")) - .withInnerVlans(Arrays.asList("abzxrvxcushsp", "aivmxyasflvgs", "zwywako", "hknsmjbl")) - .withVlanGroupNames(Arrays.asList("hlnymzotq", "ryuzcbmqqv", "mv", "fgtayxonsup")); - model = BinaryData.fromObject(model).toObject(VlanMatchCondition.class); - Assertions.assertEquals("lfmk", model.vlans().get(0)); - Assertions.assertEquals("abzxrvxcushsp", model.innerVlans().get(0)); - Assertions.assertEquals("hlnymzotq", model.vlanGroupNames().get(0)); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPatchablePropertiesOptionAPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPatchablePropertiesOptionAPropertiesTests.java deleted file mode 100644 index 6d33aa6b8873..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPatchablePropertiesOptionAPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationPatchablePropertiesOptionAProperties; -import org.junit.jupiter.api.Assertions; - -public final class VpnConfigurationPatchablePropertiesOptionAPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VpnConfigurationPatchablePropertiesOptionAProperties model = - BinaryData - .fromString( - "{\"primaryIpv4Prefix\":\"sklkqnqvkixnm\",\"primaryIpv6Prefix\":\"mecuyrzwim\",\"secondaryIpv4Prefix\":\"ayspzvriet\",\"secondaryIpv6Prefix\":\"phmdzxplgtp\",\"mtu\":130554,\"vlanId\":1400650785,\"peerASN\":9083634510135709483,\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":1662288047,\"multiplier\":2022282106}}") - .toObject(VpnConfigurationPatchablePropertiesOptionAProperties.class); - Assertions.assertEquals(130554, model.mtu()); - Assertions.assertEquals(1400650785, model.vlanId()); - Assertions.assertEquals(9083634510135709483L, model.peerAsn()); - Assertions.assertEquals(1662288047, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(2022282106, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("sklkqnqvkixnm", model.primaryIpv4Prefix()); - Assertions.assertEquals("mecuyrzwim", model.primaryIpv6Prefix()); - Assertions.assertEquals("ayspzvriet", model.secondaryIpv4Prefix()); - Assertions.assertEquals("phmdzxplgtp", model.secondaryIpv6Prefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VpnConfigurationPatchablePropertiesOptionAProperties model = - new VpnConfigurationPatchablePropertiesOptionAProperties() - .withMtu(130554) - .withVlanId(1400650785) - .withPeerAsn(9083634510135709483L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1662288047).withMultiplier(2022282106)) - .withPrimaryIpv4Prefix("sklkqnqvkixnm") - .withPrimaryIpv6Prefix("mecuyrzwim") - .withSecondaryIpv4Prefix("ayspzvriet") - .withSecondaryIpv6Prefix("phmdzxplgtp"); - model = BinaryData.fromObject(model).toObject(VpnConfigurationPatchablePropertiesOptionAProperties.class); - Assertions.assertEquals(130554, model.mtu()); - Assertions.assertEquals(1400650785, model.vlanId()); - Assertions.assertEquals(9083634510135709483L, model.peerAsn()); - Assertions.assertEquals(1662288047, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(2022282106, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("sklkqnqvkixnm", model.primaryIpv4Prefix()); - Assertions.assertEquals("mecuyrzwim", model.primaryIpv6Prefix()); - Assertions.assertEquals("ayspzvriet", model.secondaryIpv4Prefix()); - Assertions.assertEquals("phmdzxplgtp", model.secondaryIpv6Prefix()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPatchablePropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPatchablePropertiesTests.java deleted file mode 100644 index 605b9de7debf..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPatchablePropertiesTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationPatchableProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationPatchablePropertiesOptionAProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VpnConfigurationPatchablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VpnConfigurationPatchableProperties model = - BinaryData - .fromString( - "{\"networkToNetworkInterconnectId\":\"gzrujlqc\",\"peeringOption\":\"OptionB\",\"optionBProperties\":{\"importRouteTargets\":[\"eiqbcbgvsbts\"],\"exportRouteTargets\":[\"oxa\",\"hxuvjhxm\",\"rqstjcme\",\"wmlgicvnpv\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"jnaqyq\",\"pslzmvcds\",\"mwbitekdtfo\"],\"importIpv6RouteTargets\":[\"iy\",\"x\",\"ich\"],\"exportIpv4RouteTargets\":[\"fzdqekiv\",\"cpzcvdizul\",\"qtbhtr\"],\"exportIpv6RouteTargets\":[\"zlp\"]}},\"optionAProperties\":{\"primaryIpv4Prefix\":\"mxmdutzfkgilnou\",\"primaryIpv6Prefix\":\"cgndjgdp\",\"secondaryIpv4Prefix\":\"ggqqyeqfcb\",\"secondaryIpv6Prefix\":\"lpyuflqjf\",\"mtu\":1679929434,\"vlanId\":446521105,\"peerASN\":4335062738283435533,\"bfdConfiguration\":{\"administrativeState\":\"RMA\",\"intervalInMilliSeconds\":1471378108,\"multiplier\":373324841}}}") - .toObject(VpnConfigurationPatchableProperties.class); - Assertions.assertEquals("gzrujlqc", model.networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONB, model.peeringOption()); - Assertions.assertEquals("eiqbcbgvsbts", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("oxa", model.optionBProperties().exportRouteTargets().get(0)); - Assertions.assertEquals("jnaqyq", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions.assertEquals("iy", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("fzdqekiv", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("zlp", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals(1679929434, model.optionAProperties().mtu()); - Assertions.assertEquals(446521105, model.optionAProperties().vlanId()); - Assertions.assertEquals(4335062738283435533L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(1471378108, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(373324841, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("mxmdutzfkgilnou", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("cgndjgdp", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("ggqqyeqfcb", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("lpyuflqjf", model.optionAProperties().secondaryIpv6Prefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VpnConfigurationPatchableProperties model = - new VpnConfigurationPatchableProperties() - .withNetworkToNetworkInterconnectId("gzrujlqc") - .withPeeringOption(PeeringOption.OPTIONB) - .withOptionBProperties( - new OptionBProperties() - .withImportRouteTargets(Arrays.asList("eiqbcbgvsbts")) - .withExportRouteTargets(Arrays.asList("oxa", "hxuvjhxm", "rqstjcme", "wmlgicvnpv")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("jnaqyq", "pslzmvcds", "mwbitekdtfo")) - .withImportIpv6RouteTargets(Arrays.asList("iy", "x", "ich")) - .withExportIpv4RouteTargets(Arrays.asList("fzdqekiv", "cpzcvdizul", "qtbhtr")) - .withExportIpv6RouteTargets(Arrays.asList("zlp")))) - .withOptionAProperties( - new VpnConfigurationPatchablePropertiesOptionAProperties() - .withMtu(1679929434) - .withVlanId(446521105) - .withPeerAsn(4335062738283435533L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1471378108).withMultiplier(373324841)) - .withPrimaryIpv4Prefix("mxmdutzfkgilnou") - .withPrimaryIpv6Prefix("cgndjgdp") - .withSecondaryIpv4Prefix("ggqqyeqfcb") - .withSecondaryIpv6Prefix("lpyuflqjf")); - model = BinaryData.fromObject(model).toObject(VpnConfigurationPatchableProperties.class); - Assertions.assertEquals("gzrujlqc", model.networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONB, model.peeringOption()); - Assertions.assertEquals("eiqbcbgvsbts", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("oxa", model.optionBProperties().exportRouteTargets().get(0)); - Assertions.assertEquals("jnaqyq", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions.assertEquals("iy", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("fzdqekiv", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("zlp", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals(1679929434, model.optionAProperties().mtu()); - Assertions.assertEquals(446521105, model.optionAProperties().vlanId()); - Assertions.assertEquals(4335062738283435533L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(1471378108, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(373324841, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("mxmdutzfkgilnou", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("cgndjgdp", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("ggqqyeqfcb", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("lpyuflqjf", model.optionAProperties().secondaryIpv6Prefix()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPropertiesOptionAPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPropertiesOptionAPropertiesTests.java deleted file mode 100644 index 6948c6c06384..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPropertiesOptionAPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationPropertiesOptionAProperties; -import org.junit.jupiter.api.Assertions; - -public final class VpnConfigurationPropertiesOptionAPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VpnConfigurationPropertiesOptionAProperties model = - BinaryData - .fromString( - "{\"primaryIpv4Prefix\":\"fdrld\",\"primaryIpv6Prefix\":\"ehi\",\"secondaryIpv4Prefix\":\"ttugyu\",\"secondaryIpv6Prefix\":\"rldaxurfqa\",\"mtu\":1770378356,\"vlanId\":270505616,\"peerASN\":8741394680932832379,\"bfdConfiguration\":{\"administrativeState\":\"MAT\",\"intervalInMilliSeconds\":1911629165,\"multiplier\":833458664}}") - .toObject(VpnConfigurationPropertiesOptionAProperties.class); - Assertions.assertEquals(1770378356, model.mtu()); - Assertions.assertEquals(270505616, model.vlanId()); - Assertions.assertEquals(8741394680932832379L, model.peerAsn()); - Assertions.assertEquals(1911629165, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(833458664, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("fdrld", model.primaryIpv4Prefix()); - Assertions.assertEquals("ehi", model.primaryIpv6Prefix()); - Assertions.assertEquals("ttugyu", model.secondaryIpv4Prefix()); - Assertions.assertEquals("rldaxurfqa", model.secondaryIpv6Prefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VpnConfigurationPropertiesOptionAProperties model = - new VpnConfigurationPropertiesOptionAProperties() - .withMtu(1770378356) - .withVlanId(270505616) - .withPeerAsn(8741394680932832379L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1911629165).withMultiplier(833458664)) - .withPrimaryIpv4Prefix("fdrld") - .withPrimaryIpv6Prefix("ehi") - .withSecondaryIpv4Prefix("ttugyu") - .withSecondaryIpv6Prefix("rldaxurfqa"); - model = BinaryData.fromObject(model).toObject(VpnConfigurationPropertiesOptionAProperties.class); - Assertions.assertEquals(1770378356, model.mtu()); - Assertions.assertEquals(270505616, model.vlanId()); - Assertions.assertEquals(8741394680932832379L, model.peerAsn()); - Assertions.assertEquals(1911629165, model.bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(833458664, model.bfdConfiguration().multiplier()); - Assertions.assertEquals("fdrld", model.primaryIpv4Prefix()); - Assertions.assertEquals("ehi", model.primaryIpv6Prefix()); - Assertions.assertEquals("ttugyu", model.secondaryIpv4Prefix()); - Assertions.assertEquals("rldaxurfqa", model.secondaryIpv6Prefix()); - } -} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPropertiesTests.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPropertiesTests.java deleted file mode 100644 index 5c8f98e62fa4..000000000000 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/test/java/com/azure/resourcemanager/managednetworkfabric/generated/VpnConfigurationPropertiesTests.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.managednetworkfabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; -import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; -import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; -import com.azure.resourcemanager.managednetworkfabric.models.RouteTargetInformation; -import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationProperties; -import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationPropertiesOptionAProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VpnConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VpnConfigurationProperties model = - BinaryData - .fromString( - "{\"networkToNetworkInterconnectId\":\"ecovs\",\"administrativeState\":\"Disabled\",\"peeringOption\":\"OptionA\",\"optionBProperties\":{\"importRouteTargets\":[\"bakrli\",\"zfvppkeq\"],\"exportRouteTargets\":[\"jmcl\",\"gygnhrkombc\",\"tajdopggorwjoqtr\",\"tpvclpofyrlmwk\"],\"routeTargets\":{\"importIpv4RouteTargets\":[\"wxjgvhxccbmkak\",\"kookbputmgvmuyak\"],\"importIpv6RouteTargets\":[\"ktfowzkroyrdur\"],\"exportIpv4RouteTargets\":[\"zqjim\",\"jtgzj\",\"xlfejlzuqloiwya\",\"yzivrm\"],\"exportIpv6RouteTargets\":[\"dql\"]}},\"optionAProperties\":{\"primaryIpv4Prefix\":\"whrktjleifibfipl\",\"primaryIpv6Prefix\":\"fnsmycjowly\",\"secondaryIpv4Prefix\":\"zmudsqcm\",\"secondaryIpv6Prefix\":\"x\",\"mtu\":841361482,\"vlanId\":1070639613,\"peerASN\":4200262547441135394,\"bfdConfiguration\":{\"administrativeState\":\"Disabled\",\"intervalInMilliSeconds\":1710079987,\"multiplier\":902786810}}}") - .toObject(VpnConfigurationProperties.class); - Assertions.assertEquals("ecovs", model.networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONA, model.peeringOption()); - Assertions.assertEquals("bakrli", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("jmcl", model.optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals("wxjgvhxccbmkak", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("ktfowzkroyrdur", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("zqjim", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("dql", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals(841361482, model.optionAProperties().mtu()); - Assertions.assertEquals(1070639613, model.optionAProperties().vlanId()); - Assertions.assertEquals(4200262547441135394L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(1710079987, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(902786810, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("whrktjleifibfipl", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("fnsmycjowly", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("zmudsqcm", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("x", model.optionAProperties().secondaryIpv6Prefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VpnConfigurationProperties model = - new VpnConfigurationProperties() - .withNetworkToNetworkInterconnectId("ecovs") - .withPeeringOption(PeeringOption.OPTIONA) - .withOptionBProperties( - new OptionBProperties() - .withImportRouteTargets(Arrays.asList("bakrli", "zfvppkeq")) - .withExportRouteTargets( - Arrays.asList("jmcl", "gygnhrkombc", "tajdopggorwjoqtr", "tpvclpofyrlmwk")) - .withRouteTargets( - new RouteTargetInformation() - .withImportIpv4RouteTargets(Arrays.asList("wxjgvhxccbmkak", "kookbputmgvmuyak")) - .withImportIpv6RouteTargets(Arrays.asList("ktfowzkroyrdur")) - .withExportIpv4RouteTargets( - Arrays.asList("zqjim", "jtgzj", "xlfejlzuqloiwya", "yzivrm")) - .withExportIpv6RouteTargets(Arrays.asList("dql")))) - .withOptionAProperties( - new VpnConfigurationPropertiesOptionAProperties() - .withMtu(841361482) - .withVlanId(1070639613) - .withPeerAsn(4200262547441135394L) - .withBfdConfiguration( - new BfdConfiguration().withIntervalInMilliSeconds(1710079987).withMultiplier(902786810)) - .withPrimaryIpv4Prefix("whrktjleifibfipl") - .withPrimaryIpv6Prefix("fnsmycjowly") - .withSecondaryIpv4Prefix("zmudsqcm") - .withSecondaryIpv6Prefix("x")); - model = BinaryData.fromObject(model).toObject(VpnConfigurationProperties.class); - Assertions.assertEquals("ecovs", model.networkToNetworkInterconnectId()); - Assertions.assertEquals(PeeringOption.OPTIONA, model.peeringOption()); - Assertions.assertEquals("bakrli", model.optionBProperties().importRouteTargets().get(0)); - Assertions.assertEquals("jmcl", model.optionBProperties().exportRouteTargets().get(0)); - Assertions - .assertEquals("wxjgvhxccbmkak", model.optionBProperties().routeTargets().importIpv4RouteTargets().get(0)); - Assertions - .assertEquals("ktfowzkroyrdur", model.optionBProperties().routeTargets().importIpv6RouteTargets().get(0)); - Assertions.assertEquals("zqjim", model.optionBProperties().routeTargets().exportIpv4RouteTargets().get(0)); - Assertions.assertEquals("dql", model.optionBProperties().routeTargets().exportIpv6RouteTargets().get(0)); - Assertions.assertEquals(841361482, model.optionAProperties().mtu()); - Assertions.assertEquals(1070639613, model.optionAProperties().vlanId()); - Assertions.assertEquals(4200262547441135394L, model.optionAProperties().peerAsn()); - Assertions.assertEquals(1710079987, model.optionAProperties().bfdConfiguration().intervalInMilliSeconds()); - Assertions.assertEquals(902786810, model.optionAProperties().bfdConfiguration().multiplier()); - Assertions.assertEquals("whrktjleifibfipl", model.optionAProperties().primaryIpv4Prefix()); - Assertions.assertEquals("fnsmycjowly", model.optionAProperties().primaryIpv6Prefix()); - Assertions.assertEquals("zmudsqcm", model.optionAProperties().secondaryIpv4Prefix()); - Assertions.assertEquals("x", model.optionAProperties().secondaryIpv6Prefix()); - } -}