From 70aaf24c849025299ade461df2460061e87a4e99 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 5 Aug 2023 01:41:00 +0000 Subject: [PATCH] CodeGen from PR 25192 in Azure/azure-rest-api-specs Merge 8e6fe97eb2cd166f8f164a41f3046d41daa67e0f into 0baf811c3c76c87b3c127d098519bd97141222dd --- .../CHANGELOG.md | 4 +- .../README.md | 4 +- .../SAMPLE.md | 2 +- .../reservations/ReservationsManager.java | 2 +- .../models/CurrentQuotaLimitBase.java | 7 + .../QuotaRequestStatusGetSamples.java | 2 +- .../AppliedReservationListTests.java | 34 --- .../AppliedReservationsInnerTests.java | 37 ---- .../AppliedReservationsPropertiesTests.java | 37 ---- .../AppliedScopePropertiesTests.java | 42 ---- .../AvailableScopePropertiesInnerTests.java | 42 ---- .../AvailableScopeRequestPropertiesTests.java | 29 --- .../generated/AvailableScopeRequestTests.java | 31 --- ...lculateExchangeRequestPropertiesTests.java | 166 --------------- .../CalculateExchangeRequestTests.java | 49 ----- ...CalculateRefundRequestPropertiesTests.java | 36 ---- .../CalculateRefundRequestTests.java | 43 ---- .../generated/CatalogsResultTests.java | 28 --- .../ChangeDirectoryRequestTests.java | 25 --- .../ChangeDirectoryResponseInnerTests.java | 59 ----- .../generated/ChangeDirectoryResultTests.java | 34 --- .../CurrentQuotaLimitBaseInnerTests.java | 45 ---- .../ExchangeRequestPropertiesTests.java | 25 --- .../generated/ExchangeRequestTests.java | 27 --- .../generated/MergePropertiesTests.java | 29 --- .../generated/MergeRequestTests.java | 31 --- .../generated/OperationDisplayTests.java | 39 ---- .../generated/OperationListTests.java | 61 ------ .../OperationResponseInnerTests.java | 52 ----- .../generated/OperationsListMockTests.java | 73 ------- .../generated/PatchModelTests.java | 69 ------ .../PatchPropertiesRenewPropertiesTests.java | 79 ------- .../generated/PatchPropertiesTests.java | 74 ------- ...ertiesReservedResourcePropertiesTests.java | 29 --- .../PurchaseRequestPropertiesTests.java | 88 -------- .../generated/PurchaseRequestTests.java | 95 --------- .../generated/QuotaLimitsTests.java | 71 ------- .../generated/QuotaPropertiesTests.java | 42 ---- .../QuotaRequestDetailsInnerTests.java | 46 ---- .../QuotaRequestDetailsListTests.java | 41 ---- .../QuotaRequestPropertiesTests.java | 51 ----- .../QuotaRequestStatusDetailsTests.java | 24 --- ...RequestStatusGetWithResponseMockTests.java | 76 ------- .../QuotaRequestStatusListMockTests.java | 78 ------- ...otaRequestSubmitResponse201InnerTests.java | 25 --- .../QuotasCreateOrUpdateMockTests.java | 84 -------- .../QuotasGetWithResponseMockTests.java | 75 ------- .../generated/QuotasListMockTests.java | 72 ------- .../RefundRequestPropertiesTests.java | 43 ---- .../generated/RefundRequestTests.java | 46 ---- .../generated/ReservationListTests.java | 201 ------------------ .../ReservationMergePropertiesTests.java | 33 --- .../generated/ReservationOrderListTests.java | 113 ---------- .../ReservationOrderResponseInnerTests.java | 90 -------- ...sChangeDirectoryWithResponseMockTests.java | 81 ------- ...rvationOrdersGetWithResponseMockTests.java | 83 -------- .../ReservationOrdersListMockTests.java | 86 -------- .../ReservationOrdersPurchaseMockTests.java | 115 ---------- .../ReservationSplitPropertiesTests.java | 34 --- .../generated/ReservationSummaryTests.java | 25 --- .../ReservationSwapPropertiesTests.java | 30 --- .../generated/ReservationToReturnTests.java | 29 --- ...ReservationUtilizationAggregatesTests.java | 25 --- ...ervationsArchiveWithResponseMockTests.java | 61 ------ .../ReservationsAvailableScopesMockTests.java | 74 ------- .../ReservationsListResultTests.java | 26 --- .../generated/ReservationsMergeMockTests.java | 114 ---------- ...eservationsPropertiesUtilizationTests.java | 30 --- .../generated/ReservationsSplitMockTests.java | 116 ---------- ...vationsUnarchiveWithResponseMockTests.java | 61 ------ .../generated/ResourceNameTests.java | 25 --- ...dReservationListWithResponseMockTests.java | 70 ------ .../generated/ReturnsPostMockTests.java | 97 --------- .../generated/ScopePropertiesTests.java | 27 --- .../generated/SkuCapabilityTests.java | 27 --- .../reservations/generated/SkuNameTests.java | 24 --- .../generated/SkuPropertyTests.java | 27 --- .../generated/SplitPropertiesTests.java | 33 --- .../generated/SplitRequestTests.java | 34 --- .../generated/SubRequestTests.java | 38 ---- .../SubscriptionScopePropertiesTests.java | 39 ---- 81 files changed, 16 insertions(+), 4155 deletions(-) delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationListTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsInnerTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedScopePropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopePropertiesInnerTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateExchangeRequestPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateExchangeRequestTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CatalogsResultTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryRequestTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResponseInnerTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResultTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CurrentQuotaLimitBaseInnerTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergePropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergeRequestTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationDisplayTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationListTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationResponseInnerTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationsListMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchModelTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesRenewPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesReservedResourcePropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaLimitsTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsInnerTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsListTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusDetailsTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetWithResponseMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestSubmitResponse201InnerTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasCreateOrUpdateMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasGetWithResponseMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasListMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationListTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationMergePropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrderListTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrderResponseInnerTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersChangeDirectoryWithResponseMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersGetWithResponseMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersListMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersPurchaseMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSplitPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSummaryTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSwapPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationToReturnTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationUtilizationAggregatesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsArchiveWithResponseMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsAvailableScopesMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsListResultTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsMergeMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsPropertiesUtilizationTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsSplitMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsUnarchiveWithResponseMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceNameTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceProvidersGetAppliedReservationListWithResponseMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReturnsPostMockTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ScopePropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuCapabilityTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuNameTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuPropertyTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitPropertiesTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitRequestTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubRequestTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubscriptionScopePropertiesTests.java diff --git a/sdk/reservations/azure-resourcemanager-reservations/CHANGELOG.md b/sdk/reservations/azure-resourcemanager-reservations/CHANGELOG.md index 92c0da986410..ba0eddf9275a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/CHANGELOG.md +++ b/sdk/reservations/azure-resourcemanager-reservations/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2023-08-05) + +- Azure Resource Manager reservations client library for Java. This package contains Microsoft Azure SDK for reservations Management SDK. This API describe Azure Reservation. Package tag package-2022-11. 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/reservations/azure-resourcemanager-reservations/README.md b/sdk/reservations/azure-resourcemanager-reservations/README.md index 80ac9a4845e9..4fa25f6ae3d5 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/README.md +++ b/sdk/reservations/azure-resourcemanager-reservations/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-reservations - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Freservations%2Fazure-resourcemanager-reservations%2FREADME.png) diff --git a/sdk/reservations/azure-resourcemanager-reservations/SAMPLE.md b/sdk/reservations/azure-resourcemanager-reservations/SAMPLE.md index d3cdfabcd097..51e97dceb4f0 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/SAMPLE.md +++ b/sdk/reservations/azure-resourcemanager-reservations/SAMPLE.md @@ -473,7 +473,7 @@ public final class QuotaRequestStatusGetSamples { .getWithResponse( "00000000-0000-0000-0000-000000000000", "Microsoft.Compute", - "eastus", + "westus", "2B5C8515-37D8-4B6A-879B-CD641A2CF605", com.azure.core.util.Context.NONE); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/ReservationsManager.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/ReservationsManager.java index cb41b0e7501a..18a4f7dfa952 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/ReservationsManager.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/ReservationsManager.java @@ -238,7 +238,7 @@ public ReservationsManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.reservations") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CurrentQuotaLimitBase.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CurrentQuotaLimitBase.java index 17cc5728bba7..c0090c4e999a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CurrentQuotaLimitBase.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CurrentQuotaLimitBase.java @@ -48,11 +48,13 @@ public interface CurrentQuotaLimitBase { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The CurrentQuotaLimitBase definition stages. */ interface DefinitionStages { /** The first stage of the CurrentQuotaLimitBase definition. */ interface Blank extends WithParentResource { } + /** The stage of the CurrentQuotaLimitBase definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -65,6 +67,7 @@ interface WithParentResource { */ WithCreate withExistingLocation(String subscriptionId, String providerId, String location); } + /** * The stage of the CurrentQuotaLimitBase definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -85,6 +88,7 @@ interface WithCreate extends DefinitionStages.WithProperties { */ CurrentQuotaLimitBase create(Context context); } + /** The stage of the CurrentQuotaLimitBase definition allowing to specify properties. */ interface WithProperties { /** @@ -96,6 +100,7 @@ interface WithProperties { WithCreate withProperties(QuotaProperties properties); } } + /** * Begins update for the CurrentQuotaLimitBase resource. * @@ -120,6 +125,7 @@ interface Update extends UpdateStages.WithProperties { */ CurrentQuotaLimitBase apply(Context context); } + /** The CurrentQuotaLimitBase update stages. */ interface UpdateStages { /** The stage of the CurrentQuotaLimitBase update allowing to specify properties. */ @@ -133,6 +139,7 @@ interface WithProperties { Update withProperties(QuotaProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetSamples.java index a2458ce9b281..eee90a3a0e0a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetSamples.java @@ -58,7 +58,7 @@ public static void quotaRequestInProgress(com.azure.resourcemanager.reservations .getWithResponse( "00000000-0000-0000-0000-000000000000", "Microsoft.Compute", - "eastus", + "westus", "2B5C8515-37D8-4B6A-879B-CD641A2CF605", com.azure.core.util.Context.NONE); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationListTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationListTests.java deleted file mode 100644 index 33d218aac6a5..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationListTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.AppliedReservationList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AppliedReservationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AppliedReservationList model = - BinaryData - .fromString( - "{\"value\":[\"xth\",\"o\",\"usivye\",\"cciqihnhungbwjz\"],\"nextLink\":\"fygxgispemvtzfk\"}") - .toObject(AppliedReservationList.class); - Assertions.assertEquals("xth", model.value().get(0)); - Assertions.assertEquals("fygxgispemvtzfk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppliedReservationList model = - new AppliedReservationList() - .withValue(Arrays.asList("xth", "o", "usivye", "cciqihnhungbwjz")) - .withNextLink("fygxgispemvtzfk"); - model = BinaryData.fromObject(model).toObject(AppliedReservationList.class); - Assertions.assertEquals("xth", model.value().get(0)); - Assertions.assertEquals("fygxgispemvtzfk", model.nextLink()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsInnerTests.java deleted file mode 100644 index 8cceeac44e7d..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsInnerTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.AppliedReservationsInner; -import com.azure.resourcemanager.reservations.models.AppliedReservationList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AppliedReservationsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AppliedReservationsInner model = - BinaryData - .fromString( - "{\"id\":\"fdfdosygexpa\",\"name\":\"akhmsbzjhcrz\",\"type\":\"dphlxaolt\",\"properties\":{\"reservationOrderIds\":{\"value\":[\"qjbpfzfsin\",\"gvfcj\",\"wzo\"],\"nextLink\":\"j\"}}}") - .toObject(AppliedReservationsInner.class); - Assertions.assertEquals("qjbpfzfsin", model.reservationOrderIds().value().get(0)); - Assertions.assertEquals("j", model.reservationOrderIds().nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppliedReservationsInner model = - new AppliedReservationsInner() - .withReservationOrderIds( - new AppliedReservationList() - .withValue(Arrays.asList("qjbpfzfsin", "gvfcj", "wzo")) - .withNextLink("j")); - model = BinaryData.fromObject(model).toObject(AppliedReservationsInner.class); - Assertions.assertEquals("qjbpfzfsin", model.reservationOrderIds().value().get(0)); - Assertions.assertEquals("j", model.reservationOrderIds().nextLink()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsPropertiesTests.java deleted file mode 100644 index fffa9f521f80..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.AppliedReservationsProperties; -import com.azure.resourcemanager.reservations.models.AppliedReservationList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AppliedReservationsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AppliedReservationsProperties model = - BinaryData - .fromString( - "{\"reservationOrderIds\":{\"value\":[\"luwfzitonpeqfpjk\",\"lxofpdvhpfxxypin\",\"nmayhuybb\",\"podepoo\"],\"nextLink\":\"nuvamiheogna\"}}") - .toObject(AppliedReservationsProperties.class); - Assertions.assertEquals("luwfzitonpeqfpjk", model.reservationOrderIds().value().get(0)); - Assertions.assertEquals("nuvamiheogna", model.reservationOrderIds().nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppliedReservationsProperties model = - new AppliedReservationsProperties() - .withReservationOrderIds( - new AppliedReservationList() - .withValue(Arrays.asList("luwfzitonpeqfpjk", "lxofpdvhpfxxypin", "nmayhuybb", "podepoo")) - .withNextLink("nuvamiheogna")); - model = BinaryData.fromObject(model).toObject(AppliedReservationsProperties.class); - Assertions.assertEquals("luwfzitonpeqfpjk", model.reservationOrderIds().value().get(0)); - Assertions.assertEquals("nuvamiheogna", model.reservationOrderIds().nextLink()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedScopePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedScopePropertiesTests.java deleted file mode 100644 index 7d6b2e34acbc..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedScopePropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.AppliedScopeProperties; -import org.junit.jupiter.api.Assertions; - -public final class AppliedScopePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AppliedScopeProperties model = - BinaryData - .fromString( - "{\"tenantId\":\"qsrxybzqqed\",\"managementGroupId\":\"tbciqfouflmm\",\"subscriptionId\":\"zsm\",\"resourceGroupId\":\"mglougpbkw\",\"displayName\":\"utduqktapspwgcu\"}") - .toObject(AppliedScopeProperties.class); - Assertions.assertEquals("qsrxybzqqed", model.tenantId()); - Assertions.assertEquals("tbciqfouflmm", model.managementGroupId()); - Assertions.assertEquals("zsm", model.subscriptionId()); - Assertions.assertEquals("mglougpbkw", model.resourceGroupId()); - Assertions.assertEquals("utduqktapspwgcu", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppliedScopeProperties model = - new AppliedScopeProperties() - .withTenantId("qsrxybzqqed") - .withManagementGroupId("tbciqfouflmm") - .withSubscriptionId("zsm") - .withResourceGroupId("mglougpbkw") - .withDisplayName("utduqktapspwgcu"); - model = BinaryData.fromObject(model).toObject(AppliedScopeProperties.class); - Assertions.assertEquals("qsrxybzqqed", model.tenantId()); - Assertions.assertEquals("tbciqfouflmm", model.managementGroupId()); - Assertions.assertEquals("zsm", model.subscriptionId()); - Assertions.assertEquals("mglougpbkw", model.resourceGroupId()); - Assertions.assertEquals("utduqktapspwgcu", model.displayName()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopePropertiesInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopePropertiesInnerTests.java deleted file mode 100644 index c62e591050fa..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopePropertiesInnerTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.AvailableScopePropertiesInner; -import com.azure.resourcemanager.reservations.models.ScopeProperties; -import com.azure.resourcemanager.reservations.models.SubscriptionScopeProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvailableScopePropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableScopePropertiesInner model = - BinaryData - .fromString( - "{\"properties\":{\"scopes\":[{\"scope\":\"xbmtqioqjz\",\"valid\":false},{\"scope\":\"muf\",\"valid\":false},{\"scope\":\"oizh\",\"valid\":false}]}}") - .toObject(AvailableScopePropertiesInner.class); - Assertions.assertEquals("xbmtqioqjz", model.properties().scopes().get(0).scope()); - Assertions.assertEquals(false, model.properties().scopes().get(0).valid()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableScopePropertiesInner model = - new AvailableScopePropertiesInner() - .withProperties( - new SubscriptionScopeProperties() - .withScopes( - Arrays - .asList( - new ScopeProperties().withScope("xbmtqioqjz").withValid(false), - new ScopeProperties().withScope("muf").withValid(false), - new ScopeProperties().withScope("oizh").withValid(false)))); - model = BinaryData.fromObject(model).toObject(AvailableScopePropertiesInner.class); - Assertions.assertEquals("xbmtqioqjz", model.properties().scopes().get(0).scope()); - Assertions.assertEquals(false, model.properties().scopes().get(0).valid()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestPropertiesTests.java deleted file mode 100644 index c6893f3f056f..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.AvailableScopeRequestProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvailableScopeRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableScopeRequestProperties model = - BinaryData - .fromString("{\"scopes\":[\"zopbsphrupidgs\",\"bb\",\"jhphoyc\",\"sx\"]}") - .toObject(AvailableScopeRequestProperties.class); - Assertions.assertEquals("zopbsphrupidgs", model.scopes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableScopeRequestProperties model = - new AvailableScopeRequestProperties().withScopes(Arrays.asList("zopbsphrupidgs", "bb", "jhphoyc", "sx")); - model = BinaryData.fromObject(model).toObject(AvailableScopeRequestProperties.class); - Assertions.assertEquals("zopbsphrupidgs", model.scopes().get(0)); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestTests.java deleted file mode 100644 index b4cc0ee5aa24..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.AvailableScopeRequest; -import com.azure.resourcemanager.reservations.models.AvailableScopeRequestProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvailableScopeRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableScopeRequest model = - BinaryData - .fromString("{\"properties\":{\"scopes\":[\"quvgjxpybczme\"]}}") - .toObject(AvailableScopeRequest.class); - Assertions.assertEquals("quvgjxpybczme", model.properties().scopes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableScopeRequest model = - new AvailableScopeRequest() - .withProperties(new AvailableScopeRequestProperties().withScopes(Arrays.asList("quvgjxpybczme"))); - model = BinaryData.fromObject(model).toObject(AvailableScopeRequest.class); - Assertions.assertEquals("quvgjxpybczme", model.properties().scopes().get(0)); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateExchangeRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateExchangeRequestPropertiesTests.java deleted file mode 100644 index 5603884b8411..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateExchangeRequestPropertiesTests.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.AppliedScopeType; -import com.azure.resourcemanager.reservations.models.BillingPlan; -import com.azure.resourcemanager.reservations.models.CalculateExchangeRequestProperties; -import com.azure.resourcemanager.reservations.models.PurchaseRequest; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import com.azure.resourcemanager.reservations.models.ReservationToReturn; -import com.azure.resourcemanager.reservations.models.ReservedResourceType; -import com.azure.resourcemanager.reservations.models.SavingsPlanPurchaseRequest; -import com.azure.resourcemanager.reservations.models.SavingsPlanTerm; -import com.azure.resourcemanager.reservations.models.SkuName; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CalculateExchangeRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CalculateExchangeRequestProperties model = - BinaryData - .fromString( - "{\"reservationsToPurchase\":[{\"sku\":{\"name\":\"jdauwhvy\"},\"location\":\"zbtd\",\"properties\":{\"reservedResourceType\":\"AVS\",\"billingScopeId\":\"nbmpowuwprzq\",\"term\":\"P5Y\",\"billingPlan\":\"Upfront\",\"quantity\":1056372950,\"displayName\":\"j\",\"appliedScopeType\":\"ManagementGroup\",\"appliedScopes\":[],\"renew\":true,\"reviewDateTime\":\"2021-07-16T11:10Z\"}},{\"sku\":{\"name\":\"rtjriplrbpbew\"},\"location\":\"hfgblc\",\"properties\":{\"reservedResourceType\":\"AzureFiles\",\"billingScopeId\":\"lvqhjkbegibtnmx\",\"term\":\"P3Y\",\"billingPlan\":\"Monthly\",\"quantity\":2134442960,\"displayName\":\"ayqcgw\",\"appliedScopeType\":\"ManagementGroup\",\"appliedScopes\":[],\"renew\":false,\"reviewDateTime\":\"2021-09-03T04:43:16Z\"}},{\"sku\":{\"name\":\"txon\"},\"location\":\"ts\",\"properties\":{\"reservedResourceType\":\"AppService\",\"billingScopeId\":\"pwxqp\",\"term\":\"P1Y\",\"billingPlan\":\"Upfront\",\"quantity\":810124654,\"displayName\":\"vriuhprwmdyvx\",\"appliedScopeType\":\"Shared\",\"appliedScopes\":[],\"renew\":false,\"reviewDateTime\":\"2021-09-24T13:27:45Z\"}},{\"sku\":{\"name\":\"bexrmcq\"},\"location\":\"ycnojvknmefqsg\",\"properties\":{\"reservedResourceType\":\"VirtualMachines\",\"billingScopeId\":\"pjyzhpv\",\"term\":\"P3Y\",\"billingPlan\":\"Upfront\",\"quantity\":1630309887,\"displayName\":\"djzlmwlx\",\"appliedScopeType\":\"Shared\",\"appliedScopes\":[],\"renew\":false,\"reviewDateTime\":\"2021-10-22T04:54:45Z\"}}],\"savingsPlansToPurchase\":[{\"sku\":{\"name\":\"u\"},\"properties\":{\"displayName\":\"thnnpr\",\"billingScopeId\":\"i\",\"term\":\"P3Y\",\"billingPlan\":\"P1M\",\"appliedScopeType\":\"ManagementGroup\"}},{\"sku\":{\"name\":\"xdult\"},\"properties\":{\"displayName\":\"bbtdzumvee\",\"billingScopeId\":\"pwo\",\"term\":\"P1Y\",\"billingPlan\":\"P1M\",\"appliedScopeType\":\"Single\"}},{\"sku\":{\"name\":\"f\"},\"properties\":{\"displayName\":\"uusdttouwa\",\"billingScopeId\":\"ekqvkeln\",\"term\":\"P3Y\",\"billingPlan\":\"P1M\",\"appliedScopeType\":\"ManagementGroup\"}}],\"reservationsToExchange\":[{\"reservationId\":\"hcaalnjix\",\"quantity\":1143509001}]}") - .toObject(CalculateExchangeRequestProperties.class); - Assertions.assertEquals("jdauwhvy", model.reservationsToPurchase().get(0).sku().name()); - Assertions.assertEquals("zbtd", model.reservationsToPurchase().get(0).location()); - Assertions.assertEquals(ReservedResourceType.AVS, model.reservationsToPurchase().get(0).reservedResourceType()); - Assertions.assertEquals("nbmpowuwprzq", model.reservationsToPurchase().get(0).billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.reservationsToPurchase().get(0).term()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.reservationsToPurchase().get(0).billingPlan()); - Assertions.assertEquals(1056372950, model.reservationsToPurchase().get(0).quantity()); - Assertions.assertEquals("j", model.reservationsToPurchase().get(0).displayName()); - Assertions - .assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.reservationsToPurchase().get(0).appliedScopeType()); - Assertions.assertEquals(true, model.reservationsToPurchase().get(0).renew()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-07-16T11:10Z"), model.reservationsToPurchase().get(0).reviewDateTime()); - Assertions.assertEquals("u", model.savingsPlansToPurchase().get(0).sku().name()); - Assertions.assertEquals("thnnpr", model.savingsPlansToPurchase().get(0).displayName()); - Assertions.assertEquals("i", model.savingsPlansToPurchase().get(0).billingScopeId()); - Assertions.assertEquals(SavingsPlanTerm.P3Y, model.savingsPlansToPurchase().get(0).term()); - Assertions.assertEquals(BillingPlan.P1M, model.savingsPlansToPurchase().get(0).billingPlan()); - Assertions - .assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.savingsPlansToPurchase().get(0).appliedScopeType()); - Assertions.assertEquals("hcaalnjix", model.reservationsToExchange().get(0).reservationId()); - Assertions.assertEquals(1143509001, model.reservationsToExchange().get(0).quantity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CalculateExchangeRequestProperties model = - new CalculateExchangeRequestProperties() - .withReservationsToPurchase( - Arrays - .asList( - new PurchaseRequest() - .withSku(new SkuName().withName("jdauwhvy")) - .withLocation("zbtd") - .withReservedResourceType(ReservedResourceType.AVS) - .withBillingScopeId("nbmpowuwprzq") - .withTerm(ReservationTerm.P5Y) - .withBillingPlan(ReservationBillingPlan.UPFRONT) - .withQuantity(1056372950) - .withDisplayName("j") - .withAppliedScopeType(AppliedScopeType.MANAGEMENT_GROUP) - .withAppliedScopes(Arrays.asList()) - .withRenew(true) - .withReviewDateTime(OffsetDateTime.parse("2021-07-16T11:10Z")), - new PurchaseRequest() - .withSku(new SkuName().withName("rtjriplrbpbew")) - .withLocation("hfgblc") - .withReservedResourceType(ReservedResourceType.AZURE_FILES) - .withBillingScopeId("lvqhjkbegibtnmx") - .withTerm(ReservationTerm.P3Y) - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withQuantity(2134442960) - .withDisplayName("ayqcgw") - .withAppliedScopeType(AppliedScopeType.MANAGEMENT_GROUP) - .withAppliedScopes(Arrays.asList()) - .withRenew(false) - .withReviewDateTime(OffsetDateTime.parse("2021-09-03T04:43:16Z")), - new PurchaseRequest() - .withSku(new SkuName().withName("txon")) - .withLocation("ts") - .withReservedResourceType(ReservedResourceType.APP_SERVICE) - .withBillingScopeId("pwxqp") - .withTerm(ReservationTerm.P1Y) - .withBillingPlan(ReservationBillingPlan.UPFRONT) - .withQuantity(810124654) - .withDisplayName("vriuhprwmdyvx") - .withAppliedScopeType(AppliedScopeType.SHARED) - .withAppliedScopes(Arrays.asList()) - .withRenew(false) - .withReviewDateTime(OffsetDateTime.parse("2021-09-24T13:27:45Z")), - new PurchaseRequest() - .withSku(new SkuName().withName("bexrmcq")) - .withLocation("ycnojvknmefqsg") - .withReservedResourceType(ReservedResourceType.VIRTUAL_MACHINES) - .withBillingScopeId("pjyzhpv") - .withTerm(ReservationTerm.P3Y) - .withBillingPlan(ReservationBillingPlan.UPFRONT) - .withQuantity(1630309887) - .withDisplayName("djzlmwlx") - .withAppliedScopeType(AppliedScopeType.SHARED) - .withAppliedScopes(Arrays.asList()) - .withRenew(false) - .withReviewDateTime(OffsetDateTime.parse("2021-10-22T04:54:45Z")))) - .withSavingsPlansToPurchase( - Arrays - .asList( - new SavingsPlanPurchaseRequest() - .withSku(new SkuName().withName("u")) - .withDisplayName("thnnpr") - .withBillingScopeId("i") - .withTerm(SavingsPlanTerm.P3Y) - .withBillingPlan(BillingPlan.P1M) - .withAppliedScopeType(AppliedScopeType.MANAGEMENT_GROUP), - new SavingsPlanPurchaseRequest() - .withSku(new SkuName().withName("xdult")) - .withDisplayName("bbtdzumvee") - .withBillingScopeId("pwo") - .withTerm(SavingsPlanTerm.P1Y) - .withBillingPlan(BillingPlan.P1M) - .withAppliedScopeType(AppliedScopeType.SINGLE), - new SavingsPlanPurchaseRequest() - .withSku(new SkuName().withName("f")) - .withDisplayName("uusdttouwa") - .withBillingScopeId("ekqvkeln") - .withTerm(SavingsPlanTerm.P3Y) - .withBillingPlan(BillingPlan.P1M) - .withAppliedScopeType(AppliedScopeType.MANAGEMENT_GROUP))) - .withReservationsToExchange( - Arrays.asList(new ReservationToReturn().withReservationId("hcaalnjix").withQuantity(1143509001))); - model = BinaryData.fromObject(model).toObject(CalculateExchangeRequestProperties.class); - Assertions.assertEquals("jdauwhvy", model.reservationsToPurchase().get(0).sku().name()); - Assertions.assertEquals("zbtd", model.reservationsToPurchase().get(0).location()); - Assertions.assertEquals(ReservedResourceType.AVS, model.reservationsToPurchase().get(0).reservedResourceType()); - Assertions.assertEquals("nbmpowuwprzq", model.reservationsToPurchase().get(0).billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.reservationsToPurchase().get(0).term()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.reservationsToPurchase().get(0).billingPlan()); - Assertions.assertEquals(1056372950, model.reservationsToPurchase().get(0).quantity()); - Assertions.assertEquals("j", model.reservationsToPurchase().get(0).displayName()); - Assertions - .assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.reservationsToPurchase().get(0).appliedScopeType()); - Assertions.assertEquals(true, model.reservationsToPurchase().get(0).renew()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-07-16T11:10Z"), model.reservationsToPurchase().get(0).reviewDateTime()); - Assertions.assertEquals("u", model.savingsPlansToPurchase().get(0).sku().name()); - Assertions.assertEquals("thnnpr", model.savingsPlansToPurchase().get(0).displayName()); - Assertions.assertEquals("i", model.savingsPlansToPurchase().get(0).billingScopeId()); - Assertions.assertEquals(SavingsPlanTerm.P3Y, model.savingsPlansToPurchase().get(0).term()); - Assertions.assertEquals(BillingPlan.P1M, model.savingsPlansToPurchase().get(0).billingPlan()); - Assertions - .assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.savingsPlansToPurchase().get(0).appliedScopeType()); - Assertions.assertEquals("hcaalnjix", model.reservationsToExchange().get(0).reservationId()); - Assertions.assertEquals(1143509001, model.reservationsToExchange().get(0).quantity()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateExchangeRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateExchangeRequestTests.java deleted file mode 100644 index 522e7cf0d61b..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateExchangeRequestTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.CalculateExchangeRequest; -import com.azure.resourcemanager.reservations.models.CalculateExchangeRequestProperties; -import com.azure.resourcemanager.reservations.models.PurchaseRequest; -import com.azure.resourcemanager.reservations.models.ReservationToReturn; -import com.azure.resourcemanager.reservations.models.SavingsPlanPurchaseRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CalculateExchangeRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CalculateExchangeRequest model = - BinaryData - .fromString( - "{\"properties\":{\"reservationsToPurchase\":[{\"location\":\"jgjrwjueiotwm\"},{\"location\":\"dxwitx\"},{\"location\":\"wgqwgxhn\"}],\"savingsPlansToPurchase\":[{}],\"reservationsToExchange\":[{\"reservationId\":\"cg\",\"quantity\":1567456771}]}}") - .toObject(CalculateExchangeRequest.class); - Assertions.assertEquals("jgjrwjueiotwm", model.properties().reservationsToPurchase().get(0).location()); - Assertions.assertEquals("cg", model.properties().reservationsToExchange().get(0).reservationId()); - Assertions.assertEquals(1567456771, model.properties().reservationsToExchange().get(0).quantity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CalculateExchangeRequest model = - new CalculateExchangeRequest() - .withProperties( - new CalculateExchangeRequestProperties() - .withReservationsToPurchase( - Arrays - .asList( - new PurchaseRequest().withLocation("jgjrwjueiotwm"), - new PurchaseRequest().withLocation("dxwitx"), - new PurchaseRequest().withLocation("wgqwgxhn"))) - .withSavingsPlansToPurchase(Arrays.asList(new SavingsPlanPurchaseRequest())) - .withReservationsToExchange( - Arrays.asList(new ReservationToReturn().withReservationId("cg").withQuantity(1567456771)))); - model = BinaryData.fromObject(model).toObject(CalculateExchangeRequest.class); - Assertions.assertEquals("jgjrwjueiotwm", model.properties().reservationsToPurchase().get(0).location()); - Assertions.assertEquals("cg", model.properties().reservationsToExchange().get(0).reservationId()); - Assertions.assertEquals(1567456771, model.properties().reservationsToExchange().get(0).quantity()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestPropertiesTests.java deleted file mode 100644 index 8e39f9f9537f..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.CalculateRefundRequestProperties; -import com.azure.resourcemanager.reservations.models.ReservationToReturn; -import org.junit.jupiter.api.Assertions; - -public final class CalculateRefundRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CalculateRefundRequestProperties model = - BinaryData - .fromString( - "{\"scope\":\"bglaocqxtccm\",\"reservationToReturn\":{\"reservationId\":\"dxyt\",\"quantity\":2080912340}}") - .toObject(CalculateRefundRequestProperties.class); - Assertions.assertEquals("bglaocqxtccm", model.scope()); - Assertions.assertEquals("dxyt", model.reservationToReturn().reservationId()); - Assertions.assertEquals(2080912340, model.reservationToReturn().quantity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CalculateRefundRequestProperties model = - new CalculateRefundRequestProperties() - .withScope("bglaocqxtccm") - .withReservationToReturn(new ReservationToReturn().withReservationId("dxyt").withQuantity(2080912340)); - model = BinaryData.fromObject(model).toObject(CalculateRefundRequestProperties.class); - Assertions.assertEquals("bglaocqxtccm", model.scope()); - Assertions.assertEquals("dxyt", model.reservationToReturn().reservationId()); - Assertions.assertEquals(2080912340, model.reservationToReturn().quantity()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestTests.java deleted file mode 100644 index 5b4e8b558440..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.CalculateRefundRequest; -import com.azure.resourcemanager.reservations.models.CalculateRefundRequestProperties; -import com.azure.resourcemanager.reservations.models.ReservationToReturn; -import org.junit.jupiter.api.Assertions; - -public final class CalculateRefundRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CalculateRefundRequest model = - BinaryData - .fromString( - "{\"id\":\"pabgyeps\",\"properties\":{\"scope\":\"azqugxywpmueefj\",\"reservationToReturn\":{\"reservationId\":\"qkqujidsu\",\"quantity\":168254793}}}") - .toObject(CalculateRefundRequest.class); - Assertions.assertEquals("pabgyeps", model.id()); - Assertions.assertEquals("azqugxywpmueefj", model.properties().scope()); - Assertions.assertEquals("qkqujidsu", model.properties().reservationToReturn().reservationId()); - Assertions.assertEquals(168254793, model.properties().reservationToReturn().quantity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CalculateRefundRequest model = - new CalculateRefundRequest() - .withId("pabgyeps") - .withProperties( - new CalculateRefundRequestProperties() - .withScope("azqugxywpmueefj") - .withReservationToReturn( - new ReservationToReturn().withReservationId("qkqujidsu").withQuantity(168254793))); - model = BinaryData.fromObject(model).toObject(CalculateRefundRequest.class); - Assertions.assertEquals("pabgyeps", model.id()); - Assertions.assertEquals("azqugxywpmueefj", model.properties().scope()); - Assertions.assertEquals("qkqujidsu", model.properties().reservationToReturn().reservationId()); - Assertions.assertEquals(168254793, model.properties().reservationToReturn().quantity()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CatalogsResultTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CatalogsResultTests.java deleted file mode 100644 index 9a2263bd8dcd..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CatalogsResultTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.CatalogsResult; -import org.junit.jupiter.api.Assertions; - -public final class CatalogsResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CatalogsResult model = - BinaryData - .fromString( - "{\"value\":[{\"resourceType\":\"ufo\",\"name\":\"jywif\",\"billingPlans\":{\"gdf\":[\"Upfront\",\"Monthly\"],\"j\":[\"Upfront\",\"Monthly\",\"Upfront\",\"Upfront\"]},\"terms\":[\"P3Y\",\"P1Y\",\"P5Y\",\"P1Y\"],\"locations\":[\"ktsizntocipaou\",\"jpsq\",\"cmpoyfdkfogkny\",\"jofjd\"],\"skuProperties\":[],\"msrp\":{},\"restrictions\":[],\"tier\":\"wnw\",\"size\":\"itjz\",\"capabilities\":[]},{\"resourceType\":\"sarhmofc\",\"name\":\"smy\",\"billingPlans\":{\"he\":[\"Monthly\",\"Monthly\",\"Upfront\",\"Monthly\"],\"txukcdmp\":[\"Upfront\",\"Monthly\",\"Upfront\"],\"anzwuxzdxta\":[\"Upfront\",\"Monthly\",\"Upfront\",\"Monthly\"]},\"terms\":[\"P5Y\",\"P1Y\",\"P3Y\",\"P1Y\"],\"locations\":[\"mrqobmtukknr\",\"rtihfxtijbpz\"],\"skuProperties\":[],\"msrp\":{},\"restrictions\":[],\"tier\":\"zufcyzkohdbi\",\"size\":\"nufhf\",\"capabilities\":[]}],\"nextLink\":\"s\",\"totalItems\":4240171364940315752}") - .toObject(CatalogsResult.class); - Assertions.assertEquals(4240171364940315752L, model.totalItems()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CatalogsResult model = new CatalogsResult().withTotalItems(4240171364940315752L); - model = BinaryData.fromObject(model).toObject(CatalogsResult.class); - Assertions.assertEquals(4240171364940315752L, model.totalItems()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryRequestTests.java deleted file mode 100644 index 933225d7dd68..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryRequestTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ChangeDirectoryRequest; -import org.junit.jupiter.api.Assertions; - -public final class ChangeDirectoryRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChangeDirectoryRequest model = - BinaryData.fromString("{\"destinationTenantId\":\"btkuwhh\"}").toObject(ChangeDirectoryRequest.class); - Assertions.assertEquals("btkuwhh", model.destinationTenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChangeDirectoryRequest model = new ChangeDirectoryRequest().withDestinationTenantId("btkuwhh"); - model = BinaryData.fromObject(model).toObject(ChangeDirectoryRequest.class); - Assertions.assertEquals("btkuwhh", model.destinationTenantId()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResponseInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResponseInnerTests.java deleted file mode 100644 index 84839366bfdc..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResponseInnerTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.ChangeDirectoryResponseInner; -import com.azure.resourcemanager.reservations.models.ChangeDirectoryResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ChangeDirectoryResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChangeDirectoryResponseInner model = - BinaryData - .fromString( - "{\"reservationOrder\":{\"id\":\"k\",\"name\":\"oxafn\",\"isSucceeded\":false,\"error\":\"ichkoymkcdyhb\"},\"reservations\":[{\"id\":\"wdreqnovvqfovl\",\"name\":\"ywsuwsy\",\"isSucceeded\":true,\"error\":\"sytgadgvraea\"}]}") - .toObject(ChangeDirectoryResponseInner.class); - Assertions.assertEquals("k", model.reservationOrder().id()); - Assertions.assertEquals("oxafn", model.reservationOrder().name()); - Assertions.assertEquals(false, model.reservationOrder().isSucceeded()); - Assertions.assertEquals("ichkoymkcdyhb", model.reservationOrder().error()); - Assertions.assertEquals("wdreqnovvqfovl", model.reservations().get(0).id()); - Assertions.assertEquals("ywsuwsy", model.reservations().get(0).name()); - Assertions.assertEquals(true, model.reservations().get(0).isSucceeded()); - Assertions.assertEquals("sytgadgvraea", model.reservations().get(0).error()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChangeDirectoryResponseInner model = - new ChangeDirectoryResponseInner() - .withReservationOrder( - new ChangeDirectoryResult() - .withId("k") - .withName("oxafn") - .withIsSucceeded(false) - .withError("ichkoymkcdyhb")) - .withReservations( - Arrays - .asList( - new ChangeDirectoryResult() - .withId("wdreqnovvqfovl") - .withName("ywsuwsy") - .withIsSucceeded(true) - .withError("sytgadgvraea"))); - model = BinaryData.fromObject(model).toObject(ChangeDirectoryResponseInner.class); - Assertions.assertEquals("k", model.reservationOrder().id()); - Assertions.assertEquals("oxafn", model.reservationOrder().name()); - Assertions.assertEquals(false, model.reservationOrder().isSucceeded()); - Assertions.assertEquals("ichkoymkcdyhb", model.reservationOrder().error()); - Assertions.assertEquals("wdreqnovvqfovl", model.reservations().get(0).id()); - Assertions.assertEquals("ywsuwsy", model.reservations().get(0).name()); - Assertions.assertEquals(true, model.reservations().get(0).isSucceeded()); - Assertions.assertEquals("sytgadgvraea", model.reservations().get(0).error()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResultTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResultTests.java deleted file mode 100644 index 89c32ba87898..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResultTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ChangeDirectoryResult; -import org.junit.jupiter.api.Assertions; - -public final class ChangeDirectoryResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChangeDirectoryResult model = - BinaryData - .fromString("{\"id\":\"e\",\"name\":\"zar\",\"isSucceeded\":true,\"error\":\"uu\"}") - .toObject(ChangeDirectoryResult.class); - Assertions.assertEquals("e", model.id()); - Assertions.assertEquals("zar", model.name()); - Assertions.assertEquals(true, model.isSucceeded()); - Assertions.assertEquals("uu", model.error()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChangeDirectoryResult model = - new ChangeDirectoryResult().withId("e").withName("zar").withIsSucceeded(true).withError("uu"); - model = BinaryData.fromObject(model).toObject(ChangeDirectoryResult.class); - Assertions.assertEquals("e", model.id()); - Assertions.assertEquals("zar", model.name()); - Assertions.assertEquals(true, model.isSucceeded()); - Assertions.assertEquals("uu", model.error()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CurrentQuotaLimitBaseInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CurrentQuotaLimitBaseInnerTests.java deleted file mode 100644 index e4da7fcc416a..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CurrentQuotaLimitBaseInnerTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.CurrentQuotaLimitBaseInner; -import com.azure.resourcemanager.reservations.models.QuotaProperties; -import com.azure.resourcemanager.reservations.models.ResourceName; -import com.azure.resourcemanager.reservations.models.ResourceType; -import org.junit.jupiter.api.Assertions; - -public final class CurrentQuotaLimitBaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CurrentQuotaLimitBaseInner model = - BinaryData - .fromString( - "{\"properties\":{\"limit\":2001921074,\"currentValue\":1823399080,\"unit\":\"e\",\"name\":{\"value\":\"pfpubjibww\",\"localizedValue\":\"tohqkvpuvksgp\"},\"resourceType\":\"dedicated\",\"quotaPeriod\":\"nynfsynljphuo\",\"properties\":\"dataodlqiyntor\"},\"id\":\"ihleos\",\"name\":\"swsrms\",\"type\":\"yzrpzbchckqqzq\"}") - .toObject(CurrentQuotaLimitBaseInner.class); - Assertions.assertEquals(2001921074, model.properties().limit()); - Assertions.assertEquals("e", model.properties().unit()); - Assertions.assertEquals("pfpubjibww", model.properties().name().value()); - Assertions.assertEquals(ResourceType.DEDICATED, model.properties().resourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CurrentQuotaLimitBaseInner model = - new CurrentQuotaLimitBaseInner() - .withProperties( - new QuotaProperties() - .withLimit(2001921074) - .withUnit("e") - .withName(new ResourceName().withValue("pfpubjibww")) - .withResourceType(ResourceType.DEDICATED) - .withProperties("dataodlqiyntor")); - model = BinaryData.fromObject(model).toObject(CurrentQuotaLimitBaseInner.class); - Assertions.assertEquals(2001921074, model.properties().limit()); - Assertions.assertEquals("e", model.properties().unit()); - Assertions.assertEquals("pfpubjibww", model.properties().name().value()); - Assertions.assertEquals(ResourceType.DEDICATED, model.properties().resourceType()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestPropertiesTests.java deleted file mode 100644 index 096f7dcbcb29..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ExchangeRequestProperties; -import org.junit.jupiter.api.Assertions; - -public final class ExchangeRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExchangeRequestProperties model = - BinaryData.fromString("{\"sessionId\":\"wyhzdx\"}").toObject(ExchangeRequestProperties.class); - Assertions.assertEquals("wyhzdx", model.sessionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExchangeRequestProperties model = new ExchangeRequestProperties().withSessionId("wyhzdx"); - model = BinaryData.fromObject(model).toObject(ExchangeRequestProperties.class); - Assertions.assertEquals("wyhzdx", model.sessionId()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestTests.java deleted file mode 100644 index 1eceb4c37bb7..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ExchangeRequest; -import com.azure.resourcemanager.reservations.models.ExchangeRequestProperties; -import org.junit.jupiter.api.Assertions; - -public final class ExchangeRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExchangeRequest model = - BinaryData.fromString("{\"properties\":{\"sessionId\":\"d\"}}").toObject(ExchangeRequest.class); - Assertions.assertEquals("d", model.properties().sessionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExchangeRequest model = - new ExchangeRequest().withProperties(new ExchangeRequestProperties().withSessionId("d")); - model = BinaryData.fromObject(model).toObject(ExchangeRequest.class); - Assertions.assertEquals("d", model.properties().sessionId()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergePropertiesTests.java deleted file mode 100644 index 6c8cca8bad63..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergePropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.MergeProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MergePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MergeProperties model = - BinaryData - .fromString("{\"sources\":[\"yocf\",\"fksymddystki\",\"uxh\",\"yudxorrqnbp\"]}") - .toObject(MergeProperties.class); - Assertions.assertEquals("yocf", model.sources().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MergeProperties model = - new MergeProperties().withSources(Arrays.asList("yocf", "fksymddystki", "uxh", "yudxorrqnbp")); - model = BinaryData.fromObject(model).toObject(MergeProperties.class); - Assertions.assertEquals("yocf", model.sources().get(0)); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergeRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergeRequestTests.java deleted file mode 100644 index 43315a8d72f3..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergeRequestTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.MergeRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MergeRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MergeRequest model = - BinaryData - .fromString( - "{\"properties\":{\"sources\":[\"sfcpkvxodpuozm\",\"zydagfuaxbezyiuo\",\"ktwh\",\"dxwzywqsmbsurexi\"]}}") - .toObject(MergeRequest.class); - Assertions.assertEquals("sfcpkvxodpuozm", model.sources().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MergeRequest model = - new MergeRequest() - .withSources(Arrays.asList("sfcpkvxodpuozm", "zydagfuaxbezyiuo", "ktwh", "dxwzywqsmbsurexi")); - model = BinaryData.fromObject(model).toObject(MergeRequest.class); - Assertions.assertEquals("sfcpkvxodpuozm", model.sources().get(0)); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationDisplayTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationDisplayTests.java deleted file mode 100644 index 90eebcb2cf3e..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationDisplayTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"fj\",\"resource\":\"njbkcnxdhbttkph\",\"operation\":\"pnvjtoqnermclf\",\"description\":\"phoxus\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("fj", model.provider()); - Assertions.assertEquals("njbkcnxdhbttkph", model.resource()); - Assertions.assertEquals("pnvjtoqnermclf", model.operation()); - Assertions.assertEquals("phoxus", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = - new OperationDisplay() - .withProvider("fj") - .withResource("njbkcnxdhbttkph") - .withOperation("pnvjtoqnermclf") - .withDescription("phoxus"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("fj", model.provider()); - Assertions.assertEquals("njbkcnxdhbttkph", model.resource()); - Assertions.assertEquals("pnvjtoqnermclf", model.operation()); - Assertions.assertEquals("phoxus", model.description()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationListTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationListTests.java deleted file mode 100644 index 6338d341a70b..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationListTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner; -import com.azure.resourcemanager.reservations.models.OperationDisplay; -import com.azure.resourcemanager.reservations.models.OperationList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationList model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"osvmk\",\"isDataAction\":false,\"display\":{\"provider\":\"ukkfplgmgs\",\"resource\":\"kjz\",\"operation\":\"es\",\"description\":\"vlopwiyighx\"},\"origin\":\"dwzbaiue\",\"properties\":\"dataa\"}],\"nextLink\":\"nyqupedeojnabck\"}") - .toObject(OperationList.class); - Assertions.assertEquals("osvmk", model.value().get(0).name()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("ukkfplgmgs", model.value().get(0).display().provider()); - Assertions.assertEquals("kjz", model.value().get(0).display().resource()); - Assertions.assertEquals("es", model.value().get(0).display().operation()); - Assertions.assertEquals("vlopwiyighx", model.value().get(0).display().description()); - Assertions.assertEquals("dwzbaiue", model.value().get(0).origin()); - Assertions.assertEquals("nyqupedeojnabck", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = - new OperationList() - .withValue( - Arrays - .asList( - new OperationResponseInner() - .withName("osvmk") - .withIsDataAction(false) - .withDisplay( - new OperationDisplay() - .withProvider("ukkfplgmgs") - .withResource("kjz") - .withOperation("es") - .withDescription("vlopwiyighx")) - .withOrigin("dwzbaiue") - .withProperties("dataa"))) - .withNextLink("nyqupedeojnabck"); - model = BinaryData.fromObject(model).toObject(OperationList.class); - Assertions.assertEquals("osvmk", model.value().get(0).name()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("ukkfplgmgs", model.value().get(0).display().provider()); - Assertions.assertEquals("kjz", model.value().get(0).display().resource()); - Assertions.assertEquals("es", model.value().get(0).display().operation()); - Assertions.assertEquals("vlopwiyighx", model.value().get(0).display().description()); - Assertions.assertEquals("dwzbaiue", model.value().get(0).origin()); - Assertions.assertEquals("nyqupedeojnabck", model.nextLink()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationResponseInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationResponseInnerTests.java deleted file mode 100644 index c670f11d7aaa..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationResponseInnerTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner; -import com.azure.resourcemanager.reservations.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationResponseInner model = - BinaryData - .fromString( - "{\"name\":\"mtxpsiebtfh\",\"isDataAction\":false,\"display\":{\"provider\":\"pskrdqmh\",\"resource\":\"dhtldwkyz\",\"operation\":\"utknc\",\"description\":\"cwsvlxotog\"},\"origin\":\"rupqsxvnmicy\",\"properties\":\"dataceoveilovno\"}") - .toObject(OperationResponseInner.class); - Assertions.assertEquals("mtxpsiebtfh", model.name()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("pskrdqmh", model.display().provider()); - Assertions.assertEquals("dhtldwkyz", model.display().resource()); - Assertions.assertEquals("utknc", model.display().operation()); - Assertions.assertEquals("cwsvlxotog", model.display().description()); - Assertions.assertEquals("rupqsxvnmicy", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResponseInner model = - new OperationResponseInner() - .withName("mtxpsiebtfh") - .withIsDataAction(false) - .withDisplay( - new OperationDisplay() - .withProvider("pskrdqmh") - .withResource("dhtldwkyz") - .withOperation("utknc") - .withDescription("cwsvlxotog")) - .withOrigin("rupqsxvnmicy") - .withProperties("dataceoveilovno"); - model = BinaryData.fromObject(model).toObject(OperationResponseInner.class); - Assertions.assertEquals("mtxpsiebtfh", model.name()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("pskrdqmh", model.display().provider()); - Assertions.assertEquals("dhtldwkyz", model.display().resource()); - Assertions.assertEquals("utknc", model.display().operation()); - Assertions.assertEquals("cwsvlxotog", model.display().description()); - Assertions.assertEquals("rupqsxvnmicy", model.origin()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationsListMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationsListMockTests.java deleted file mode 100644 index be9e10d96b1a..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationsListMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.OperationResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"ttsttktlahbqact\",\"isDataAction\":true,\"display\":{\"provider\":\"kxitmmqtgqqqxhr\",\"resource\":\"rxcpjuisavo\",\"operation\":\"dzf\",\"description\":\"zivj\"},\"origin\":\"rqttbajlkatnw\",\"properties\":\"dataiopid\"}]}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ttsttktlahbqact", response.iterator().next().name()); - Assertions.assertEquals(true, response.iterator().next().isDataAction()); - Assertions.assertEquals("kxitmmqtgqqqxhr", response.iterator().next().display().provider()); - Assertions.assertEquals("rxcpjuisavo", response.iterator().next().display().resource()); - Assertions.assertEquals("dzf", response.iterator().next().display().operation()); - Assertions.assertEquals("zivj", response.iterator().next().display().description()); - Assertions.assertEquals("rqttbajlkatnw", response.iterator().next().origin()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchModelTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchModelTests.java deleted file mode 100644 index e11049267ea5..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchModelTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.AppliedScopeProperties; -import com.azure.resourcemanager.reservations.models.AppliedScopeType; -import com.azure.resourcemanager.reservations.models.InstanceFlexibility; -import com.azure.resourcemanager.reservations.models.PatchModel; -import com.azure.resourcemanager.reservations.models.PatchPropertiesRenewProperties; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PatchModelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PatchModel model = - BinaryData - .fromString( - "{\"properties\":{\"appliedScopeType\":\"ManagementGroup\",\"appliedScopes\":[\"bxzpuzycisp\",\"qzahmgkbrp\",\"y\"],\"appliedScopeProperties\":{\"tenantId\":\"bnuqqkpik\",\"managementGroupId\":\"rgvtqag\",\"subscriptionId\":\"uynhijg\",\"resourceGroupId\":\"ebf\",\"displayName\":\"arbu\"},\"instanceFlexibility\":\"Off\",\"name\":\"pnazzm\",\"renew\":false,\"renewProperties\":{},\"reviewDateTime\":\"2021-05-19T03:18:32Z\"}}") - .toObject(PatchModel.class); - Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.appliedScopeType()); - Assertions.assertEquals("bxzpuzycisp", model.appliedScopes().get(0)); - Assertions.assertEquals("bnuqqkpik", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("rgvtqag", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("uynhijg", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("ebf", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("arbu", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility()); - Assertions.assertEquals("pnazzm", model.name()); - Assertions.assertEquals(false, model.renew()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T03:18:32Z"), model.reviewDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PatchModel model = - new PatchModel() - .withAppliedScopeType(AppliedScopeType.MANAGEMENT_GROUP) - .withAppliedScopes(Arrays.asList("bxzpuzycisp", "qzahmgkbrp", "y")) - .withAppliedScopeProperties( - new AppliedScopeProperties() - .withTenantId("bnuqqkpik") - .withManagementGroupId("rgvtqag") - .withSubscriptionId("uynhijg") - .withResourceGroupId("ebf") - .withDisplayName("arbu")) - .withInstanceFlexibility(InstanceFlexibility.OFF) - .withName("pnazzm") - .withRenew(false) - .withRenewProperties(new PatchPropertiesRenewProperties()) - .withReviewDateTime(OffsetDateTime.parse("2021-05-19T03:18:32Z")); - model = BinaryData.fromObject(model).toObject(PatchModel.class); - Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.appliedScopeType()); - Assertions.assertEquals("bxzpuzycisp", model.appliedScopes().get(0)); - Assertions.assertEquals("bnuqqkpik", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("rgvtqag", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("uynhijg", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("ebf", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("arbu", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility()); - Assertions.assertEquals("pnazzm", model.name()); - Assertions.assertEquals(false, model.renew()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T03:18:32Z"), model.reviewDateTime()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesRenewPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesRenewPropertiesTests.java deleted file mode 100644 index 2d8e7a7005e9..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesRenewPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.AppliedScopeType; -import com.azure.resourcemanager.reservations.models.PatchPropertiesRenewProperties; -import com.azure.resourcemanager.reservations.models.PurchaseRequest; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import com.azure.resourcemanager.reservations.models.ReservedResourceType; -import com.azure.resourcemanager.reservations.models.SkuName; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PatchPropertiesRenewPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PatchPropertiesRenewProperties model = - BinaryData - .fromString( - "{\"purchaseProperties\":{\"sku\":{\"name\":\"pdkzjancuxr\"},\"location\":\"wbavxbniwdj\",\"properties\":{\"reservedResourceType\":\"VirtualMachineSoftware\",\"billingScopeId\":\"dbpgnxytxhp\",\"term\":\"P5Y\",\"billingPlan\":\"Upfront\",\"quantity\":686718071,\"displayName\":\"b\",\"appliedScopeType\":\"Shared\",\"appliedScopes\":[\"xwtctyqiklbbovpl\"],\"renew\":true,\"reviewDateTime\":\"2021-01-10T00:04:32Z\"}}}") - .toObject(PatchPropertiesRenewProperties.class); - Assertions.assertEquals("pdkzjancuxr", model.purchaseProperties().sku().name()); - Assertions.assertEquals("wbavxbniwdj", model.purchaseProperties().location()); - Assertions - .assertEquals( - ReservedResourceType.VIRTUAL_MACHINE_SOFTWARE, model.purchaseProperties().reservedResourceType()); - Assertions.assertEquals("dbpgnxytxhp", model.purchaseProperties().billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.purchaseProperties().term()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.purchaseProperties().billingPlan()); - Assertions.assertEquals(686718071, model.purchaseProperties().quantity()); - Assertions.assertEquals("b", model.purchaseProperties().displayName()); - Assertions.assertEquals(AppliedScopeType.SHARED, model.purchaseProperties().appliedScopeType()); - Assertions.assertEquals("xwtctyqiklbbovpl", model.purchaseProperties().appliedScopes().get(0)); - Assertions.assertEquals(true, model.purchaseProperties().renew()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-10T00:04:32Z"), model.purchaseProperties().reviewDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PatchPropertiesRenewProperties model = - new PatchPropertiesRenewProperties() - .withPurchaseProperties( - new PurchaseRequest() - .withSku(new SkuName().withName("pdkzjancuxr")) - .withLocation("wbavxbniwdj") - .withReservedResourceType(ReservedResourceType.VIRTUAL_MACHINE_SOFTWARE) - .withBillingScopeId("dbpgnxytxhp") - .withTerm(ReservationTerm.P5Y) - .withBillingPlan(ReservationBillingPlan.UPFRONT) - .withQuantity(686718071) - .withDisplayName("b") - .withAppliedScopeType(AppliedScopeType.SHARED) - .withAppliedScopes(Arrays.asList("xwtctyqiklbbovpl")) - .withRenew(true) - .withReviewDateTime(OffsetDateTime.parse("2021-01-10T00:04:32Z"))); - model = BinaryData.fromObject(model).toObject(PatchPropertiesRenewProperties.class); - Assertions.assertEquals("pdkzjancuxr", model.purchaseProperties().sku().name()); - Assertions.assertEquals("wbavxbniwdj", model.purchaseProperties().location()); - Assertions - .assertEquals( - ReservedResourceType.VIRTUAL_MACHINE_SOFTWARE, model.purchaseProperties().reservedResourceType()); - Assertions.assertEquals("dbpgnxytxhp", model.purchaseProperties().billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.purchaseProperties().term()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.purchaseProperties().billingPlan()); - Assertions.assertEquals(686718071, model.purchaseProperties().quantity()); - Assertions.assertEquals("b", model.purchaseProperties().displayName()); - Assertions.assertEquals(AppliedScopeType.SHARED, model.purchaseProperties().appliedScopeType()); - Assertions.assertEquals("xwtctyqiklbbovpl", model.purchaseProperties().appliedScopes().get(0)); - Assertions.assertEquals(true, model.purchaseProperties().renew()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-10T00:04:32Z"), model.purchaseProperties().reviewDateTime()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesTests.java deleted file mode 100644 index 39fb61bd94b5..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.PatchProperties; -import com.azure.resourcemanager.reservations.models.AppliedScopeProperties; -import com.azure.resourcemanager.reservations.models.AppliedScopeType; -import com.azure.resourcemanager.reservations.models.InstanceFlexibility; -import com.azure.resourcemanager.reservations.models.PatchPropertiesRenewProperties; -import com.azure.resourcemanager.reservations.models.PurchaseRequest; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PatchProperties model = - BinaryData - .fromString( - "{\"appliedScopeType\":\"Shared\",\"appliedScopes\":[\"bh\",\"bnlankxmyskpb\",\"enbtkcxywny\"],\"appliedScopeProperties\":{\"tenantId\":\"synlqidybyxczfc\",\"managementGroupId\":\"aaxdbabphlwrq\",\"subscriptionId\":\"ktsthsucocmny\",\"resourceGroupId\":\"zt\",\"displayName\":\"twwrqp\"},\"instanceFlexibility\":\"Off\",\"name\":\"kzywbiex\",\"renew\":true,\"renewProperties\":{\"purchaseProperties\":{\"location\":\"xibxujwbhqwalm\"}},\"reviewDateTime\":\"2021-04-22T03:08:20Z\"}") - .toObject(PatchProperties.class); - Assertions.assertEquals(AppliedScopeType.SHARED, model.appliedScopeType()); - Assertions.assertEquals("bh", model.appliedScopes().get(0)); - Assertions.assertEquals("synlqidybyxczfc", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("aaxdbabphlwrq", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("ktsthsucocmny", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("zt", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("twwrqp", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility()); - Assertions.assertEquals("kzywbiex", model.name()); - Assertions.assertEquals(true, model.renew()); - Assertions.assertEquals("xibxujwbhqwalm", model.renewProperties().purchaseProperties().location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-22T03:08:20Z"), model.reviewDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PatchProperties model = - new PatchProperties() - .withAppliedScopeType(AppliedScopeType.SHARED) - .withAppliedScopes(Arrays.asList("bh", "bnlankxmyskpb", "enbtkcxywny")) - .withAppliedScopeProperties( - new AppliedScopeProperties() - .withTenantId("synlqidybyxczfc") - .withManagementGroupId("aaxdbabphlwrq") - .withSubscriptionId("ktsthsucocmny") - .withResourceGroupId("zt") - .withDisplayName("twwrqp")) - .withInstanceFlexibility(InstanceFlexibility.OFF) - .withName("kzywbiex") - .withRenew(true) - .withRenewProperties( - new PatchPropertiesRenewProperties() - .withPurchaseProperties(new PurchaseRequest().withLocation("xibxujwbhqwalm"))) - .withReviewDateTime(OffsetDateTime.parse("2021-04-22T03:08:20Z")); - model = BinaryData.fromObject(model).toObject(PatchProperties.class); - Assertions.assertEquals(AppliedScopeType.SHARED, model.appliedScopeType()); - Assertions.assertEquals("bh", model.appliedScopes().get(0)); - Assertions.assertEquals("synlqidybyxczfc", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("aaxdbabphlwrq", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("ktsthsucocmny", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("zt", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("twwrqp", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility()); - Assertions.assertEquals("kzywbiex", model.name()); - Assertions.assertEquals(true, model.renew()); - Assertions.assertEquals("xibxujwbhqwalm", model.renewProperties().purchaseProperties().location()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-22T03:08:20Z"), model.reviewDateTime()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesReservedResourcePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesReservedResourcePropertiesTests.java deleted file mode 100644 index cb5acc6bb290..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesReservedResourcePropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.InstanceFlexibility; -import com.azure.resourcemanager.reservations.models.PurchaseRequestPropertiesReservedResourceProperties; -import org.junit.jupiter.api.Assertions; - -public final class PurchaseRequestPropertiesReservedResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PurchaseRequestPropertiesReservedResourceProperties model = - BinaryData - .fromString("{\"instanceFlexibility\":\"Off\"}") - .toObject(PurchaseRequestPropertiesReservedResourceProperties.class); - Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PurchaseRequestPropertiesReservedResourceProperties model = - new PurchaseRequestPropertiesReservedResourceProperties().withInstanceFlexibility(InstanceFlexibility.OFF); - model = BinaryData.fromObject(model).toObject(PurchaseRequestPropertiesReservedResourceProperties.class); - Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesTests.java deleted file mode 100644 index f3ce709f6232..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.PurchaseRequestProperties; -import com.azure.resourcemanager.reservations.models.AppliedScopeProperties; -import com.azure.resourcemanager.reservations.models.AppliedScopeType; -import com.azure.resourcemanager.reservations.models.InstanceFlexibility; -import com.azure.resourcemanager.reservations.models.PurchaseRequestPropertiesReservedResourceProperties; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import com.azure.resourcemanager.reservations.models.ReservedResourceType; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PurchaseRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PurchaseRequestProperties model = - BinaryData - .fromString( - "{\"reservedResourceType\":\"SapHana\",\"billingScopeId\":\"kvwrwjfeu\",\"term\":\"P5Y\",\"billingPlan\":\"Upfront\",\"quantity\":1936335434,\"displayName\":\"tmrldhugjzzdatq\",\"appliedScopeType\":\"ManagementGroup\",\"appliedScopes\":[\"geablgphuticndvk\",\"ozwyiftyhxhuro\",\"ftyxolniw\"],\"appliedScopeProperties\":{\"tenantId\":\"ukjfkgiawxklr\",\"managementGroupId\":\"lwckbasyypnddhs\",\"subscriptionId\":\"bacphejko\",\"resourceGroupId\":\"nqgoulzndli\",\"displayName\":\"yqkgfg\"},\"renew\":true,\"reservedResourceProperties\":{\"instanceFlexibility\":\"On\"},\"reviewDateTime\":\"2021-09-02T02:02:12Z\"}") - .toObject(PurchaseRequestProperties.class); - Assertions.assertEquals(ReservedResourceType.SAP_HANA, model.reservedResourceType()); - Assertions.assertEquals("kvwrwjfeu", model.billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.term()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.billingPlan()); - Assertions.assertEquals(1936335434, model.quantity()); - Assertions.assertEquals("tmrldhugjzzdatq", model.displayName()); - Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.appliedScopeType()); - Assertions.assertEquals("geablgphuticndvk", model.appliedScopes().get(0)); - Assertions.assertEquals("ukjfkgiawxklr", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("lwckbasyypnddhs", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("bacphejko", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("nqgoulzndli", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("yqkgfg", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(true, model.renew()); - Assertions.assertEquals(InstanceFlexibility.ON, model.reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T02:02:12Z"), model.reviewDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PurchaseRequestProperties model = - new PurchaseRequestProperties() - .withReservedResourceType(ReservedResourceType.SAP_HANA) - .withBillingScopeId("kvwrwjfeu") - .withTerm(ReservationTerm.P5Y) - .withBillingPlan(ReservationBillingPlan.UPFRONT) - .withQuantity(1936335434) - .withDisplayName("tmrldhugjzzdatq") - .withAppliedScopeType(AppliedScopeType.MANAGEMENT_GROUP) - .withAppliedScopes(Arrays.asList("geablgphuticndvk", "ozwyiftyhxhuro", "ftyxolniw")) - .withAppliedScopeProperties( - new AppliedScopeProperties() - .withTenantId("ukjfkgiawxklr") - .withManagementGroupId("lwckbasyypnddhs") - .withSubscriptionId("bacphejko") - .withResourceGroupId("nqgoulzndli") - .withDisplayName("yqkgfg")) - .withRenew(true) - .withReservedResourceProperties( - new PurchaseRequestPropertiesReservedResourceProperties() - .withInstanceFlexibility(InstanceFlexibility.ON)) - .withReviewDateTime(OffsetDateTime.parse("2021-09-02T02:02:12Z")); - model = BinaryData.fromObject(model).toObject(PurchaseRequestProperties.class); - Assertions.assertEquals(ReservedResourceType.SAP_HANA, model.reservedResourceType()); - Assertions.assertEquals("kvwrwjfeu", model.billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.term()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.billingPlan()); - Assertions.assertEquals(1936335434, model.quantity()); - Assertions.assertEquals("tmrldhugjzzdatq", model.displayName()); - Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.appliedScopeType()); - Assertions.assertEquals("geablgphuticndvk", model.appliedScopes().get(0)); - Assertions.assertEquals("ukjfkgiawxklr", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("lwckbasyypnddhs", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("bacphejko", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("nqgoulzndli", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("yqkgfg", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(true, model.renew()); - Assertions.assertEquals(InstanceFlexibility.ON, model.reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T02:02:12Z"), model.reviewDateTime()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestTests.java deleted file mode 100644 index 28cca8ba9f7b..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.AppliedScopeProperties; -import com.azure.resourcemanager.reservations.models.AppliedScopeType; -import com.azure.resourcemanager.reservations.models.InstanceFlexibility; -import com.azure.resourcemanager.reservations.models.PurchaseRequest; -import com.azure.resourcemanager.reservations.models.PurchaseRequestPropertiesReservedResourceProperties; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import com.azure.resourcemanager.reservations.models.ReservedResourceType; -import com.azure.resourcemanager.reservations.models.SkuName; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PurchaseRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PurchaseRequest model = - BinaryData - .fromString( - "{\"sku\":{\"name\":\"bljofxqeof\"},\"location\":\"e\",\"properties\":{\"reservedResourceType\":\"RedHatOsa\",\"billingScopeId\":\"b\",\"term\":\"P1Y\",\"billingPlan\":\"Monthly\",\"quantity\":928331689,\"displayName\":\"ulngsntn\",\"appliedScopeType\":\"Shared\",\"appliedScopes\":[\"gc\",\"rwclxxwrljdo\"],\"appliedScopeProperties\":{\"tenantId\":\"cqvkocrcjdkwtn\",\"managementGroupId\":\"bnjbiksqrglssain\",\"subscriptionId\":\"jwnzlljfmp\",\"resourceGroupId\":\"ebvmgxsabkyqd\",\"displayName\":\"jitcjczdzevn\"},\"renew\":false,\"reservedResourceProperties\":{\"instanceFlexibility\":\"On\"},\"reviewDateTime\":\"2021-04-18T17:34:07Z\"}}") - .toObject(PurchaseRequest.class); - Assertions.assertEquals("bljofxqeof", model.sku().name()); - Assertions.assertEquals("e", model.location()); - Assertions.assertEquals(ReservedResourceType.RED_HAT_OSA, model.reservedResourceType()); - Assertions.assertEquals("b", model.billingScopeId()); - Assertions.assertEquals(ReservationTerm.P1Y, model.term()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.billingPlan()); - Assertions.assertEquals(928331689, model.quantity()); - Assertions.assertEquals("ulngsntn", model.displayName()); - Assertions.assertEquals(AppliedScopeType.SHARED, model.appliedScopeType()); - Assertions.assertEquals("gc", model.appliedScopes().get(0)); - Assertions.assertEquals("cqvkocrcjdkwtn", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("bnjbiksqrglssain", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("jwnzlljfmp", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("ebvmgxsabkyqd", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("jitcjczdzevn", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.renew()); - Assertions.assertEquals(InstanceFlexibility.ON, model.reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T17:34:07Z"), model.reviewDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PurchaseRequest model = - new PurchaseRequest() - .withSku(new SkuName().withName("bljofxqeof")) - .withLocation("e") - .withReservedResourceType(ReservedResourceType.RED_HAT_OSA) - .withBillingScopeId("b") - .withTerm(ReservationTerm.P1Y) - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withQuantity(928331689) - .withDisplayName("ulngsntn") - .withAppliedScopeType(AppliedScopeType.SHARED) - .withAppliedScopes(Arrays.asList("gc", "rwclxxwrljdo")) - .withAppliedScopeProperties( - new AppliedScopeProperties() - .withTenantId("cqvkocrcjdkwtn") - .withManagementGroupId("bnjbiksqrglssain") - .withSubscriptionId("jwnzlljfmp") - .withResourceGroupId("ebvmgxsabkyqd") - .withDisplayName("jitcjczdzevn")) - .withRenew(false) - .withReservedResourceProperties( - new PurchaseRequestPropertiesReservedResourceProperties() - .withInstanceFlexibility(InstanceFlexibility.ON)) - .withReviewDateTime(OffsetDateTime.parse("2021-04-18T17:34:07Z")); - model = BinaryData.fromObject(model).toObject(PurchaseRequest.class); - Assertions.assertEquals("bljofxqeof", model.sku().name()); - Assertions.assertEquals("e", model.location()); - Assertions.assertEquals(ReservedResourceType.RED_HAT_OSA, model.reservedResourceType()); - Assertions.assertEquals("b", model.billingScopeId()); - Assertions.assertEquals(ReservationTerm.P1Y, model.term()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.billingPlan()); - Assertions.assertEquals(928331689, model.quantity()); - Assertions.assertEquals("ulngsntn", model.displayName()); - Assertions.assertEquals(AppliedScopeType.SHARED, model.appliedScopeType()); - Assertions.assertEquals("gc", model.appliedScopes().get(0)); - Assertions.assertEquals("cqvkocrcjdkwtn", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("bnjbiksqrglssain", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("jwnzlljfmp", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("ebvmgxsabkyqd", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("jitcjczdzevn", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.renew()); - Assertions.assertEquals(InstanceFlexibility.ON, model.reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T17:34:07Z"), model.reviewDateTime()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaLimitsTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaLimitsTests.java deleted file mode 100644 index 49bfebead8c2..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaLimitsTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.CurrentQuotaLimitBaseInner; -import com.azure.resourcemanager.reservations.models.QuotaLimits; -import com.azure.resourcemanager.reservations.models.QuotaProperties; -import com.azure.resourcemanager.reservations.models.ResourceType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuotaLimitsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaLimits model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"limit\":1927044883,\"currentValue\":825727567,\"unit\":\"lwuip\",\"resourceType\":\"standard\",\"quotaPeriod\":\"kzivgvvcnayrh\",\"properties\":\"datanxxmueedndrdv\"},\"id\":\"tkwqqtchealm\",\"name\":\"mtdaa\",\"type\":\"gdv\"},{\"properties\":{\"limit\":627110889,\"currentValue\":1695810733,\"unit\":\"g\",\"resourceType\":\"shared\",\"quotaPeriod\":\"udxepxgyqagv\",\"properties\":\"datamnpkukghimdblxg\"},\"id\":\"imfnjhfjx\",\"name\":\"mszkkfo\",\"type\":\"rey\"},{\"properties\":{\"limit\":648968318,\"currentValue\":1648570452,\"unit\":\"aw\",\"resourceType\":\"serviceSpecific\",\"quotaPeriod\":\"xwczelpcire\",\"properties\":\"datafeaenwab\"},\"id\":\"atklddxbjhwuaa\",\"name\":\"oz\",\"type\":\"osphyoul\"},{\"properties\":{\"limit\":106141655,\"currentValue\":326673667,\"unit\":\"l\",\"resourceType\":\"lowPriority\",\"quotaPeriod\":\"wosytxitcskf\",\"properties\":\"datatq\"},\"id\":\"miekkezzikhlyfjh\",\"name\":\"gqggebdunygae\",\"type\":\"idb\"}],\"nextLink\":\"atpxl\"}") - .toObject(QuotaLimits.class); - Assertions.assertEquals(1927044883, model.value().get(0).properties().limit()); - Assertions.assertEquals("lwuip", model.value().get(0).properties().unit()); - Assertions.assertEquals(ResourceType.STANDARD, model.value().get(0).properties().resourceType()); - Assertions.assertEquals("atpxl", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaLimits model = - new QuotaLimits() - .withValue( - Arrays - .asList( - new CurrentQuotaLimitBaseInner() - .withProperties( - new QuotaProperties() - .withLimit(1927044883) - .withUnit("lwuip") - .withResourceType(ResourceType.STANDARD) - .withProperties("datanxxmueedndrdv")), - new CurrentQuotaLimitBaseInner() - .withProperties( - new QuotaProperties() - .withLimit(627110889) - .withUnit("g") - .withResourceType(ResourceType.SHARED) - .withProperties("datamnpkukghimdblxg")), - new CurrentQuotaLimitBaseInner() - .withProperties( - new QuotaProperties() - .withLimit(648968318) - .withUnit("aw") - .withResourceType(ResourceType.SERVICE_SPECIFIC) - .withProperties("datafeaenwab")), - new CurrentQuotaLimitBaseInner() - .withProperties( - new QuotaProperties() - .withLimit(106141655) - .withUnit("l") - .withResourceType(ResourceType.LOW_PRIORITY) - .withProperties("datatq")))) - .withNextLink("atpxl"); - model = BinaryData.fromObject(model).toObject(QuotaLimits.class); - Assertions.assertEquals(1927044883, model.value().get(0).properties().limit()); - Assertions.assertEquals("lwuip", model.value().get(0).properties().unit()); - Assertions.assertEquals(ResourceType.STANDARD, model.value().get(0).properties().resourceType()); - Assertions.assertEquals("atpxl", model.nextLink()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaPropertiesTests.java deleted file mode 100644 index 40f220b986ca..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.QuotaProperties; -import com.azure.resourcemanager.reservations.models.ResourceName; -import com.azure.resourcemanager.reservations.models.ResourceType; -import org.junit.jupiter.api.Assertions; - -public final class QuotaPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaProperties model = - BinaryData - .fromString( - "{\"limit\":671328296,\"currentValue\":1223269261,\"unit\":\"uiizynke\",\"name\":{\"value\":\"trwyhqmib\",\"localizedValue\":\"hwit\"},\"resourceType\":\"lowPriority\",\"quotaPeriod\":\"yynpcdpumnzgmwz\",\"properties\":\"dataabikns\"}") - .toObject(QuotaProperties.class); - Assertions.assertEquals(671328296, model.limit()); - Assertions.assertEquals("uiizynke", model.unit()); - Assertions.assertEquals("trwyhqmib", model.name().value()); - Assertions.assertEquals(ResourceType.LOW_PRIORITY, model.resourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaProperties model = - new QuotaProperties() - .withLimit(671328296) - .withUnit("uiizynke") - .withName(new ResourceName().withValue("trwyhqmib")) - .withResourceType(ResourceType.LOW_PRIORITY) - .withProperties("dataabikns"); - model = BinaryData.fromObject(model).toObject(QuotaProperties.class); - Assertions.assertEquals(671328296, model.limit()); - Assertions.assertEquals("uiizynke", model.unit()); - Assertions.assertEquals("trwyhqmib", model.name().value()); - Assertions.assertEquals(ResourceType.LOW_PRIORITY, model.resourceType()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsInnerTests.java deleted file mode 100644 index 78e45ceb0f40..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsInnerTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner; -import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import com.azure.resourcemanager.reservations.models.SubRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuotaRequestDetailsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaRequestDetailsInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"InProgress\",\"message\":\"jmoadsuv\",\"requestSubmitTime\":\"2021-09-26T15:36:35Z\",\"value\":[{\"limit\":1450729079,\"resourceType\":\"jqbjhhy\",\"unit\":\"rw\",\"provisioningState\":\"Accepted\",\"message\":\"duhpk\",\"subRequestId\":\"gymare\"},{\"limit\":999279087,\"resourceType\":\"qugjhkycube\",\"unit\":\"gssofwq\",\"provisioningState\":\"Accepted\",\"message\":\"lkrm\",\"subRequestId\":\"i\"},{\"limit\":988494266,\"resourceType\":\"q\",\"unit\":\"dfnbyxbaaabjyv\",\"provisioningState\":\"Succeeded\",\"message\":\"imrzrtuzqog\",\"subRequestId\":\"xnevfdnwn\"},{\"limit\":1417389324,\"resourceType\":\"syyceuzsoibjud\",\"unit\":\"rx\",\"provisioningState\":\"Succeeded\",\"message\":\"zvaytdwkqbr\",\"subRequestId\":\"bpaxhexiilivpdt\"}]},\"id\":\"irqtdqoa\",\"name\":\"oruzfgsquyfxrxx\",\"type\":\"eptra\"}") - .toObject(QuotaRequestDetailsInner.class); - Assertions.assertEquals(QuotaRequestState.IN_PROGRESS, model.provisioningState()); - Assertions.assertEquals("rw", model.value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.value().get(0).provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaRequestDetailsInner model = - new QuotaRequestDetailsInner() - .withProvisioningState(QuotaRequestState.IN_PROGRESS) - .withValue( - Arrays - .asList( - new SubRequest().withUnit("rw").withProvisioningState(QuotaRequestState.ACCEPTED), - new SubRequest().withUnit("gssofwq").withProvisioningState(QuotaRequestState.ACCEPTED), - new SubRequest() - .withUnit("dfnbyxbaaabjyv") - .withProvisioningState(QuotaRequestState.SUCCEEDED), - new SubRequest().withUnit("rx").withProvisioningState(QuotaRequestState.SUCCEEDED))); - model = BinaryData.fromObject(model).toObject(QuotaRequestDetailsInner.class); - Assertions.assertEquals(QuotaRequestState.IN_PROGRESS, model.provisioningState()); - Assertions.assertEquals("rw", model.value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.value().get(0).provisioningState()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsListTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsListTests.java deleted file mode 100644 index c2491375fd65..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsListTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner; -import com.azure.resourcemanager.reservations.models.QuotaRequestDetailsList; -import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuotaRequestDetailsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaRequestDetailsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"message\":\"jaltolmnc\",\"requestSubmitTime\":\"2021-02-08T05:43:26Z\",\"value\":[]},\"id\":\"qwcsdbnwdcfhuc\",\"name\":\"dpfuvg\",\"type\":\"sbjjc\"}],\"nextLink\":\"vxb\"}") - .toObject(QuotaRequestDetailsList.class); - Assertions.assertEquals(QuotaRequestState.SUCCEEDED, model.value().get(0).provisioningState()); - Assertions.assertEquals("vxb", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaRequestDetailsList model = - new QuotaRequestDetailsList() - .withValue( - Arrays - .asList( - new QuotaRequestDetailsInner() - .withProvisioningState(QuotaRequestState.SUCCEEDED) - .withValue(Arrays.asList()))) - .withNextLink("vxb"); - model = BinaryData.fromObject(model).toObject(QuotaRequestDetailsList.class); - Assertions.assertEquals(QuotaRequestState.SUCCEEDED, model.value().get(0).provisioningState()); - Assertions.assertEquals("vxb", model.nextLink()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestPropertiesTests.java deleted file mode 100644 index eaa8a3c91bc6..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestProperties; -import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import com.azure.resourcemanager.reservations.models.ResourceName; -import com.azure.resourcemanager.reservations.models.SubRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuotaRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaRequestProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Accepted\",\"message\":\"zwl\",\"requestSubmitTime\":\"2021-07-30T12:05:38Z\",\"value\":[{\"limit\":544110475,\"name\":{\"value\":\"dy\",\"localizedValue\":\"tdooaoj\"},\"resourceType\":\"iodkooebwnujhem\",\"unit\":\"bvdkcrodtjin\",\"provisioningState\":\"Failed\",\"message\":\"fltkacjv\",\"subRequestId\":\"kdlfoa\"},{\"limit\":1662630957,\"name\":{\"value\":\"pagao\",\"localizedValue\":\"ulpqblylsyxkqjn\"},\"resourceType\":\"ervtiagxs\",\"unit\":\"zuempsbzkf\",\"provisioningState\":\"Succeeded\",\"message\":\"v\",\"subRequestId\":\"qi\"}]}") - .toObject(QuotaRequestProperties.class); - Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.provisioningState()); - Assertions.assertEquals("dy", model.value().get(0).name().value()); - Assertions.assertEquals("bvdkcrodtjin", model.value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.FAILED, model.value().get(0).provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaRequestProperties model = - new QuotaRequestProperties() - .withProvisioningState(QuotaRequestState.ACCEPTED) - .withValue( - Arrays - .asList( - new SubRequest() - .withName(new ResourceName().withValue("dy")) - .withUnit("bvdkcrodtjin") - .withProvisioningState(QuotaRequestState.FAILED), - new SubRequest() - .withName(new ResourceName().withValue("pagao")) - .withUnit("zuempsbzkf") - .withProvisioningState(QuotaRequestState.SUCCEEDED))); - model = BinaryData.fromObject(model).toObject(QuotaRequestProperties.class); - Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.provisioningState()); - Assertions.assertEquals("dy", model.value().get(0).name().value()); - Assertions.assertEquals("bvdkcrodtjin", model.value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.FAILED, model.value().get(0).provisioningState()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusDetailsTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusDetailsTests.java deleted file mode 100644 index c4515e7d33f2..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusDetailsTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestStatusDetails; - -public final class QuotaRequestStatusDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaRequestStatusDetails model = - BinaryData - .fromString("{\"provisioningState\":\"Failed\",\"message\":\"zikywgg\"}") - .toObject(QuotaRequestStatusDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaRequestStatusDetails model = new QuotaRequestStatusDetails(); - model = BinaryData.fromObject(model).toObject(QuotaRequestStatusDetails.class); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetWithResponseMockTests.java deleted file mode 100644 index 9ea138b2cb25..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetWithResponseMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.QuotaRequestDetails; -import com.azure.resourcemanager.reservations.models.QuotaRequestState; -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 QuotaRequestStatusGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Invalid\",\"message\":\"ocxvdfffwafqr\",\"requestSubmitTime\":\"2021-06-07T05:27:14Z\",\"value\":[]},\"id\":\"pavehhr\",\"name\":\"kbunzoz\",\"type\":\"dhcxgkmoy\"}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - QuotaRequestDetails response = - manager - .quotaRequestStatus() - .getWithResponse( - "hihfrbbcevqagtlt", - "hlfkqojpy", - "vgtrdcnifmzzs", - "ymbrnysuxmpraf", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(QuotaRequestState.INVALID, response.provisioningState()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListMockTests.java deleted file mode 100644 index c3d731d03ef4..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.QuotaRequestDetails; -import com.azure.resourcemanager.reservations.models.QuotaRequestState; -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 QuotaRequestStatusListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"InProgress\",\"message\":\"nzeyqxtjj\",\"requestSubmitTime\":\"2021-06-30T23:12:31Z\",\"value\":[]},\"id\":\"hycav\",\"name\":\"dggxdbeesmi\",\"type\":\"knlrariaawiuagy\"}]}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .quotaRequestStatus() - .list( - "cdyuibhmfdnbzyd", - "f", - "fcjnaeoisrvhmgor", - "fukiscvwmzhw", - 1363348487, - "efaxvxilc", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(QuotaRequestState.IN_PROGRESS, response.iterator().next().provisioningState()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestSubmitResponse201InnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestSubmitResponse201InnerTests.java deleted file mode 100644 index c19ce5caaff0..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestSubmitResponse201InnerTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestSubmitResponse201Inner; - -public final class QuotaRequestSubmitResponse201InnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaRequestSubmitResponse201Inner model = - BinaryData - .fromString( - "{\"id\":\"kdmtncvokotll\",\"name\":\"yhgsy\",\"type\":\"ogjltdtbnnhad\",\"properties\":{\"provisioningState\":\"Succeeded\",\"message\":\"vcikhnvpamqgx\"}}") - .toObject(QuotaRequestSubmitResponse201Inner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaRequestSubmitResponse201Inner model = new QuotaRequestSubmitResponse201Inner(); - model = BinaryData.fromObject(model).toObject(QuotaRequestSubmitResponse201Inner.class); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasCreateOrUpdateMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasCreateOrUpdateMockTests.java deleted file mode 100644 index a98fb811b164..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasCreateOrUpdateMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.CurrentQuotaLimitBase; -import com.azure.resourcemanager.reservations.models.QuotaProperties; -import com.azure.resourcemanager.reservations.models.ResourceName; -import com.azure.resourcemanager.reservations.models.ResourceType; -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 QuotasCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"limit\":800106977,\"currentValue\":457679085,\"unit\":\"y\",\"name\":{\"value\":\"yavluwmncstt\",\"localizedValue\":\"fybvpoek\"},\"resourceType\":\"lowPriority\",\"quotaPeriod\":\"gbdhuzqgnjdg\",\"properties\":\"datanscliqhzvhxnk\"},\"id\":\"mtk\",\"name\":\"bo\",\"type\":\"ppnvdxz\"}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CurrentQuotaLimitBase response = - manager - .quotas() - .define("irclnpk") - .withExistingLocation("gzuriglaecxndt", "cokpv", "mlqtmldgxob") - .withProperties( - new QuotaProperties() - .withLimit(1931804941) - .withUnit("ykhyawfvjlboxqvk") - .withName(new ResourceName().withValue("xhom")) - .withResourceType(ResourceType.DEDICATED) - .withProperties("dataa")) - .create(); - - Assertions.assertEquals(800106977, response.properties().limit()); - Assertions.assertEquals("y", response.properties().unit()); - Assertions.assertEquals("yavluwmncstt", response.properties().name().value()); - Assertions.assertEquals(ResourceType.LOW_PRIORITY, response.properties().resourceType()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasGetWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasGetWithResponseMockTests.java deleted file mode 100644 index 0de99e15c875..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasGetWithResponseMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.CurrentQuotaLimitBase; -import com.azure.resourcemanager.reservations.models.ResourceType; -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 QuotasGetWithResponseMockTests { - @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\":{\"limit\":21548435,\"currentValue\":1326013393,\"unit\":\"zhvfcibyfmowuxr\",\"name\":{\"value\":\"vdwxfzwi\",\"localizedValue\":\"wzjbh\"},\"resourceType\":\"lowPriority\",\"quotaPeriod\":\"jrkambtrnegvmnv\",\"properties\":\"dataeqvldspast\"},\"id\":\"bkkd\",\"name\":\"flvestmjlxrrilo\",\"type\":\"apeewchpxlkt\"}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CurrentQuotaLimitBase response = - manager - .quotas() - .getWithResponse( - "zkdnc", "dxonbzoggculap", "wyrpgogtqxepnyl", "fuajly", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(21548435, response.properties().limit()); - Assertions.assertEquals("zhvfcibyfmowuxr", response.properties().unit()); - Assertions.assertEquals("vdwxfzwi", response.properties().name().value()); - Assertions.assertEquals(ResourceType.LOW_PRIORITY, response.properties().resourceType()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasListMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasListMockTests.java deleted file mode 100644 index 386db6726b2e..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasListMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.CurrentQuotaLimitBase; -import com.azure.resourcemanager.reservations.models.ResourceType; -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 QuotasListMockTests { - @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\":{\"limit\":874924204,\"currentValue\":201174669,\"unit\":\"rr\",\"name\":{\"value\":\"gl\",\"localizedValue\":\"zgkrvqe\"},\"resourceType\":\"dedicated\",\"quotaPeriod\":\"epr\",\"properties\":\"datat\"},\"id\":\"wytpzdmovz\",\"name\":\"fvaawzqa\",\"type\":\"f\"}]}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.quotas().list("kuziycsle", "ufuztcktyhjtq", "dcgzul", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(874924204, response.iterator().next().properties().limit()); - Assertions.assertEquals("rr", response.iterator().next().properties().unit()); - Assertions.assertEquals("gl", response.iterator().next().properties().name().value()); - Assertions.assertEquals(ResourceType.DEDICATED, response.iterator().next().properties().resourceType()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestPropertiesTests.java deleted file mode 100644 index 75a38040163e..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.RefundRequestProperties; -import com.azure.resourcemanager.reservations.models.ReservationToReturn; -import org.junit.jupiter.api.Assertions; - -public final class RefundRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RefundRequestProperties model = - BinaryData - .fromString( - "{\"sessionId\":\"omzlfmi\",\"scope\":\"wbnb\",\"reservationToReturn\":{\"reservationId\":\"dawkzbali\",\"quantity\":12612409},\"returnReason\":\"hakauhashsf\"}") - .toObject(RefundRequestProperties.class); - Assertions.assertEquals("omzlfmi", model.sessionId()); - Assertions.assertEquals("wbnb", model.scope()); - Assertions.assertEquals("dawkzbali", model.reservationToReturn().reservationId()); - Assertions.assertEquals(12612409, model.reservationToReturn().quantity()); - Assertions.assertEquals("hakauhashsf", model.returnReason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RefundRequestProperties model = - new RefundRequestProperties() - .withSessionId("omzlfmi") - .withScope("wbnb") - .withReservationToReturn( - new ReservationToReturn().withReservationId("dawkzbali").withQuantity(12612409)) - .withReturnReason("hakauhashsf"); - model = BinaryData.fromObject(model).toObject(RefundRequestProperties.class); - Assertions.assertEquals("omzlfmi", model.sessionId()); - Assertions.assertEquals("wbnb", model.scope()); - Assertions.assertEquals("dawkzbali", model.reservationToReturn().reservationId()); - Assertions.assertEquals(12612409, model.reservationToReturn().quantity()); - Assertions.assertEquals("hakauhashsf", model.returnReason()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestTests.java deleted file mode 100644 index bab7e2a9367c..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.RefundRequest; -import com.azure.resourcemanager.reservations.models.RefundRequestProperties; -import com.azure.resourcemanager.reservations.models.ReservationToReturn; -import org.junit.jupiter.api.Assertions; - -public final class RefundRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RefundRequest model = - BinaryData - .fromString( - "{\"properties\":{\"sessionId\":\"c\",\"scope\":\"mdua\",\"reservationToReturn\":{\"reservationId\":\"xqpvfadmw\",\"quantity\":448234135},\"returnReason\":\"gvxp\"}}") - .toObject(RefundRequest.class); - Assertions.assertEquals("c", model.properties().sessionId()); - Assertions.assertEquals("mdua", model.properties().scope()); - Assertions.assertEquals("xqpvfadmw", model.properties().reservationToReturn().reservationId()); - Assertions.assertEquals(448234135, model.properties().reservationToReturn().quantity()); - Assertions.assertEquals("gvxp", model.properties().returnReason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RefundRequest model = - new RefundRequest() - .withProperties( - new RefundRequestProperties() - .withSessionId("c") - .withScope("mdua") - .withReservationToReturn( - new ReservationToReturn().withReservationId("xqpvfadmw").withQuantity(448234135)) - .withReturnReason("gvxp")); - model = BinaryData.fromObject(model).toObject(RefundRequest.class); - Assertions.assertEquals("c", model.properties().sessionId()); - Assertions.assertEquals("mdua", model.properties().scope()); - Assertions.assertEquals("xqpvfadmw", model.properties().reservationToReturn().reservationId()); - Assertions.assertEquals(448234135, model.properties().reservationToReturn().quantity()); - Assertions.assertEquals("gvxp", model.properties().returnReason()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationListTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationListTests.java deleted file mode 100644 index 224774d1fd44..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationListTests.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.ReservationResponseInner; -import com.azure.resourcemanager.reservations.models.AppliedScopeType; -import com.azure.resourcemanager.reservations.models.InstanceFlexibility; -import com.azure.resourcemanager.reservations.models.Kind; -import com.azure.resourcemanager.reservations.models.ProvisioningState; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationList; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import com.azure.resourcemanager.reservations.models.ReservationsProperties; -import com.azure.resourcemanager.reservations.models.ReservedResourceType; -import com.azure.resourcemanager.reservations.models.SkuName; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationList model = - BinaryData - .fromString( - "{\"value\":[{\"location\":\"yifqrvkdvjsllrmv\",\"etag\":146352395,\"sku\":{\"name\":\"t\"},\"properties\":{\"reservedResourceType\":\"AzureDataExplorer\",\"instanceFlexibility\":\"Off\",\"displayName\":\"xxbczwtr\",\"appliedScopes\":[],\"appliedScopeType\":\"Shared\",\"archived\":false,\"capabilities\":\"j\",\"quantity\":668778225,\"provisioningState\":\"Expired\",\"effectiveDateTime\":\"2020-12-29T19:47:48Z\",\"benefitStartTime\":\"2021-11-07T20:31:54Z\",\"lastUpdatedDateTime\":\"2021-01-06T15:04:50Z\",\"expiryDateTime\":\"2021-07-31T02:25:32Z\",\"reviewDateTime\":\"2021-04-15T03:02:29Z\",\"skuDescription\":\"dobpxjmflbvvn\",\"billingPlan\":\"Monthly\",\"displayProvisioningState\":\"ciwwzjuqkhr\",\"provisioningSubState\":\"jiwkuofoskghsau\",\"purchaseDateTime\":\"2021-09-27T06:41:32Z\",\"billingScopeId\":\"duugidyjr\",\"renew\":false,\"renewSource\":\"aos\",\"renewDestination\":\"xc\",\"term\":\"P1Y\",\"userFriendlyAppliedScopeType\":\"lhocohslkev\",\"userFriendlyRenewState\":\"ggzfbu\"},\"kind\":\"Microsoft.Compute\",\"id\":\"axkffei\",\"name\":\"th\",\"type\":\"vmezy\"},{\"location\":\"hxmzsbbzoggig\",\"etag\":2011180934,\"sku\":{\"name\":\"rvjx\"},\"properties\":{\"reservedResourceType\":\"AzureDataExplorer\",\"instanceFlexibility\":\"On\",\"displayName\":\"ptkoenkoukn\",\"appliedScopes\":[],\"appliedScopeType\":\"Single\",\"archived\":true,\"capabilities\":\"kbldngkpocipa\",\"quantity\":1866473569,\"provisioningState\":\"PendingResourceHold\",\"effectiveDateTime\":\"2021-01-06T21:03:44Z\",\"benefitStartTime\":\"2021-12-09T00:28:10Z\",\"lastUpdatedDateTime\":\"2021-07-16T00:56:23Z\",\"expiryDateTime\":\"2021-10-28T00:07:14Z\",\"reviewDateTime\":\"2021-07-11T10:35:30Z\",\"skuDescription\":\"gevqznty\",\"billingPlan\":\"Monthly\",\"displayProvisioningState\":\"izcdrqjsd\",\"provisioningSubState\":\"dnfyhxdeoejzicwi\",\"purchaseDateTime\":\"2021-01-05T16:16:49Z\",\"billingScopeId\":\"ishc\",\"renew\":true,\"renewSource\":\"jdeyeamdpha\",\"renewDestination\":\"lpbuxwgipwhonowk\",\"term\":\"P1Y\",\"userFriendlyAppliedScopeType\":\"nkixzbinj\",\"userFriendlyRenewState\":\"uttmrywnuzoqft\"},\"kind\":\"Microsoft.Compute\",\"id\":\"n\",\"name\":\"cqvyxlwhzlsico\",\"type\":\"oqqnwvlryav\"},{\"location\":\"heun\",\"etag\":1861834573,\"sku\":{\"name\":\"yxzk\"},\"properties\":{\"reservedResourceType\":\"MySql\",\"instanceFlexibility\":\"On\",\"displayName\":\"klyaxuconu\",\"appliedScopes\":[],\"appliedScopeType\":\"Shared\",\"archived\":true,\"capabilities\":\"ypewrmjmwvvjekt\",\"quantity\":2107215650,\"provisioningState\":\"ConfirmedBilling\",\"effectiveDateTime\":\"2020-12-26T16:44:41Z\",\"benefitStartTime\":\"2020-12-23T18:20:15Z\",\"lastUpdatedDateTime\":\"2021-11-05T02:28:20Z\",\"expiryDateTime\":\"2021-08-26T16:24:45Z\",\"reviewDateTime\":\"2021-08-02T01:11:29Z\",\"skuDescription\":\"lqdqgbiqylihka\",\"billingPlan\":\"Upfront\",\"displayProvisioningState\":\"vfcivfsnkymuc\",\"provisioningSubState\":\"hjfbebrjcxe\",\"purchaseDateTime\":\"2021-03-04T14:54:10Z\",\"billingScopeId\":\"fvjrbirphxepcy\",\"renew\":false,\"renewSource\":\"nljky\",\"renewDestination\":\"j\",\"term\":\"P1Y\",\"userFriendlyAppliedScopeType\":\"gidokgjljyoxgvcl\",\"userFriendlyRenewState\":\"gsncghkjeszz\"},\"kind\":\"Microsoft.Compute\",\"id\":\"txfvgx\",\"name\":\"fsm\",\"type\":\"nehmpvecx\"}],\"nextLink\":\"debfqkkrbmpukgri\"}") - .toObject(ReservationList.class); - Assertions.assertEquals("yifqrvkdvjsllrmv", model.value().get(0).location()); - Assertions.assertEquals(146352395, model.value().get(0).etag()); - Assertions.assertEquals("t", model.value().get(0).sku().name()); - Assertions - .assertEquals( - ReservedResourceType.AZURE_DATA_EXPLORER, model.value().get(0).properties().reservedResourceType()); - Assertions.assertEquals(InstanceFlexibility.OFF, model.value().get(0).properties().instanceFlexibility()); - Assertions.assertEquals("xxbczwtr", model.value().get(0).properties().displayName()); - Assertions.assertEquals(AppliedScopeType.SHARED, model.value().get(0).properties().appliedScopeType()); - Assertions.assertEquals(false, model.value().get(0).properties().archived()); - Assertions.assertEquals("j", model.value().get(0).properties().capabilities()); - Assertions.assertEquals(668778225, model.value().get(0).properties().quantity()); - Assertions.assertEquals(ProvisioningState.EXPIRED, model.value().get(0).properties().provisioningState()); - Assertions - .assertEquals( - OffsetDateTime.parse("2020-12-29T19:47:48Z"), model.value().get(0).properties().effectiveDateTime()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-11-07T20:31:54Z"), model.value().get(0).properties().benefitStartTime()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-07-31T02:25:32Z"), model.value().get(0).properties().expiryDateTime()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-04-15T03:02:29Z"), model.value().get(0).properties().reviewDateTime()); - Assertions.assertEquals("dobpxjmflbvvn", model.value().get(0).properties().skuDescription()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.value().get(0).properties().billingPlan()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-09-27T06:41:32Z"), model.value().get(0).properties().purchaseDateTime()); - Assertions.assertEquals("duugidyjr", model.value().get(0).properties().billingScopeId()); - Assertions.assertEquals(false, model.value().get(0).properties().renew()); - Assertions.assertEquals("aos", model.value().get(0).properties().renewSource()); - Assertions.assertEquals("xc", model.value().get(0).properties().renewDestination()); - Assertions.assertEquals(ReservationTerm.P1Y, model.value().get(0).properties().term()); - Assertions.assertEquals(Kind.MICROSOFT_COMPUTE, model.value().get(0).kind()); - Assertions.assertEquals("debfqkkrbmpukgri", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationList model = - new ReservationList() - .withValue( - Arrays - .asList( - new ReservationResponseInner() - .withLocation("yifqrvkdvjsllrmv") - .withEtag(146352395) - .withSku(new SkuName().withName("t")) - .withProperties( - new ReservationsProperties() - .withReservedResourceType(ReservedResourceType.AZURE_DATA_EXPLORER) - .withInstanceFlexibility(InstanceFlexibility.OFF) - .withDisplayName("xxbczwtr") - .withAppliedScopes(Arrays.asList()) - .withAppliedScopeType(AppliedScopeType.SHARED) - .withArchived(false) - .withCapabilities("j") - .withQuantity(668778225) - .withProvisioningState(ProvisioningState.EXPIRED) - .withEffectiveDateTime(OffsetDateTime.parse("2020-12-29T19:47:48Z")) - .withBenefitStartTime(OffsetDateTime.parse("2021-11-07T20:31:54Z")) - .withExpiryDateTime(OffsetDateTime.parse("2021-07-31T02:25:32Z")) - .withReviewDateTime(OffsetDateTime.parse("2021-04-15T03:02:29Z")) - .withSkuDescription("dobpxjmflbvvn") - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withPurchaseDateTime(OffsetDateTime.parse("2021-09-27T06:41:32Z")) - .withBillingScopeId("duugidyjr") - .withRenew(false) - .withRenewSource("aos") - .withRenewDestination("xc") - .withTerm(ReservationTerm.P1Y)) - .withKind(Kind.MICROSOFT_COMPUTE), - new ReservationResponseInner() - .withLocation("hxmzsbbzoggig") - .withEtag(2011180934) - .withSku(new SkuName().withName("rvjx")) - .withProperties( - new ReservationsProperties() - .withReservedResourceType(ReservedResourceType.AZURE_DATA_EXPLORER) - .withInstanceFlexibility(InstanceFlexibility.ON) - .withDisplayName("ptkoenkoukn") - .withAppliedScopes(Arrays.asList()) - .withAppliedScopeType(AppliedScopeType.SINGLE) - .withArchived(true) - .withCapabilities("kbldngkpocipa") - .withQuantity(1866473569) - .withProvisioningState(ProvisioningState.PENDING_RESOURCE_HOLD) - .withEffectiveDateTime(OffsetDateTime.parse("2021-01-06T21:03:44Z")) - .withBenefitStartTime(OffsetDateTime.parse("2021-12-09T00:28:10Z")) - .withExpiryDateTime(OffsetDateTime.parse("2021-10-28T00:07:14Z")) - .withReviewDateTime(OffsetDateTime.parse("2021-07-11T10:35:30Z")) - .withSkuDescription("gevqznty") - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withPurchaseDateTime(OffsetDateTime.parse("2021-01-05T16:16:49Z")) - .withBillingScopeId("ishc") - .withRenew(true) - .withRenewSource("jdeyeamdpha") - .withRenewDestination("lpbuxwgipwhonowk") - .withTerm(ReservationTerm.P1Y)) - .withKind(Kind.MICROSOFT_COMPUTE), - new ReservationResponseInner() - .withLocation("heun") - .withEtag(1861834573) - .withSku(new SkuName().withName("yxzk")) - .withProperties( - new ReservationsProperties() - .withReservedResourceType(ReservedResourceType.MY_SQL) - .withInstanceFlexibility(InstanceFlexibility.ON) - .withDisplayName("klyaxuconu") - .withAppliedScopes(Arrays.asList()) - .withAppliedScopeType(AppliedScopeType.SHARED) - .withArchived(true) - .withCapabilities("ypewrmjmwvvjekt") - .withQuantity(2107215650) - .withProvisioningState(ProvisioningState.CONFIRMED_BILLING) - .withEffectiveDateTime(OffsetDateTime.parse("2020-12-26T16:44:41Z")) - .withBenefitStartTime(OffsetDateTime.parse("2020-12-23T18:20:15Z")) - .withExpiryDateTime(OffsetDateTime.parse("2021-08-26T16:24:45Z")) - .withReviewDateTime(OffsetDateTime.parse("2021-08-02T01:11:29Z")) - .withSkuDescription("lqdqgbiqylihka") - .withBillingPlan(ReservationBillingPlan.UPFRONT) - .withPurchaseDateTime(OffsetDateTime.parse("2021-03-04T14:54:10Z")) - .withBillingScopeId("fvjrbirphxepcy") - .withRenew(false) - .withRenewSource("nljky") - .withRenewDestination("j") - .withTerm(ReservationTerm.P1Y)) - .withKind(Kind.MICROSOFT_COMPUTE))) - .withNextLink("debfqkkrbmpukgri"); - model = BinaryData.fromObject(model).toObject(ReservationList.class); - Assertions.assertEquals("yifqrvkdvjsllrmv", model.value().get(0).location()); - Assertions.assertEquals(146352395, model.value().get(0).etag()); - Assertions.assertEquals("t", model.value().get(0).sku().name()); - Assertions - .assertEquals( - ReservedResourceType.AZURE_DATA_EXPLORER, model.value().get(0).properties().reservedResourceType()); - Assertions.assertEquals(InstanceFlexibility.OFF, model.value().get(0).properties().instanceFlexibility()); - Assertions.assertEquals("xxbczwtr", model.value().get(0).properties().displayName()); - Assertions.assertEquals(AppliedScopeType.SHARED, model.value().get(0).properties().appliedScopeType()); - Assertions.assertEquals(false, model.value().get(0).properties().archived()); - Assertions.assertEquals("j", model.value().get(0).properties().capabilities()); - Assertions.assertEquals(668778225, model.value().get(0).properties().quantity()); - Assertions.assertEquals(ProvisioningState.EXPIRED, model.value().get(0).properties().provisioningState()); - Assertions - .assertEquals( - OffsetDateTime.parse("2020-12-29T19:47:48Z"), model.value().get(0).properties().effectiveDateTime()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-11-07T20:31:54Z"), model.value().get(0).properties().benefitStartTime()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-07-31T02:25:32Z"), model.value().get(0).properties().expiryDateTime()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-04-15T03:02:29Z"), model.value().get(0).properties().reviewDateTime()); - Assertions.assertEquals("dobpxjmflbvvn", model.value().get(0).properties().skuDescription()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.value().get(0).properties().billingPlan()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-09-27T06:41:32Z"), model.value().get(0).properties().purchaseDateTime()); - Assertions.assertEquals("duugidyjr", model.value().get(0).properties().billingScopeId()); - Assertions.assertEquals(false, model.value().get(0).properties().renew()); - Assertions.assertEquals("aos", model.value().get(0).properties().renewSource()); - Assertions.assertEquals("xc", model.value().get(0).properties().renewDestination()); - Assertions.assertEquals(ReservationTerm.P1Y, model.value().get(0).properties().term()); - Assertions.assertEquals(Kind.MICROSOFT_COMPUTE, model.value().get(0).kind()); - Assertions.assertEquals("debfqkkrbmpukgri", model.nextLink()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationMergePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationMergePropertiesTests.java deleted file mode 100644 index 098cac43f629..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationMergePropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ReservationMergeProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationMergePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationMergeProperties model = - BinaryData - .fromString("{\"mergeDestination\":\"tgrhpdjpjumas\",\"mergeSources\":[\"jpqyegu\"]}") - .toObject(ReservationMergeProperties.class); - Assertions.assertEquals("tgrhpdjpjumas", model.mergeDestination()); - Assertions.assertEquals("jpqyegu", model.mergeSources().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationMergeProperties model = - new ReservationMergeProperties() - .withMergeDestination("tgrhpdjpjumas") - .withMergeSources(Arrays.asList("jpqyegu")); - model = BinaryData.fromObject(model).toObject(ReservationMergeProperties.class); - Assertions.assertEquals("tgrhpdjpjumas", model.mergeDestination()); - Assertions.assertEquals("jpqyegu", model.mergeSources().get(0)); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrderListTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrderListTests.java deleted file mode 100644 index 6afd0697daaa..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrderListTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.ReservationOrderResponseInner; -import com.azure.resourcemanager.reservations.models.ProvisioningState; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationOrderList; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationOrderListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationOrderList model = - BinaryData - .fromString( - "{\"value\":[{\"etag\":44234410,\"properties\":{\"displayName\":\"rlyxwjkcprbnw\",\"requestDateTime\":\"2021-05-06T10:18:25Z\",\"createdDateTime\":\"2021-07-23T00:34:49Z\",\"expiryDateTime\":\"2021-01-24T18:28:17Z\",\"benefitStartTime\":\"2021-05-10T19:00:57Z\",\"originalQuantity\":1314012997,\"term\":\"P3Y\",\"provisioningState\":\"Creating\",\"billingPlan\":\"Upfront\",\"reservations\":[],\"reviewDateTime\":\"2021-02-25T06:26:56Z\"},\"id\":\"uouq\",\"name\":\"prwzwbnguitnwui\",\"type\":\"gazxuf\"},{\"etag\":1325323583,\"properties\":{\"displayName\":\"y\",\"requestDateTime\":\"2021-07-28T21:30:24Z\",\"createdDateTime\":\"2021-11-08T13:56:21Z\",\"expiryDateTime\":\"2021-07-21T12:31:03Z\",\"benefitStartTime\":\"2021-11-01T04:03:29Z\",\"originalQuantity\":134248992,\"term\":\"P1Y\",\"provisioningState\":\"Cancelled\",\"billingPlan\":\"Monthly\",\"reservations\":[],\"reviewDateTime\":\"2021-04-25T02:46:04Z\"},\"id\":\"fthwxmnteiwa\",\"name\":\"pvkmijcmmxdcuf\",\"type\":\"fsrpymzidnse\"},{\"etag\":1219718844,\"properties\":{\"displayName\":\"zsgfyccsnewmd\",\"requestDateTime\":\"2021-01-08T04:58:25Z\",\"createdDateTime\":\"2021-11-27T18:08Z\",\"expiryDateTime\":\"2021-08-09T00:52:58Z\",\"benefitStartTime\":\"2021-06-19T08:04:11Z\",\"originalQuantity\":317245764,\"term\":\"P1Y\",\"provisioningState\":\"Creating\",\"billingPlan\":\"Monthly\",\"reservations\":[],\"reviewDateTime\":\"2021-08-27T09:45:25Z\"},\"id\":\"ehzzvypyqrim\",\"name\":\"inpvswjdkirsoodq\",\"type\":\"hc\"},{\"etag\":1265522776,\"properties\":{\"displayName\":\"jtckwhdso\",\"requestDateTime\":\"2021-12-08T08:28:27Z\",\"createdDateTime\":\"2020-12-23T06:13:14Z\",\"expiryDateTime\":\"2021-10-18T02:17:27Z\",\"benefitStartTime\":\"2021-02-24T22:15:36Z\",\"originalQuantity\":1459693032,\"term\":\"P3Y\",\"provisioningState\":\"BillingFailed\",\"billingPlan\":\"Monthly\",\"reservations\":[],\"reviewDateTime\":\"2021-08-28T21:50:54Z\"},\"id\":\"vsnb\",\"name\":\"xqabnmocpcysh\",\"type\":\"rzafbljjgpbtoqcj\"}],\"nextLink\":\"ljavbqid\"}") - .toObject(ReservationOrderList.class); - Assertions.assertEquals(44234410, model.value().get(0).etag()); - Assertions.assertEquals("rlyxwjkcprbnw", model.value().get(0).displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T10:18:25Z"), model.value().get(0).requestDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-23T00:34:49Z"), model.value().get(0).createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-24T18:28:17Z"), model.value().get(0).expiryDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T19:00:57Z"), model.value().get(0).benefitStartTime()); - Assertions.assertEquals(1314012997, model.value().get(0).originalQuantity()); - Assertions.assertEquals(ReservationTerm.P3Y, model.value().get(0).term()); - Assertions.assertEquals(ProvisioningState.CREATING, model.value().get(0).provisioningState()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.value().get(0).billingPlan()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T06:26:56Z"), model.value().get(0).reviewDateTime()); - Assertions.assertEquals("ljavbqid", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationOrderList model = - new ReservationOrderList() - .withValue( - Arrays - .asList( - new ReservationOrderResponseInner() - .withEtag(44234410) - .withDisplayName("rlyxwjkcprbnw") - .withRequestDateTime(OffsetDateTime.parse("2021-05-06T10:18:25Z")) - .withCreatedDateTime(OffsetDateTime.parse("2021-07-23T00:34:49Z")) - .withExpiryDateTime(OffsetDateTime.parse("2021-01-24T18:28:17Z")) - .withBenefitStartTime(OffsetDateTime.parse("2021-05-10T19:00:57Z")) - .withOriginalQuantity(1314012997) - .withTerm(ReservationTerm.P3Y) - .withProvisioningState(ProvisioningState.CREATING) - .withBillingPlan(ReservationBillingPlan.UPFRONT) - .withReservations(Arrays.asList()) - .withReviewDateTime(OffsetDateTime.parse("2021-02-25T06:26:56Z")), - new ReservationOrderResponseInner() - .withEtag(1325323583) - .withDisplayName("y") - .withRequestDateTime(OffsetDateTime.parse("2021-07-28T21:30:24Z")) - .withCreatedDateTime(OffsetDateTime.parse("2021-11-08T13:56:21Z")) - .withExpiryDateTime(OffsetDateTime.parse("2021-07-21T12:31:03Z")) - .withBenefitStartTime(OffsetDateTime.parse("2021-11-01T04:03:29Z")) - .withOriginalQuantity(134248992) - .withTerm(ReservationTerm.P1Y) - .withProvisioningState(ProvisioningState.CANCELLED) - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withReservations(Arrays.asList()) - .withReviewDateTime(OffsetDateTime.parse("2021-04-25T02:46:04Z")), - new ReservationOrderResponseInner() - .withEtag(1219718844) - .withDisplayName("zsgfyccsnewmd") - .withRequestDateTime(OffsetDateTime.parse("2021-01-08T04:58:25Z")) - .withCreatedDateTime(OffsetDateTime.parse("2021-11-27T18:08Z")) - .withExpiryDateTime(OffsetDateTime.parse("2021-08-09T00:52:58Z")) - .withBenefitStartTime(OffsetDateTime.parse("2021-06-19T08:04:11Z")) - .withOriginalQuantity(317245764) - .withTerm(ReservationTerm.P1Y) - .withProvisioningState(ProvisioningState.CREATING) - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withReservations(Arrays.asList()) - .withReviewDateTime(OffsetDateTime.parse("2021-08-27T09:45:25Z")), - new ReservationOrderResponseInner() - .withEtag(1265522776) - .withDisplayName("jtckwhdso") - .withRequestDateTime(OffsetDateTime.parse("2021-12-08T08:28:27Z")) - .withCreatedDateTime(OffsetDateTime.parse("2020-12-23T06:13:14Z")) - .withExpiryDateTime(OffsetDateTime.parse("2021-10-18T02:17:27Z")) - .withBenefitStartTime(OffsetDateTime.parse("2021-02-24T22:15:36Z")) - .withOriginalQuantity(1459693032) - .withTerm(ReservationTerm.P3Y) - .withProvisioningState(ProvisioningState.BILLING_FAILED) - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withReservations(Arrays.asList()) - .withReviewDateTime(OffsetDateTime.parse("2021-08-28T21:50:54Z")))) - .withNextLink("ljavbqid"); - model = BinaryData.fromObject(model).toObject(ReservationOrderList.class); - Assertions.assertEquals(44234410, model.value().get(0).etag()); - Assertions.assertEquals("rlyxwjkcprbnw", model.value().get(0).displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T10:18:25Z"), model.value().get(0).requestDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-23T00:34:49Z"), model.value().get(0).createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-24T18:28:17Z"), model.value().get(0).expiryDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T19:00:57Z"), model.value().get(0).benefitStartTime()); - Assertions.assertEquals(1314012997, model.value().get(0).originalQuantity()); - Assertions.assertEquals(ReservationTerm.P3Y, model.value().get(0).term()); - Assertions.assertEquals(ProvisioningState.CREATING, model.value().get(0).provisioningState()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.value().get(0).billingPlan()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T06:26:56Z"), model.value().get(0).reviewDateTime()); - Assertions.assertEquals("ljavbqid", model.nextLink()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrderResponseInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrderResponseInnerTests.java deleted file mode 100644 index 0c4b4d3351da..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrderResponseInnerTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.ReservationOrderResponseInner; -import com.azure.resourcemanager.reservations.fluent.models.ReservationResponseInner; -import com.azure.resourcemanager.reservations.models.Kind; -import com.azure.resourcemanager.reservations.models.ProvisioningState; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationOrderBillingPlanInformation; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationOrderResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationOrderResponseInner model = - BinaryData - .fromString( - "{\"etag\":1381464845,\"properties\":{\"displayName\":\"yulpkudjkr\",\"requestDateTime\":\"2021-10-21T07:00:30Z\",\"createdDateTime\":\"2021-05-27T14:40:55Z\",\"expiryDateTime\":\"2021-01-13T00:49:17Z\",\"benefitStartTime\":\"2021-06-22T06:44:59Z\",\"originalQuantity\":384033547,\"term\":\"P1Y\",\"provisioningState\":\"Failed\",\"billingPlan\":\"Monthly\",\"planInformation\":{\"transactions\":[]},\"reservations\":[{\"location\":\"hhbcsglummajtjao\",\"etag\":1555681942,\"kind\":\"Microsoft.Compute\",\"id\":\"k\",\"name\":\"pxokajionp\",\"type\":\"mexgstxgcp\"},{\"location\":\"gmaajrm\",\"etag\":1305884847,\"kind\":\"Microsoft.Compute\",\"id\":\"vmclw\",\"name\":\"ijcoejctb\",\"type\":\"aqsqsycbkbfk\"},{\"location\":\"kdkexxp\",\"etag\":922056801,\"kind\":\"Microsoft.Compute\",\"id\":\"fjpgddtocjjxhvp\",\"name\":\"o\",\"type\":\"exhd\"}],\"reviewDateTime\":\"2021-09-06T23:00:29Z\"},\"id\":\"qeojnxqbzvddntw\",\"name\":\"deicbtwnpzao\",\"type\":\"vuhrhcffcyddgl\"}") - .toObject(ReservationOrderResponseInner.class); - Assertions.assertEquals(1381464845, model.etag()); - Assertions.assertEquals("yulpkudjkr", model.displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-21T07:00:30Z"), model.requestDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-27T14:40:55Z"), model.createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-13T00:49:17Z"), model.expiryDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T06:44:59Z"), model.benefitStartTime()); - Assertions.assertEquals(384033547, model.originalQuantity()); - Assertions.assertEquals(ReservationTerm.P1Y, model.term()); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.billingPlan()); - Assertions.assertEquals("hhbcsglummajtjao", model.reservations().get(0).location()); - Assertions.assertEquals(1555681942, model.reservations().get(0).etag()); - Assertions.assertEquals(Kind.MICROSOFT_COMPUTE, model.reservations().get(0).kind()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-06T23:00:29Z"), model.reviewDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationOrderResponseInner model = - new ReservationOrderResponseInner() - .withEtag(1381464845) - .withDisplayName("yulpkudjkr") - .withRequestDateTime(OffsetDateTime.parse("2021-10-21T07:00:30Z")) - .withCreatedDateTime(OffsetDateTime.parse("2021-05-27T14:40:55Z")) - .withExpiryDateTime(OffsetDateTime.parse("2021-01-13T00:49:17Z")) - .withBenefitStartTime(OffsetDateTime.parse("2021-06-22T06:44:59Z")) - .withOriginalQuantity(384033547) - .withTerm(ReservationTerm.P1Y) - .withProvisioningState(ProvisioningState.FAILED) - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withPlanInformation(new ReservationOrderBillingPlanInformation().withTransactions(Arrays.asList())) - .withReservations( - Arrays - .asList( - new ReservationResponseInner() - .withLocation("hhbcsglummajtjao") - .withEtag(1555681942) - .withKind(Kind.MICROSOFT_COMPUTE), - new ReservationResponseInner() - .withLocation("gmaajrm") - .withEtag(1305884847) - .withKind(Kind.MICROSOFT_COMPUTE), - new ReservationResponseInner() - .withLocation("kdkexxp") - .withEtag(922056801) - .withKind(Kind.MICROSOFT_COMPUTE))) - .withReviewDateTime(OffsetDateTime.parse("2021-09-06T23:00:29Z")); - model = BinaryData.fromObject(model).toObject(ReservationOrderResponseInner.class); - Assertions.assertEquals(1381464845, model.etag()); - Assertions.assertEquals("yulpkudjkr", model.displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-21T07:00:30Z"), model.requestDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-27T14:40:55Z"), model.createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-13T00:49:17Z"), model.expiryDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T06:44:59Z"), model.benefitStartTime()); - Assertions.assertEquals(384033547, model.originalQuantity()); - Assertions.assertEquals(ReservationTerm.P1Y, model.term()); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.billingPlan()); - Assertions.assertEquals("hhbcsglummajtjao", model.reservations().get(0).location()); - Assertions.assertEquals(1555681942, model.reservations().get(0).etag()); - Assertions.assertEquals(Kind.MICROSOFT_COMPUTE, model.reservations().get(0).kind()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-06T23:00:29Z"), model.reviewDateTime()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersChangeDirectoryWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersChangeDirectoryWithResponseMockTests.java deleted file mode 100644 index 935423908135..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersChangeDirectoryWithResponseMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.ChangeDirectoryRequest; -import com.azure.resourcemanager.reservations.models.ChangeDirectoryResponse; -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 ReservationOrdersChangeDirectoryWithResponseMockTests { - @Test - public void testChangeDirectoryWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"reservationOrder\":{\"id\":\"zshq\",\"name\":\"impevf\",\"isSucceeded\":false,\"error\":\"rrilbywdxsmic\"},\"reservations\":[{\"id\":\"fscjfnynszquji\",\"name\":\"voqyt\",\"isSucceeded\":false,\"error\":\"wb\"},{\"id\":\"gyavu\",\"name\":\"thjoxoism\",\"isSucceeded\":false,\"error\":\"pi\"},{\"id\":\"qolj\",\"name\":\"cgxxlxs\",\"isSucceeded\":true,\"error\":\"vizqzdwl\"},{\"id\":\"lyoupfgfbkju\",\"name\":\"yhgk\",\"isSucceeded\":false,\"error\":\"sgow\"}]}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ChangeDirectoryResponse response = - manager - .reservationOrders() - .changeDirectoryWithResponse( - "otcubi", - new ChangeDirectoryRequest().withDestinationTenantId("uipwoqonmacje"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zshq", response.reservationOrder().id()); - Assertions.assertEquals("impevf", response.reservationOrder().name()); - Assertions.assertEquals(false, response.reservationOrder().isSucceeded()); - Assertions.assertEquals("rrilbywdxsmic", response.reservationOrder().error()); - Assertions.assertEquals("fscjfnynszquji", response.reservations().get(0).id()); - Assertions.assertEquals("voqyt", response.reservations().get(0).name()); - Assertions.assertEquals(false, response.reservations().get(0).isSucceeded()); - Assertions.assertEquals("wb", response.reservations().get(0).error()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersGetWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersGetWithResponseMockTests.java deleted file mode 100644 index 177088f3d64a..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersGetWithResponseMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.ProvisioningState; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationOrderResponse; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -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 ReservationOrdersGetWithResponseMockTests { - @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 = - "{\"etag\":1394452791,\"properties\":{\"displayName\":\"rwrbi\",\"requestDateTime\":\"2021-02-28T14:54:18Z\",\"createdDateTime\":\"2021-07-22T12:33Z\",\"expiryDateTime\":\"2021-12-04T14:45:36Z\",\"benefitStartTime\":\"2021-09-24T23:29:19Z\",\"originalQuantity\":1788432373,\"term\":\"P5Y\",\"provisioningState\":\"Failed\",\"billingPlan\":\"Monthly\",\"planInformation\":{\"transactions\":[]},\"reservations\":[],\"reviewDateTime\":\"2021-10-29T21:13:13Z\"},\"id\":\"dufiq\",\"name\":\"dieuzaofj\",\"type\":\"hvcyyysfg\"}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ReservationOrderResponse response = - manager - .reservationOrders() - .getWithResponse("epzl", "phwzsoldweyuqdu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(1394452791, response.etag()); - Assertions.assertEquals("rwrbi", response.displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-28T14:54:18Z"), response.requestDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-22T12:33Z"), response.createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-04T14:45:36Z"), response.expiryDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-24T23:29:19Z"), response.benefitStartTime()); - Assertions.assertEquals(1788432373, response.originalQuantity()); - Assertions.assertEquals(ReservationTerm.P5Y, response.term()); - Assertions.assertEquals(ProvisioningState.FAILED, response.provisioningState()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, response.billingPlan()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-29T21:13:13Z"), response.reviewDateTime()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersListMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersListMockTests.java deleted file mode 100644 index 32c58abe30ef..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersListMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.ProvisioningState; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationOrderResponse; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -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 ReservationOrdersListMockTests { - @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\":[{\"etag\":893794792,\"properties\":{\"displayName\":\"zbrhubskhudyg\",\"requestDateTime\":\"2021-02-04T04:44:46Z\",\"createdDateTime\":\"2021-10-06T17:04:50Z\",\"expiryDateTime\":\"2021-01-08T15:56:19Z\",\"benefitStartTime\":\"2021-07-12T13:05:01Z\",\"originalQuantity\":1122494487,\"term\":\"P1Y\",\"provisioningState\":\"Created\",\"billingPlan\":\"Monthly\",\"planInformation\":{\"transactions\":[]},\"reservations\":[],\"reviewDateTime\":\"2021-05-04T19:19:19Z\"},\"id\":\"nqqyba\",\"name\":\"yeua\",\"type\":\"jkqa\"}]}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.reservationOrders().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(893794792, response.iterator().next().etag()); - Assertions.assertEquals("zbrhubskhudyg", response.iterator().next().displayName()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-02-04T04:44:46Z"), response.iterator().next().requestDateTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-10-06T17:04:50Z"), response.iterator().next().createdDateTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-08T15:56:19Z"), response.iterator().next().expiryDateTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-07-12T13:05:01Z"), response.iterator().next().benefitStartTime()); - Assertions.assertEquals(1122494487, response.iterator().next().originalQuantity()); - Assertions.assertEquals(ReservationTerm.P1Y, response.iterator().next().term()); - Assertions.assertEquals(ProvisioningState.CREATED, response.iterator().next().provisioningState()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, response.iterator().next().billingPlan()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-05-04T19:19:19Z"), response.iterator().next().reviewDateTime()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersPurchaseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersPurchaseMockTests.java deleted file mode 100644 index 0ef8736098b7..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersPurchaseMockTests.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.AppliedScopeProperties; -import com.azure.resourcemanager.reservations.models.AppliedScopeType; -import com.azure.resourcemanager.reservations.models.InstanceFlexibility; -import com.azure.resourcemanager.reservations.models.ProvisioningState; -import com.azure.resourcemanager.reservations.models.PurchaseRequest; -import com.azure.resourcemanager.reservations.models.PurchaseRequestPropertiesReservedResourceProperties; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationOrderResponse; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import com.azure.resourcemanager.reservations.models.ReservedResourceType; -import com.azure.resourcemanager.reservations.models.SkuName; -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 ReservationOrdersPurchaseMockTests { - @Test - public void testPurchase() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"etag\":930110171,\"properties\":{\"displayName\":\"mduvw\",\"requestDateTime\":\"2021-07-13T14:15:30Z\",\"createdDateTime\":\"2021-02-12T11:01:27Z\",\"expiryDateTime\":\"2021-10-06T10:39:24Z\",\"benefitStartTime\":\"2021-01-18T09:11:28Z\",\"originalQuantity\":1521698279,\"term\":\"P3Y\",\"provisioningState\":\"Succeeded\",\"billingPlan\":\"Upfront\",\"planInformation\":{\"transactions\":[]},\"reservations\":[],\"reviewDateTime\":\"2021-01-06T23:48:23Z\"},\"id\":\"xgibbda\",\"name\":\"confozauors\",\"type\":\"kokwbqplhlvnu\"}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ReservationOrderResponse response = - manager - .reservationOrders() - .purchase( - "qgzsles", - new PurchaseRequest() - .withSku(new SkuName().withName("hernntiewdjc")) - .withLocation("quwrbehwag") - .withReservedResourceType(ReservedResourceType.SQL_DATABASES) - .withBillingScopeId("fkmr") - .withTerm(ReservationTerm.P1Y) - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withQuantity(901267810) - .withDisplayName("tdrjfutacoebj") - .withAppliedScopeType(AppliedScopeType.SHARED) - .withAppliedScopes(Arrays.asList("jznmwcpmguaa", "raufactkahzova", "j")) - .withAppliedScopeProperties( - new AppliedScopeProperties() - .withTenantId("xxpshneeku") - .withManagementGroupId("gs") - .withSubscriptionId("ubkwdle") - .withResourceGroupId("d") - .withDisplayName("tujbazpju")) - .withRenew(true) - .withReservedResourceProperties( - new PurchaseRequestPropertiesReservedResourceProperties() - .withInstanceFlexibility(InstanceFlexibility.ON)) - .withReviewDateTime(OffsetDateTime.parse("2021-09-28T06:02:31Z")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(930110171, response.etag()); - Assertions.assertEquals("mduvw", response.displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-13T14:15:30Z"), response.requestDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-12T11:01:27Z"), response.createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-06T10:39:24Z"), response.expiryDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-18T09:11:28Z"), response.benefitStartTime()); - Assertions.assertEquals(1521698279, response.originalQuantity()); - Assertions.assertEquals(ReservationTerm.P3Y, response.term()); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.provisioningState()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, response.billingPlan()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-06T23:48:23Z"), response.reviewDateTime()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSplitPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSplitPropertiesTests.java deleted file mode 100644 index 77724c581b5e..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSplitPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ReservationSplitProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationSplitPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationSplitProperties model = - BinaryData - .fromString( - "{\"splitDestinations\":[\"pmng\",\"zscxaqwo\",\"chcbonqvpkvlrxnj\",\"ase\"],\"splitSource\":\"heoflokeyyienjbd\"}") - .toObject(ReservationSplitProperties.class); - Assertions.assertEquals("pmng", model.splitDestinations().get(0)); - Assertions.assertEquals("heoflokeyyienjbd", model.splitSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSplitProperties model = - new ReservationSplitProperties() - .withSplitDestinations(Arrays.asList("pmng", "zscxaqwo", "chcbonqvpkvlrxnj", "ase")) - .withSplitSource("heoflokeyyienjbd"); - model = BinaryData.fromObject(model).toObject(ReservationSplitProperties.class); - Assertions.assertEquals("pmng", model.splitDestinations().get(0)); - Assertions.assertEquals("heoflokeyyienjbd", model.splitSource()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSummaryTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSummaryTests.java deleted file mode 100644 index c615437396d2..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSummaryTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ReservationSummary; - -public final class ReservationSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationSummary model = - BinaryData - .fromString( - "{\"succeededCount\":97.05061,\"failedCount\":66.746765,\"expiringCount\":45.434547,\"expiredCount\":84.36373,\"pendingCount\":53.358547,\"cancelledCount\":92.30203,\"processingCount\":29.975636,\"warningCount\":88.98033,\"noBenefitCount\":47.970165}") - .toObject(ReservationSummary.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSummary model = new ReservationSummary(); - model = BinaryData.fromObject(model).toObject(ReservationSummary.class); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSwapPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSwapPropertiesTests.java deleted file mode 100644 index e776570bf8d5..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSwapPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ReservationSwapProperties; -import org.junit.jupiter.api.Assertions; - -public final class ReservationSwapPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationSwapProperties model = - BinaryData - .fromString("{\"swapSource\":\"hb\",\"swapDestination\":\"hejjz\"}") - .toObject(ReservationSwapProperties.class); - Assertions.assertEquals("hb", model.swapSource()); - Assertions.assertEquals("hejjz", model.swapDestination()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSwapProperties model = - new ReservationSwapProperties().withSwapSource("hb").withSwapDestination("hejjz"); - model = BinaryData.fromObject(model).toObject(ReservationSwapProperties.class); - Assertions.assertEquals("hb", model.swapSource()); - Assertions.assertEquals("hejjz", model.swapDestination()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationToReturnTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationToReturnTests.java deleted file mode 100644 index 257521cb8a67..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationToReturnTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ReservationToReturn; -import org.junit.jupiter.api.Assertions; - -public final class ReservationToReturnTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationToReturn model = - BinaryData - .fromString("{\"reservationId\":\"rxv\",\"quantity\":76468143}") - .toObject(ReservationToReturn.class); - Assertions.assertEquals("rxv", model.reservationId()); - Assertions.assertEquals(76468143, model.quantity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationToReturn model = new ReservationToReturn().withReservationId("rxv").withQuantity(76468143); - model = BinaryData.fromObject(model).toObject(ReservationToReturn.class); - Assertions.assertEquals("rxv", model.reservationId()); - Assertions.assertEquals(76468143, model.quantity()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationUtilizationAggregatesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationUtilizationAggregatesTests.java deleted file mode 100644 index da191b6abc2c..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationUtilizationAggregatesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ReservationUtilizationAggregates; - -public final class ReservationUtilizationAggregatesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationUtilizationAggregates model = - BinaryData - .fromString( - "{\"grain\":84.77034,\"grainUnit\":\"tpngjcrcczsqpjh\",\"value\":15.68377,\"valueUnit\":\"jvnysounqe\"}") - .toObject(ReservationUtilizationAggregates.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationUtilizationAggregates model = new ReservationUtilizationAggregates(); - model = BinaryData.fromObject(model).toObject(ReservationUtilizationAggregates.class); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsArchiveWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsArchiveWithResponseMockTests.java deleted file mode 100644 index dfa7dba24af5..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsArchiveWithResponseMockTests.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.reservations.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.reservations.ReservationsManager; -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 ReservationsArchiveWithResponseMockTests { - @Test - public void testArchiveWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.reservations().archiveWithResponse("pdso", "bshrnsvbuswd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsAvailableScopesMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsAvailableScopesMockTests.java deleted file mode 100644 index e1956ed0ca77..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsAvailableScopesMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.AvailableScopeProperties; -import com.azure.resourcemanager.reservations.models.AvailableScopeRequest; -import com.azure.resourcemanager.reservations.models.AvailableScopeRequestProperties; -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 ReservationsAvailableScopesMockTests { - @Test - public void testAvailableScopes() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"properties\":{\"scopes\":[]}}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AvailableScopeProperties response = - manager - .reservations() - .availableScopes( - "t", - "udutnco", - new AvailableScopeRequest() - .withProperties( - new AvailableScopeRequestProperties().withScopes(Arrays.asList("xqtvcofu", "f", "vkg"))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsListResultTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsListResultTests.java deleted file mode 100644 index 2f0459f288ef..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsListResultTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ReservationSummary; -import com.azure.resourcemanager.reservations.models.ReservationsListResult; - -public final class ReservationsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"location\":\"sdyhtozfikdowwq\",\"etag\":180318621,\"sku\":{\"name\":\"xclvit\"},\"properties\":{\"reservedResourceType\":\"PostgreSql\",\"instanceFlexibility\":\"Off\",\"displayName\":\"sg\",\"appliedScopes\":[],\"appliedScopeType\":\"Shared\",\"archived\":true,\"capabilities\":\"wdsjnkalju\",\"quantity\":1151274297,\"provisioningState\":\"Created\",\"effectiveDateTime\":\"2020-12-21T01:44:52Z\",\"benefitStartTime\":\"2021-01-31T14:58:09Z\",\"lastUpdatedDateTime\":\"2021-02-03T13:27:34Z\",\"expiryDateTime\":\"2021-08-03T21:42:41Z\",\"reviewDateTime\":\"2021-09-01T23:23:38Z\",\"skuDescription\":\"fvhqc\",\"billingPlan\":\"Upfront\",\"displayProvisioningState\":\"pnppfuf\",\"provisioningSubState\":\"wdmhdlxyjrxs\",\"purchaseDateTime\":\"2021-06-03T10:11:42Z\",\"billingScopeId\":\"wqapnedgfbcvk\",\"renew\":false,\"renewSource\":\"pkeqdcvdrhvoo\",\"renewDestination\":\"otbobzdopcj\",\"term\":\"P5Y\",\"userFriendlyAppliedScopeType\":\"ld\",\"userFriendlyRenewState\":\"gx\"},\"kind\":\"Microsoft.Compute\",\"id\":\"pmutwuo\",\"name\":\"grpkhjwniyqs\",\"type\":\"uicpd\"},{\"location\":\"kzzlvmbmpaxmodf\",\"etag\":843823748,\"sku\":{\"name\":\"wsbpfvm\"},\"properties\":{\"reservedResourceType\":\"RedHatOsa\",\"instanceFlexibility\":\"Off\",\"displayName\":\"yftaakcpw\",\"appliedScopes\":[],\"appliedScopeType\":\"Shared\",\"archived\":true,\"capabilities\":\"nubexk\",\"quantity\":1583015875,\"provisioningState\":\"Created\",\"effectiveDateTime\":\"2021-10-14T06:39:18Z\",\"benefitStartTime\":\"2021-08-27T04:53:59Z\",\"lastUpdatedDateTime\":\"2021-04-01T23:21:50Z\",\"expiryDateTime\":\"2021-06-21T21:58:07Z\",\"reviewDateTime\":\"2021-02-28T11:46:10Z\",\"skuDescription\":\"mg\",\"billingPlan\":\"Monthly\",\"displayProvisioningState\":\"hojvpajqgxysmocm\",\"provisioningSubState\":\"fqvm\",\"purchaseDateTime\":\"2020-12-29T20:52:17Z\",\"billingScopeId\":\"elxprglyatddck\",\"renew\":true,\"renewSource\":\"ejrjxgciqibrho\",\"renewDestination\":\"sdqrhzoymibmrq\",\"term\":\"P5Y\",\"userFriendlyAppliedScopeType\":\"wfluszdt\",\"userFriendlyRenewState\":\"rkwofyyvoqa\"},\"kind\":\"Microsoft.Compute\",\"id\":\"pbtg\",\"name\":\"wbwo\",\"type\":\"nwashrtd\"}],\"nextLink\":\"cnqxwbpokulpi\",\"summary\":{\"succeededCount\":41.262604,\"failedCount\":32.788704,\"expiringCount\":56.51915,\"expiredCount\":4.018074,\"pendingCount\":24.116928,\"cancelledCount\":15.7264595,\"processingCount\":62.802547,\"warningCount\":28.490322,\"noBenefitCount\":59.630554}}") - .toObject(ReservationsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationsListResult model = new ReservationsListResult().withSummary(new ReservationSummary()); - model = BinaryData.fromObject(model).toObject(ReservationsListResult.class); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsMergeMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsMergeMockTests.java deleted file mode 100644 index 2c5b85c7ce48..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsMergeMockTests.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.AppliedScopeType; -import com.azure.resourcemanager.reservations.models.InstanceFlexibility; -import com.azure.resourcemanager.reservations.models.Kind; -import com.azure.resourcemanager.reservations.models.MergeRequest; -import com.azure.resourcemanager.reservations.models.ProvisioningState; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationResponse; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import com.azure.resourcemanager.reservations.models.ReservedResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.List; -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 ReservationsMergeMockTests { - @Test - public void testMerge() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "[{\"location\":\"hxvrhmzkwpjg\",\"etag\":856431804,\"sku\":{\"name\":\"ghftqsxhqxujxuk\"},\"properties\":{\"reservedResourceType\":\"AzureFiles\",\"instanceFlexibility\":\"Off\",\"displayName\":\"jguufzdm\",\"appliedScopes\":[\"tfih\",\"hbotzingamvppho\",\"zqzudph\",\"amvdkfwynwcvtbv\"],\"appliedScopeType\":\"Single\",\"archived\":false,\"capabilities\":\"nvyq\",\"quantity\":686807657,\"provisioningState\":\"Failed\",\"effectiveDateTime\":\"2021-05-19T06:58:08Z\",\"benefitStartTime\":\"2021-08-16T19:44:14Z\",\"lastUpdatedDateTime\":\"2021-09-23T11:43:17Z\",\"expiryDateTime\":\"2021-02-07T21:37:46Z\",\"reviewDateTime\":\"2021-05-22T23:16:36Z\",\"skuDescription\":\"gvvs\",\"billingPlan\":\"Upfront\",\"displayProvisioningState\":\"g\",\"provisioningSubState\":\"fhwygzlvdnkfxus\",\"purchaseDateTime\":\"2021-02-14T09:42:03Z\",\"billingScopeId\":\"apfcqdpsq\",\"renew\":true,\"renewSource\":\"svuo\",\"renewDestination\":\"gc\",\"term\":\"P5Y\",\"userFriendlyAppliedScopeType\":\"zrypqlmfeokerqw\",\"userFriendlyRenewState\":\"hkobopgxedk\"},\"kind\":\"Microsoft.Compute\",\"id\":\"qpcrf\",\"name\":\"bwccsnjvcdwxlpqe\",\"type\":\"ftnkhtj\"},{\"location\":\"i\",\"etag\":2104302004,\"sku\":{\"name\":\"atmtdhtmdvy\"},\"properties\":{\"reservedResourceType\":\"Databricks\",\"instanceFlexibility\":\"On\",\"displayName\":\"zywkb\",\"appliedScopes\":[\"yuzhlhkjoqrvq\",\"aatjinrvgoupmfi\"],\"appliedScopeType\":\"Shared\",\"archived\":false,\"capabilities\":\"ioolvrwxkvtkkgll\",\"quantity\":342609300,\"provisioningState\":\"Split\",\"effectiveDateTime\":\"2021-07-24T13:52:35Z\",\"benefitStartTime\":\"2021-03-15T01:10:56Z\",\"lastUpdatedDateTime\":\"2021-05-06T19:16:01Z\",\"expiryDateTime\":\"2021-04-03T14:41:24Z\",\"reviewDateTime\":\"2021-03-17T12:51:03Z\",\"skuDescription\":\"uhbxvvy\",\"billingPlan\":\"Monthly\",\"displayProvisioningState\":\"byrqufeg\",\"provisioningSubState\":\"vwz\",\"purchaseDateTime\":\"2021-03-16T15:12:59Z\",\"billingScopeId\":\"p\",\"renew\":false,\"renewSource\":\"tvgbmhrixkwmy\",\"renewDestination\":\"ejvegrhbpnaixex\",\"term\":\"P5Y\",\"userFriendlyAppliedScopeType\":\"eaxhcexdrrvqahqk\",\"userFriendlyRenewState\":\"tpwijnh\"},\"kind\":\"Microsoft.Compute\",\"id\":\"ycxzbfvoo\",\"name\":\"vrvmtgjqppyost\",\"type\":\"on\"}]"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - List response = - manager - .reservations() - .merge( - "ldvriiiojnalghfk", - new MergeRequest().withSources(Arrays.asList("ex", "owueluqh")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hxvrhmzkwpjg", response.get(0).location()); - Assertions.assertEquals(856431804, response.get(0).etag()); - Assertions.assertEquals("ghftqsxhqxujxuk", response.get(0).sku().name()); - Assertions.assertEquals(ReservedResourceType.AZURE_FILES, response.get(0).properties().reservedResourceType()); - Assertions.assertEquals(InstanceFlexibility.OFF, response.get(0).properties().instanceFlexibility()); - Assertions.assertEquals("jguufzdm", response.get(0).properties().displayName()); - Assertions.assertEquals("tfih", response.get(0).properties().appliedScopes().get(0)); - Assertions.assertEquals(AppliedScopeType.SINGLE, response.get(0).properties().appliedScopeType()); - Assertions.assertEquals(false, response.get(0).properties().archived()); - Assertions.assertEquals("nvyq", response.get(0).properties().capabilities()); - Assertions.assertEquals(686807657, response.get(0).properties().quantity()); - Assertions.assertEquals(ProvisioningState.FAILED, response.get(0).properties().provisioningState()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-05-19T06:58:08Z"), response.get(0).properties().effectiveDateTime()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-08-16T19:44:14Z"), response.get(0).properties().benefitStartTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-02-07T21:37:46Z"), response.get(0).properties().expiryDateTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-05-22T23:16:36Z"), response.get(0).properties().reviewDateTime()); - Assertions.assertEquals("gvvs", response.get(0).properties().skuDescription()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, response.get(0).properties().billingPlan()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-02-14T09:42:03Z"), response.get(0).properties().purchaseDateTime()); - Assertions.assertEquals("apfcqdpsq", response.get(0).properties().billingScopeId()); - Assertions.assertEquals(true, response.get(0).properties().renew()); - Assertions.assertEquals("svuo", response.get(0).properties().renewSource()); - Assertions.assertEquals("gc", response.get(0).properties().renewDestination()); - Assertions.assertEquals(ReservationTerm.P5Y, response.get(0).properties().term()); - Assertions.assertEquals(Kind.MICROSOFT_COMPUTE, response.get(0).kind()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsPropertiesUtilizationTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsPropertiesUtilizationTests.java deleted file mode 100644 index 6c78e9366a94..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsPropertiesUtilizationTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ReservationUtilizationAggregates; -import com.azure.resourcemanager.reservations.models.ReservationsPropertiesUtilization; -import java.util.Arrays; - -public final class ReservationsPropertiesUtilizationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationsPropertiesUtilization model = - BinaryData - .fromString( - "{\"trend\":\"hmenevfyexfwhybc\",\"aggregates\":[{\"grain\":53.581215,\"grainUnit\":\"c\",\"value\":88.85056,\"valueUnit\":\"nnaamdectehfiqsc\"},{\"grain\":55.374454,\"grainUnit\":\"vhezrkgqhcj\",\"value\":92.9146,\"valueUnit\":\"vgmkqsleyyvxyqjp\"}]}") - .toObject(ReservationsPropertiesUtilization.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationsPropertiesUtilization model = - new ReservationsPropertiesUtilization() - .withAggregates( - Arrays.asList(new ReservationUtilizationAggregates(), new ReservationUtilizationAggregates())); - model = BinaryData.fromObject(model).toObject(ReservationsPropertiesUtilization.class); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsSplitMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsSplitMockTests.java deleted file mode 100644 index 75b62c76e58e..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsSplitMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.AppliedScopeType; -import com.azure.resourcemanager.reservations.models.InstanceFlexibility; -import com.azure.resourcemanager.reservations.models.Kind; -import com.azure.resourcemanager.reservations.models.ProvisioningState; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationResponse; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import com.azure.resourcemanager.reservations.models.ReservedResourceType; -import com.azure.resourcemanager.reservations.models.SplitRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.List; -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 ReservationsSplitMockTests { - @Test - public void testSplit() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "[{\"location\":\"juetaebur\",\"etag\":1552436434,\"sku\":{\"name\":\"vsmzlxwab\"},\"properties\":{\"reservedResourceType\":\"MySql\",\"instanceFlexibility\":\"On\",\"displayName\":\"frvtpuqu\",\"appliedScopes\":[\"lgkfbt\",\"doaon\"],\"appliedScopeType\":\"ManagementGroup\",\"archived\":false,\"capabilities\":\"ujitcjedftww\",\"quantity\":1066178212,\"provisioningState\":\"Failed\",\"effectiveDateTime\":\"2021-09-05T14:44:59Z\",\"benefitStartTime\":\"2021-11-20T03:19:25Z\",\"lastUpdatedDateTime\":\"2021-03-02T02:07:21Z\",\"expiryDateTime\":\"2021-04-26T07:38:56Z\",\"reviewDateTime\":\"2021-11-11T00:37:26Z\",\"skuDescription\":\"cybxa\",\"billingPlan\":\"Monthly\",\"displayProvisioningState\":\"ufoxc\",\"provisioningSubState\":\"opidoamciodh\",\"purchaseDateTime\":\"2020-12-30T04:50:02Z\",\"billingScopeId\":\"bon\",\"renew\":false,\"renewSource\":\"oegokdwbwh\",\"renewDestination\":\"z\",\"term\":\"P1Y\",\"userFriendlyAppliedScopeType\":\"exztvbtq\",\"userFriendlyRenewState\":\"frao\"},\"kind\":\"Microsoft.Compute\",\"id\":\"wtl\",\"name\":\"nguxawqaldsy\",\"type\":\"uximerqfobw\"},{\"location\":\"nkbykutwpfhp\",\"etag\":145025413,\"sku\":{\"name\":\"skdsnfdsdoakg\"},\"properties\":{\"reservedResourceType\":\"BlockBlob\",\"instanceFlexibility\":\"Off\",\"displayName\":\"evdlh\",\"appliedScopes\":[\"usdsttwv\",\"gvbbejdcng\"],\"appliedScopeType\":\"Shared\",\"archived\":false,\"capabilities\":\"ufgmjzrwrdg\",\"quantity\":739471239,\"provisioningState\":\"Creating\",\"effectiveDateTime\":\"2021-01-31T20:09:39Z\",\"benefitStartTime\":\"2021-09-26T20:30:12Z\",\"lastUpdatedDateTime\":\"2021-01-01T18:08:14Z\",\"expiryDateTime\":\"2021-08-27T02:00:49Z\",\"reviewDateTime\":\"2021-11-09T23:56:32Z\",\"skuDescription\":\"fdwoyuhh\",\"billingPlan\":\"Monthly\",\"displayProvisioningState\":\"fozbhdmsmlmzqhof\",\"provisioningSubState\":\"maequiahxicslfa\",\"purchaseDateTime\":\"2021-04-27T14:59:29Z\",\"billingScopeId\":\"alnswhccsphk\",\"renew\":true,\"renewSource\":\"itqscywuggwoluhc\",\"renewDestination\":\"wem\",\"term\":\"P5Y\",\"userFriendlyAppliedScopeType\":\"brgz\",\"userFriendlyRenewState\":\"msweypqwdxggicc\"},\"kind\":\"Microsoft.Compute\",\"id\":\"uexmkttlst\",\"name\":\"lzywemhzrncsdtc\",\"type\":\"u\"},{\"location\":\"ypbsfgytguslfead\",\"etag\":358703588,\"sku\":{\"name\":\"kyhejhzisxgf\"},\"properties\":{\"reservedResourceType\":\"BlockBlob\",\"instanceFlexibility\":\"On\",\"displayName\":\"vk\",\"appliedScopes\":[\"qvujzraehtwdwrf\",\"swibyr\",\"dl\",\"h\"],\"appliedScopeType\":\"ManagementGroup\",\"archived\":false,\"capabilities\":\"acstwityk\",\"quantity\":1926336888,\"provisioningState\":\"Failed\",\"effectiveDateTime\":\"2021-05-11T18:58:40Z\",\"benefitStartTime\":\"2021-07-25T05:48:03Z\",\"lastUpdatedDateTime\":\"2021-08-06T07:57:29Z\",\"expiryDateTime\":\"2021-01-12T18:57:55Z\",\"reviewDateTime\":\"2021-04-17T23:56:48Z\",\"skuDescription\":\"wzxltjc\",\"billingPlan\":\"Monthly\",\"displayProvisioningState\":\"iugcxnavvwxq\",\"provisioningSubState\":\"y\",\"purchaseDateTime\":\"2021-05-22T21:00:43Z\",\"billingScopeId\":\"mdjrkvfgbvfvp\",\"renew\":false,\"renewSource\":\"acizsjqlhkrr\",\"renewDestination\":\"deibqip\",\"term\":\"P5Y\",\"userFriendlyAppliedScopeType\":\"xndzwm\",\"userFriendlyRenewState\":\"efajpj\"},\"kind\":\"Microsoft.Compute\",\"id\":\"nyhgbijtji\",\"name\":\"fxzsjabibsyst\",\"type\":\"wfsdjpvkvpbj\"},{\"location\":\"kzbzkdvncjabudu\",\"etag\":2102044737,\"sku\":{\"name\":\"mokzhjjklf\"},\"properties\":{\"reservedResourceType\":\"RedisCache\",\"instanceFlexibility\":\"On\",\"displayName\":\"lgzrfzeeyeb\",\"appliedScopes\":[\"kayuhqlbjbs\",\"bbqwrvtldg\",\"fp\",\"vm\"],\"appliedScopeType\":\"Single\",\"archived\":false,\"capabilities\":\"thaqfxssmwu\",\"quantity\":1363759065,\"provisioningState\":\"PendingBilling\",\"effectiveDateTime\":\"2021-05-03T05:48:17Z\",\"benefitStartTime\":\"2021-08-26T22:24:43Z\",\"lastUpdatedDateTime\":\"2021-11-25T18:05:49Z\",\"expiryDateTime\":\"2021-08-18T10:27:03Z\",\"reviewDateTime\":\"2021-09-27T12:02:20Z\",\"skuDescription\":\"wqkdwytisibi\",\"billingPlan\":\"Upfront\",\"displayProvisioningState\":\"kpzi\",\"provisioningSubState\":\"j\",\"purchaseDateTime\":\"2021-08-20T15:03:31Z\",\"billingScopeId\":\"vrmbzono\",\"renew\":true,\"renewSource\":\"jq\",\"renewDestination\":\"rgz\",\"term\":\"P1Y\",\"userFriendlyAppliedScopeType\":\"zszrnwoiindfpw\",\"userFriendlyRenewState\":\"ylwbtlhflsjcdhsz\"},\"kind\":\"Microsoft.Compute\",\"id\":\"gofel\",\"name\":\"a\",\"type\":\"rqmq\"}]"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - List response = - manager - .reservations() - .split( - "dknnqvsazn", - new SplitRequest() - .withQuantities(Arrays.asList(1165613569, 1262179758)) - .withReservationId("sgsahmkycgr"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("juetaebur", response.get(0).location()); - Assertions.assertEquals(1552436434, response.get(0).etag()); - Assertions.assertEquals("vsmzlxwab", response.get(0).sku().name()); - Assertions.assertEquals(ReservedResourceType.MY_SQL, response.get(0).properties().reservedResourceType()); - Assertions.assertEquals(InstanceFlexibility.ON, response.get(0).properties().instanceFlexibility()); - Assertions.assertEquals("frvtpuqu", response.get(0).properties().displayName()); - Assertions.assertEquals("lgkfbt", response.get(0).properties().appliedScopes().get(0)); - Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, response.get(0).properties().appliedScopeType()); - Assertions.assertEquals(false, response.get(0).properties().archived()); - Assertions.assertEquals("ujitcjedftww", response.get(0).properties().capabilities()); - Assertions.assertEquals(1066178212, response.get(0).properties().quantity()); - Assertions.assertEquals(ProvisioningState.FAILED, response.get(0).properties().provisioningState()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-09-05T14:44:59Z"), response.get(0).properties().effectiveDateTime()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-11-20T03:19:25Z"), response.get(0).properties().benefitStartTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-04-26T07:38:56Z"), response.get(0).properties().expiryDateTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-11-11T00:37:26Z"), response.get(0).properties().reviewDateTime()); - Assertions.assertEquals("cybxa", response.get(0).properties().skuDescription()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, response.get(0).properties().billingPlan()); - Assertions - .assertEquals( - OffsetDateTime.parse("2020-12-30T04:50:02Z"), response.get(0).properties().purchaseDateTime()); - Assertions.assertEquals("bon", response.get(0).properties().billingScopeId()); - Assertions.assertEquals(false, response.get(0).properties().renew()); - Assertions.assertEquals("oegokdwbwh", response.get(0).properties().renewSource()); - Assertions.assertEquals("z", response.get(0).properties().renewDestination()); - Assertions.assertEquals(ReservationTerm.P1Y, response.get(0).properties().term()); - Assertions.assertEquals(Kind.MICROSOFT_COMPUTE, response.get(0).kind()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsUnarchiveWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsUnarchiveWithResponseMockTests.java deleted file mode 100644 index 37db189b3e4d..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsUnarchiveWithResponseMockTests.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.reservations.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.reservations.ReservationsManager; -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 ReservationsUnarchiveWithResponseMockTests { - @Test - public void testUnarchiveWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.reservations().unarchiveWithResponse("z", "ybycnunvj", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceNameTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceNameTests.java deleted file mode 100644 index 2d1e38d194e5..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceNameTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ResourceName; -import org.junit.jupiter.api.Assertions; - -public final class ResourceNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceName model = - BinaryData.fromString("{\"value\":\"gj\",\"localizedValue\":\"bldtlww\"}").toObject(ResourceName.class); - Assertions.assertEquals("gj", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceName model = new ResourceName().withValue("gj"); - model = BinaryData.fromObject(model).toObject(ResourceName.class); - Assertions.assertEquals("gj", model.value()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceProvidersGetAppliedReservationListWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceProvidersGetAppliedReservationListWithResponseMockTests.java deleted file mode 100644 index 21c0ace4781e..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceProvidersGetAppliedReservationListWithResponseMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.AppliedReservations; -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 ResourceProvidersGetAppliedReservationListWithResponseMockTests { - @Test - public void testGetAppliedReservationListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"czu\",\"name\":\"ejwcwwqiok\",\"type\":\"sx\",\"properties\":{\"reservationOrderIds\":{\"value\":[],\"nextLink\":\"vpkjpr\"}}}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AppliedReservations response = - manager - .resourceProviders() - .getAppliedReservationListWithResponse("jltduceam", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vpkjpr", response.reservationOrderIds().nextLink()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReturnsPostMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReturnsPostMockTests.java deleted file mode 100644 index d3d3f8c13126..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReturnsPostMockTests.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.reservations.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.reservations.ReservationsManager; -import com.azure.resourcemanager.reservations.models.ProvisioningState; -import com.azure.resourcemanager.reservations.models.RefundRequest; -import com.azure.resourcemanager.reservations.models.RefundRequestProperties; -import com.azure.resourcemanager.reservations.models.ReservationBillingPlan; -import com.azure.resourcemanager.reservations.models.ReservationOrderResponse; -import com.azure.resourcemanager.reservations.models.ReservationTerm; -import com.azure.resourcemanager.reservations.models.ReservationToReturn; -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 ReturnsPostMockTests { - @Test - public void testPost() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"etag\":1313812453,\"properties\":{\"displayName\":\"yhddvia\",\"requestDateTime\":\"2021-08-22T18:38:50Z\",\"createdDateTime\":\"2021-09-06T17:32:09Z\",\"expiryDateTime\":\"2021-10-12T00:07:33Z\",\"benefitStartTime\":\"2021-02-23T02:35:37Z\",\"originalQuantity\":328676113,\"term\":\"P1Y\",\"provisioningState\":\"Succeeded\",\"billingPlan\":\"Monthly\",\"planInformation\":{\"transactions\":[]},\"reservations\":[],\"reviewDateTime\":\"2021-07-06T10:06:19Z\"},\"id\":\"l\",\"name\":\"chp\",\"type\":\"db\"}"; - - 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); - })); - - ReservationsManager manager = - ReservationsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ReservationOrderResponse response = - manager - .returns() - .post( - "hxuuwhcjyxccybvp", - new RefundRequest() - .withProperties( - new RefundRequestProperties() - .withSessionId("kkudzp") - .withScope("wjplma") - .withReservationToReturn( - new ReservationToReturn() - .withReservationId("cyohpfkyrkdbd") - .withQuantity(863803765)) - .withReturnReason("sjkmnwqj")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(1313812453, response.etag()); - Assertions.assertEquals("yhddvia", response.displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-22T18:38:50Z"), response.requestDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-06T17:32:09Z"), response.createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T00:07:33Z"), response.expiryDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-23T02:35:37Z"), response.benefitStartTime()); - Assertions.assertEquals(328676113, response.originalQuantity()); - Assertions.assertEquals(ReservationTerm.P1Y, response.term()); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.provisioningState()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, response.billingPlan()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T10:06:19Z"), response.reviewDateTime()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ScopePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ScopePropertiesTests.java deleted file mode 100644 index 69e12106be81..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ScopePropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ScopeProperties; -import org.junit.jupiter.api.Assertions; - -public final class ScopePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScopeProperties model = - BinaryData.fromString("{\"scope\":\"nq\",\"valid\":true}").toObject(ScopeProperties.class); - Assertions.assertEquals("nq", model.scope()); - Assertions.assertEquals(true, model.valid()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScopeProperties model = new ScopeProperties().withScope("nq").withValid(true); - model = BinaryData.fromObject(model).toObject(ScopeProperties.class); - Assertions.assertEquals("nq", model.scope()); - Assertions.assertEquals(true, model.valid()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuCapabilityTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuCapabilityTests.java deleted file mode 100644 index f37b2e6e340d..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuCapabilityTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.SkuCapability; -import org.junit.jupiter.api.Assertions; - -public final class SkuCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuCapability model = - BinaryData.fromString("{\"name\":\"kljla\",\"value\":\"cr\"}").toObject(SkuCapability.class); - Assertions.assertEquals("kljla", model.name()); - Assertions.assertEquals("cr", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapability model = new SkuCapability().withName("kljla").withValue("cr"); - model = BinaryData.fromObject(model).toObject(SkuCapability.class); - Assertions.assertEquals("kljla", model.name()); - Assertions.assertEquals("cr", model.value()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuNameTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuNameTests.java deleted file mode 100644 index 9f6d1ae38d12..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuNameTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.SkuName; -import org.junit.jupiter.api.Assertions; - -public final class SkuNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuName model = BinaryData.fromString("{\"name\":\"p\"}").toObject(SkuName.class); - Assertions.assertEquals("p", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuName model = new SkuName().withName("p"); - model = BinaryData.fromObject(model).toObject(SkuName.class); - Assertions.assertEquals("p", model.name()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuPropertyTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuPropertyTests.java deleted file mode 100644 index 7d192de2f0fa..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuPropertyTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.SkuProperty; -import org.junit.jupiter.api.Assertions; - -public final class SkuPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuProperty model = - BinaryData.fromString("{\"name\":\"zyde\",\"value\":\"jwyahuxinpmqnja\"}").toObject(SkuProperty.class); - Assertions.assertEquals("zyde", model.name()); - Assertions.assertEquals("jwyahuxinpmqnja", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuProperty model = new SkuProperty().withName("zyde").withValue("jwyahuxinpmqnja"); - model = BinaryData.fromObject(model).toObject(SkuProperty.class); - Assertions.assertEquals("zyde", model.name()); - Assertions.assertEquals("jwyahuxinpmqnja", model.value()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitPropertiesTests.java deleted file mode 100644 index b900b1bc266f..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitPropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.SplitProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SplitPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SplitProperties model = - BinaryData - .fromString("{\"quantities\":[2062075015,1743077422],\"reservationId\":\"opjmcmatuokthfui\"}") - .toObject(SplitProperties.class); - Assertions.assertEquals(2062075015, model.quantities().get(0)); - Assertions.assertEquals("opjmcmatuokthfui", model.reservationId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SplitProperties model = - new SplitProperties() - .withQuantities(Arrays.asList(2062075015, 1743077422)) - .withReservationId("opjmcmatuokthfui"); - model = BinaryData.fromObject(model).toObject(SplitProperties.class); - Assertions.assertEquals(2062075015, model.quantities().get(0)); - Assertions.assertEquals("opjmcmatuokthfui", model.reservationId()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitRequestTests.java deleted file mode 100644 index fb5ff7b2a3a7..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitRequestTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.SplitRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SplitRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SplitRequest model = - BinaryData - .fromString( - "{\"properties\":{\"quantities\":[389510865,1054713689,996084293,1344764188],\"reservationId\":\"hy\"}}") - .toObject(SplitRequest.class); - Assertions.assertEquals(389510865, model.quantities().get(0)); - Assertions.assertEquals("hy", model.reservationId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SplitRequest model = - new SplitRequest() - .withQuantities(Arrays.asList(389510865, 1054713689, 996084293, 1344764188)) - .withReservationId("hy"); - model = BinaryData.fromObject(model).toObject(SplitRequest.class); - Assertions.assertEquals(389510865, model.quantities().get(0)); - Assertions.assertEquals("hy", model.reservationId()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubRequestTests.java deleted file mode 100644 index 90082b89a121..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubRequestTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import com.azure.resourcemanager.reservations.models.ResourceName; -import com.azure.resourcemanager.reservations.models.SubRequest; -import org.junit.jupiter.api.Assertions; - -public final class SubRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubRequest model = - BinaryData - .fromString( - "{\"limit\":1110186498,\"name\":{\"value\":\"kjj\",\"localizedValue\":\"xrbuukzclew\"},\"resourceType\":\"mlwpazt\",\"unit\":\"ofncckwyfzqwhxxb\",\"provisioningState\":\"Failed\",\"message\":\"xzfe\",\"subRequestId\":\"tpp\"}") - .toObject(SubRequest.class); - Assertions.assertEquals("kjj", model.name().value()); - Assertions.assertEquals("ofncckwyfzqwhxxb", model.unit()); - Assertions.assertEquals(QuotaRequestState.FAILED, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubRequest model = - new SubRequest() - .withName(new ResourceName().withValue("kjj")) - .withUnit("ofncckwyfzqwhxxb") - .withProvisioningState(QuotaRequestState.FAILED); - model = BinaryData.fromObject(model).toObject(SubRequest.class); - Assertions.assertEquals("kjj", model.name().value()); - Assertions.assertEquals("ofncckwyfzqwhxxb", model.unit()); - Assertions.assertEquals(QuotaRequestState.FAILED, model.provisioningState()); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubscriptionScopePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubscriptionScopePropertiesTests.java deleted file mode 100644 index 4a3283c29456..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubscriptionScopePropertiesTests.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.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ScopeProperties; -import com.azure.resourcemanager.reservations.models.SubscriptionScopeProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SubscriptionScopePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubscriptionScopeProperties model = - BinaryData - .fromString( - "{\"scopes\":[{\"scope\":\"qsoqijgkd\",\"valid\":true},{\"scope\":\"zlobcufpd\",\"valid\":false},{\"scope\":\"t\",\"valid\":true}]}") - .toObject(SubscriptionScopeProperties.class); - Assertions.assertEquals("qsoqijgkd", model.scopes().get(0).scope()); - Assertions.assertEquals(true, model.scopes().get(0).valid()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubscriptionScopeProperties model = - new SubscriptionScopeProperties() - .withScopes( - Arrays - .asList( - new ScopeProperties().withScope("qsoqijgkd").withValid(true), - new ScopeProperties().withScope("zlobcufpd").withValid(false), - new ScopeProperties().withScope("t").withValid(true))); - model = BinaryData.fromObject(model).toObject(SubscriptionScopeProperties.class); - Assertions.assertEquals("qsoqijgkd", model.scopes().get(0).scope()); - Assertions.assertEquals(true, model.scopes().get(0).valid()); - } -}