From d2e2aa5fe937337f922081638c225b976f6e64a0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 7 Apr 2025 11:34:48 +0000 Subject: [PATCH] CodeGen from PR 33719 in Azure/azure-rest-api-specs Merge be4f686d5c6f63fcb924f37165832f923fd7d428 into a67a8c166cdbcb357ac3e56cbc1c1e285b52706a --- sdk/clientcore/annotation-processor/pom.xml | 2 +- .../CHANGELOG.md | 4 +- .../README.md | 6 +- .../storageactions/StorageActionsManager.java | 9 +- .../storageactions/models/OnFailure.java | 47 +++---- .../storageactions/models/OnSuccess.java | 47 +++---- .../models/ProvisioningState.java | 75 +++++------ ...-resourcemanager-storageactions.properties | 1 + .../generated/ElseConditionTests.java | 56 -------- .../generated/IfConditionTests.java | 63 --------- .../ManagedServiceIdentityTests.java | 45 ------- .../generated/OperationDisplayTests.java | 23 ---- .../generated/OperationInnerTests.java | 24 ---- .../generated/OperationListResultTests.java | 23 ---- .../generated/OperationsListMockTests.java | 36 ----- .../generated/StorageTaskActionTests.java | 92 ------------- .../StorageTaskAssignmentInnerTests.java | 22 ---- .../StorageTaskAssignmentsListMockTests.java | 36 ----- ...StorageTaskAssignmentsListResultTests.java | 23 ---- .../generated/StorageTaskInnerTests.java | 124 ------------------ .../generated/StorageTaskOperationTests.java | 52 -------- ...torageTaskPreviewActionConditionTests.java | 31 ----- ...rageTaskPreviewActionIfConditionTests.java | 25 ---- .../generated/StorageTaskPropertiesTests.java | 111 ---------------- .../StorageTaskReportInstanceInnerTests.java | 25 ---- .../StorageTaskReportPropertiesTests.java | 23 ---- .../StorageTaskReportSummaryTests.java | 23 ---- .../StorageTaskUpdateParametersTests.java | 111 ---------------- .../StorageTasksCreateMockTests.java | 92 ------------- ...tByResourceGroupWithResponseMockTests.java | 50 ------- ...rageTasksListByResourceGroupMockTests.java | 52 -------- .../generated/StorageTasksListMockTests.java | 50 ------- .../StorageTasksListResultTests.java | 23 ---- .../StorageTasksReportsListMockTests.java | 37 ------ .../generated/UserAssignedIdentityTests.java | 23 ---- 35 files changed, 95 insertions(+), 1391 deletions(-) create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/azure-resourcemanager-storageactions.properties delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java delete mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java diff --git a/sdk/clientcore/annotation-processor/pom.xml b/sdk/clientcore/annotation-processor/pom.xml index 34d779ca6321..9ecda36fc602 100644 --- a/sdk/clientcore/annotation-processor/pom.xml +++ b/sdk/clientcore/annotation-processor/pom.xml @@ -113,7 +113,7 @@ io.clientcore core - 1.0.0-beta.9 + 1.0.0-beta.8 diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md b/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md index a76f22a39ea0..8e3c93050ce2 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md +++ b/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2025-04-07) + +- Azure Resource Manager StorageActions client library for Java. This package contains Microsoft Azure SDK for StorageActions Management SDK. The Azure Storage Actions Management API. Package tag package-2023-01-01. 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/storageactions/azure-resourcemanager-storageactions/README.md b/sdk/storageactions/azure-resourcemanager-storageactions/README.md index b338518a8990..e086619eb030 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/README.md +++ b/sdk/storageactions/azure-resourcemanager-storageactions/README.md @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ StorageActionsManager manager = StorageActionsManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ 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/ - - diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java index 8164ff66fb26..e17b94b7573a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java @@ -22,6 +22,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.storageactions.fluent.StorageActionsMgmtClient; import com.azure.resourcemanager.storageactions.implementation.OperationsImpl; @@ -37,6 +38,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -105,6 +107,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-storageactions.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -212,12 +217,14 @@ public StorageActionsManager authenticate(TokenCredential credential, AzureProfi Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.storageactions") .append("/") - .append("1.0.0-beta.2"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java index 046e4b7a32fe..612f96fc3451 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java @@ -4,48 +4,43 @@ package com.azure.resourcemanager.storageactions.models; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** * Action to be taken when the operation fails for a object. */ -public enum OnFailure { +public final class OnFailure extends ExpandableStringEnum { /** - * Enum value break. + * Static value break for OnFailure. */ - BREAK("break"); + public static final OnFailure BREAK = fromString("break"); /** - * The actual serialized value for a OnFailure instance. + * Creates a new instance of OnFailure value. + * + * @deprecated Use the {@link #fromString(String)} factory method. */ - private final String value; - - OnFailure(String value) { - this.value = value; + @Deprecated + public OnFailure() { } /** - * Parses a serialized value to a OnFailure instance. + * Creates or finds a OnFailure from its string representation. * - * @param value the serialized value to parse. - * @return the parsed OnFailure object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding OnFailure. */ - public static OnFailure fromString(String value) { - if (value == null) { - return null; - } - OnFailure[] items = OnFailure.values(); - for (OnFailure item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static OnFailure fromString(String name) { + return fromString(name, OnFailure.class); } /** - * {@inheritDoc} + * Gets known OnFailure values. + * + * @return known OnFailure values. */ - @Override - public String toString() { - return this.value; + public static Collection values() { + return values(OnFailure.class); } } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java index 16a4e92b122b..2eae84b6e3e2 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java @@ -4,48 +4,43 @@ package com.azure.resourcemanager.storageactions.models; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** * Action to be taken when the operation is successful for a object. */ -public enum OnSuccess { +public final class OnSuccess extends ExpandableStringEnum { /** - * Enum value continue. + * Static value continue for OnSuccess. */ - CONTINUE("continue"); + public static final OnSuccess CONTINUE = fromString("continue"); /** - * The actual serialized value for a OnSuccess instance. + * Creates a new instance of OnSuccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. */ - private final String value; - - OnSuccess(String value) { - this.value = value; + @Deprecated + public OnSuccess() { } /** - * Parses a serialized value to a OnSuccess instance. + * Creates or finds a OnSuccess from its string representation. * - * @param value the serialized value to parse. - * @return the parsed OnSuccess object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding OnSuccess. */ - public static OnSuccess fromString(String value) { - if (value == null) { - return null; - } - OnSuccess[] items = OnSuccess.values(); - for (OnSuccess item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static OnSuccess fromString(String name) { + return fromString(name, OnSuccess.class); } /** - * {@inheritDoc} + * Gets known OnSuccess values. + * + * @return known OnSuccess values. */ - @Override - public String toString() { - return this.value; + public static Collection values() { + return values(OnSuccess.class); } } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java index 7e2c486a0162..1c10adee8f2a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java @@ -4,78 +4,79 @@ package com.azure.resourcemanager.storageactions.models; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** * Represents the provisioning state of the storage task. */ -public enum ProvisioningState { +public final class ProvisioningState extends ExpandableStringEnum { /** - * Enum value ValidateSubscriptionQuotaBegin. + * Static value ValidateSubscriptionQuotaBegin for ProvisioningState. */ - VALIDATE_SUBSCRIPTION_QUOTA_BEGIN("ValidateSubscriptionQuotaBegin"), + public static final ProvisioningState VALIDATE_SUBSCRIPTION_QUOTA_BEGIN + = fromString("ValidateSubscriptionQuotaBegin"); /** - * Enum value ValidateSubscriptionQuotaEnd. + * Static value ValidateSubscriptionQuotaEnd for ProvisioningState. */ - VALIDATE_SUBSCRIPTION_QUOTA_END("ValidateSubscriptionQuotaEnd"), + public static final ProvisioningState VALIDATE_SUBSCRIPTION_QUOTA_END = fromString("ValidateSubscriptionQuotaEnd"); /** - * Enum value Creating. + * Static value Accepted for ProvisioningState. */ - CREATING("Creating"), + public static final ProvisioningState ACCEPTED = fromString("Accepted"); /** - * Enum value Succeeded. + * Static value Creating for ProvisioningState. */ - SUCCEEDED("Succeeded"), + public static final ProvisioningState CREATING = fromString("Creating"); /** - * Enum value Deleting. + * Static value Succeeded for ProvisioningState. */ - DELETING("Deleting"), + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Enum value Canceled. + * Static value Deleting for ProvisioningState. */ - CANCELED("Canceled"), + public static final ProvisioningState DELETING = fromString("Deleting"); /** - * Enum value Failed. + * Static value Canceled for ProvisioningState. */ - FAILED("Failed"); + public static final ProvisioningState CANCELED = fromString("Canceled"); /** - * The actual serialized value for a ProvisioningState instance. + * Static value Failed for ProvisioningState. */ - private final String value; + public static final ProvisioningState FAILED = fromString("Failed"); - ProvisioningState(String value) { - this.value = value; + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { } /** - * Parses a serialized value to a ProvisioningState instance. + * Creates or finds a ProvisioningState from its string representation. * - * @param value the serialized value to parse. - * @return the parsed ProvisioningState object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding ProvisioningState. */ - public static ProvisioningState fromString(String value) { - if (value == null) { - return null; - } - ProvisioningState[] items = ProvisioningState.values(); - for (ProvisioningState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); } /** - * {@inheritDoc} + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. */ - @Override - public String toString() { - return this.value; + public static Collection values() { + return values(ProvisioningState.class); } } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/azure-resourcemanager-storageactions.properties b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/azure-resourcemanager-storageactions.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/azure-resourcemanager-storageactions.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java deleted file mode 100644 index 199b34a60525..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ElseConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ElseCondition model = BinaryData.fromString( - "{\"operations\":[{\"name\":\"UndeleteBlob\",\"parameters\":{\"orcjxvsnby\":\"jxsqwpgrjbz\",\"cyshurzafbljjgp\":\"qabnmoc\",\"bqidtqaj\":\"toqcjmklja\",\"khbzhfepgzg\":\"yulpkudjkr\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}") - .toObject(ElseCondition.class); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, model.operations().get(0).name()); - Assertions.assertEquals("jxsqwpgrjbz", model.operations().get(0).parameters().get("orcjxvsnby")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ElseCondition model = new ElseCondition() - .withOperations(Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) - .withParameters(mapOf("orcjxvsnby", "jxsqwpgrjbz", "cyshurzafbljjgp", "qabnmoc", "bqidtqaj", - "toqcjmklja", "khbzhfepgzg", "yulpkudjkr")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK))); - model = BinaryData.fromObject(model).toObject(ElseCondition.class); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, model.operations().get(0).name()); - Assertions.assertEquals("jxsqwpgrjbz", model.operations().get(0).parameters().get("orcjxvsnby")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java deleted file mode 100644 index 433c1126169b..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IfConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IfCondition model = BinaryData.fromString( - "{\"condition\":\"wbnguitnwui\",\"operations\":[{\"name\":\"SetBlobExpiry\",\"parameters\":{\"hr\":\"ufizuckyf\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"nteiwaopv\":\"zuhtymwisdkfthwx\",\"pymzidnsezcxtbzs\":\"mijcmmxdcufufs\",\"newmdwzjeiachbo\":\"fycc\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}") - .toObject(IfCondition.class); - Assertions.assertEquals("wbnguitnwui", model.condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_EXPIRY, model.operations().get(0).name()); - Assertions.assertEquals("ufizuckyf", model.operations().get(0).parameters().get("hr")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IfCondition model = new IfCondition().withCondition("wbnguitnwui") - .withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_EXPIRY) - .withParameters(mapOf("hr", "ufizuckyf")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) - .withParameters(mapOf("nteiwaopv", "zuhtymwisdkfthwx", "pymzidnsezcxtbzs", "mijcmmxdcufufs", - "newmdwzjeiachbo", "fycc")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK))); - model = BinaryData.fromObject(model).toObject(IfCondition.class); - Assertions.assertEquals("wbnguitnwui", model.condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_EXPIRY, model.operations().get(0).name()); - Assertions.assertEquals("ufizuckyf", model.operations().get(0).parameters().get("hr")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 82c72c7bf98d..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.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.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"0a4c297b-9fdb-4780-ba27-f9d7ba4cae00\",\"tenantId\":\"556b9d56-2522-48a4-9e2d-6c994aa3c0dc\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"peqfpjkjl\":{\"principalId\":\"4a9ef1ce-8a06-45b4-9cd0-b156c8df8839\",\"clientId\":\"43d2b3c2-6bb8-4e3c-8b3b-84ffc252c195\"},\"pdvhpfxxypin\":{\"principalId\":\"2f442637-9287-46c4-a2fa-aa3d3273862a\",\"clientId\":\"b0859a69-ab64-4782-9816-5f662e203c58\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model - = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("peqfpjkjl", new UserAssignedIdentity(), "pdvhpfxxypin", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java deleted file mode 100644 index 866ba919bb88..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.java deleted file mode 100644 index 576f41e74879..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.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.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.fluent.models.OperationInner; -import com.azure.resourcemanager.storageactions.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java deleted file mode 100644 index 8afd40f84e30..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java deleted file mode 100644 index c1ce78b72870..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.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.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"yeamdphagalpb\",\"isDataAction\":true,\"display\":{\"provider\":\"pwhonowkg\",\"resource\":\"wankixzbi\",\"operation\":\"eputtmrywnuzoqf\",\"description\":\"yqzrnkcqvyxlw\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java deleted file mode 100644 index e39544353c9c..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskAction model = BinaryData.fromString( - "{\"if\":{\"condition\":\"ypnddhsgcb\",\"operations\":[{\"name\":\"SetBlobTier\",\"parameters\":{\"nqgoulzndli\":\"jkot\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"qqedqytbciqfou\":\"madgakeqsrxyb\",\"gpbkwtmut\":\"lmmnkzsmodmglo\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"kdosvqw\":\"pwgcuertu\",\"bjf\":\"bmdg\",\"bexppb\":\"dgmb\",\"rolfpfp\":\"tq\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobImmutabilityPolicy\",\"parameters\":{\"jaoyfhrtx\":\"igjyjg\",\"fqawrlyxw\":\"lnerkujysvleju\",\"xgjvtbv\":\"kcprbnw\",\"uouq\":\"ysszdnrujqguh\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}}") - .toObject(StorageTaskAction.class); - Assertions.assertEquals("ypnddhsgcb", model.ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.ifProperty().operations().get(0).name()); - Assertions.assertEquals("jkot", model.ifProperty().operations().get(0).parameters().get("nqgoulzndli")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, - model.elseProperty().operations().get(0).name()); - Assertions.assertEquals("madgakeqsrxyb", - model.elseProperty().operations().get(0).parameters().get("qqedqytbciqfou")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.elseProperty().operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskAction model = new StorageTaskAction().withIfProperty(new IfCondition().withCondition("ypnddhsgcb") - .withOperations(Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters(mapOf("nqgoulzndli", "jkot")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))) - .withElseProperty( - new ElseCondition() - .withOperations( - Arrays - .asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) - .withParameters( - mapOf("qqedqytbciqfou", "madgakeqsrxyb", "gpbkwtmut", "lmmnkzsmodmglo")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters( - mapOf("kdosvqw", "pwgcuertu", "bjf", "bmdg", "bexppb", "dgmb", "rolfpfp", "tq")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY) - .withParameters(mapOf("jaoyfhrtx", "igjyjg", "fqawrlyxw", "lnerkujysvleju", - "xgjvtbv", "kcprbnw", "uouq", "ysszdnrujqguh")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))); - model = BinaryData.fromObject(model).toObject(StorageTaskAction.class); - Assertions.assertEquals("ypnddhsgcb", model.ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.ifProperty().operations().get(0).name()); - Assertions.assertEquals("jkot", model.ifProperty().operations().get(0).parameters().get("nqgoulzndli")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, - model.elseProperty().operations().get(0).name()); - Assertions.assertEquals("madgakeqsrxyb", - model.elseProperty().operations().get(0).parameters().get("qqedqytbciqfou")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.elseProperty().operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java deleted file mode 100644 index 5419df3c8f20..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; - -public final class StorageTaskAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskAssignmentInner model - = BinaryData.fromString("{\"id\":\"drvyn\"}").toObject(StorageTaskAssignmentInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskAssignmentInner model = new StorageTaskAssignmentInner(); - model = BinaryData.fromObject(model).toObject(StorageTaskAssignmentInner.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java deleted file mode 100644 index 3de2575f3284..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.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.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.StorageTaskAssignment; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTaskAssignmentsListMockTests { - @Test - public void testList() throws Exception { - String responseStr = "{\"value\":[{\"id\":\"yvpycanuzbpzk\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.storageTaskAssignments().list("qj", "hckfrlhrx", 1228255689, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java deleted file mode 100644 index 798de12125ff..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTaskAssignmentsListResult; - -public final class StorageTaskAssignmentsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskAssignmentsListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"rabhjybigeho\"},{\"id\":\"bowsk\"},{\"id\":\"yktz\"},{\"id\":\"u\"}],\"nextLink\":\"wgqyw\"}") - .toObject(StorageTaskAssignmentsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskAssignmentsListResult model = new StorageTaskAssignmentsListResult(); - model = BinaryData.fromObject(model).toObject(StorageTaskAssignmentsListResult.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java deleted file mode 100644 index 4d629f1fa433..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; -import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskInner model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"41508ce2-c4d1-4dc2-823b-d050dc7baf7e\",\"tenantId\":\"21625193-87cd-4d14-b165-a4f739f50c56\",\"type\":\"None\",\"userAssignedIdentities\":{\"qhabifpikxwcz\":{\"principalId\":\"733bc799-807e-4678-bec2-d909647fb274\",\"clientId\":\"09b627db-3a70-4045-8b0d-dd94866b0b71\"}}},\"properties\":{\"taskVersion\":3372129920897146496,\"enabled\":false,\"description\":\"pqxu\",\"action\":{\"if\":{\"condition\":\"ivyqniwbybrkxvd\",\"operations\":[{\"name\":\"SetBlobTags\",\"parameters\":{\"snhsjcnyejhkryh\":\"tfwvukxgaudc\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\",\"parameters\":{\"kkvnipjox\":\"jye\",\"podmailzydehojwy\":\"jnchgej\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobImmutabilityPolicy\",\"parameters\":{\"sprozvcput\":\"qnjaqwix\",\"fdatsc\":\"gjvw\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"Deleting\",\"creationTimeInUtc\":\"2021-02-16T21:00:55Z\"},\"location\":\"uvm\",\"tags\":{\"iodjp\":\"zkrwfn\",\"ryo\":\"lwejdpv\",\"hbcryffdfdosyge\":\"psoacctazakljl\",\"rzevdphlxaol\":\"paojakhmsbzjh\"},\"id\":\"hqtrgqjbpf\",\"name\":\"fsinzgvfcjrwzoxx\",\"type\":\"tfell\"}") - .toObject(StorageTaskInner.class); - Assertions.assertEquals("uvm", model.location()); - Assertions.assertEquals("zkrwfn", model.tags().get("iodjp")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals(false, model.properties().enabled()); - Assertions.assertEquals("pqxu", model.properties().description()); - Assertions.assertEquals("ivyqniwbybrkxvd", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("tfwvukxgaudc", - model.properties().action().ifProperty().operations().get(0).parameters().get("snhsjcnyejhkryh")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("jye", - model.properties().action().elseProperty().operations().get(0).parameters().get("kkvnipjox")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().elseProperty().operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskInner model - = new StorageTaskInner().withLocation("uvm") - .withTags(mapOf("iodjp", "zkrwfn", "ryo", "lwejdpv", "hbcryffdfdosyge", "psoacctazakljl", - "rzevdphlxaol", "paojakhmsbzjh")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("qhabifpikxwcz", new UserAssignedIdentity()))) - .withProperties( - new StorageTaskProperties().withEnabled(false) - .withDescription("pqxu") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("ivyqniwbybrkxvd") - .withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("snhsjcnyejhkryh", "tfwvukxgaudc")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))) - .withElseProperty( - new ElseCondition() - .withOperations( - Arrays.asList( - new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY) - .withParameters( - mapOf("kkvnipjox", "jye", "podmailzydehojwy", "jnchgej")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY) - .withParameters(mapOf("sprozvcput", "qnjaqwix", "fdatsc", "gjvw")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))))); - model = BinaryData.fromObject(model).toObject(StorageTaskInner.class); - Assertions.assertEquals("uvm", model.location()); - Assertions.assertEquals("zkrwfn", model.tags().get("iodjp")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals(false, model.properties().enabled()); - Assertions.assertEquals("pqxu", model.properties().description()); - Assertions.assertEquals("ivyqniwbybrkxvd", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("tfwvukxgaudc", - model.properties().action().ifProperty().operations().get(0).parameters().get("snhsjcnyejhkryh")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("jye", - model.properties().action().elseProperty().operations().get(0).parameters().get("kkvnipjox")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().elseProperty().operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.java deleted file mode 100644 index 01bbdf81ed96..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.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.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskOperationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskOperation model = BinaryData.fromString( - "{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"hzzvypyq\":\"fqpte\",\"z\":\"i\",\"dqxhcrmnohjtckwh\":\"npvswjdkirso\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}") - .toObject(StorageTaskOperation.class); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, model.name()); - Assertions.assertEquals("fqpte", model.parameters().get("hzzvypyq")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskOperation model = new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) - .withParameters(mapOf("hzzvypyq", "fqpte", "z", "i", "dqxhcrmnohjtckwh", "npvswjdkirso")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK); - model = BinaryData.fromObject(model).toObject(StorageTaskOperation.class); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, model.name()); - Assertions.assertEquals("fqpte", model.parameters().get("hzzvypyq")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java deleted file mode 100644 index 7d539f904976..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.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.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskPreviewActionConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskPreviewActionCondition model - = BinaryData.fromString("{\"if\":{\"condition\":\"ttgzfbis\"},\"elseBlockExists\":true}") - .toObject(StorageTaskPreviewActionCondition.class); - Assertions.assertEquals("ttgzfbis", model.ifProperty().condition()); - Assertions.assertEquals(true, model.elseBlockExists()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskPreviewActionCondition model = new StorageTaskPreviewActionCondition() - .withIfProperty(new StorageTaskPreviewActionIfCondition().withCondition("ttgzfbis")) - .withElseBlockExists(true); - model = BinaryData.fromObject(model).toObject(StorageTaskPreviewActionCondition.class); - Assertions.assertEquals("ttgzfbis", model.ifProperty().condition()); - Assertions.assertEquals(true, model.elseBlockExists()); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.java deleted file mode 100644 index d4c254191d6e..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.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.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskPreviewActionIfConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskPreviewActionIfCondition model - = BinaryData.fromString("{\"condition\":\"khaj\"}").toObject(StorageTaskPreviewActionIfCondition.class); - Assertions.assertEquals("khaj", model.condition()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskPreviewActionIfCondition model = new StorageTaskPreviewActionIfCondition().withCondition("khaj"); - model = BinaryData.fromObject(model).toObject(StorageTaskPreviewActionIfCondition.class); - Assertions.assertEquals("khaj", model.condition()); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java deleted file mode 100644 index 03ac84f74cae..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskProperties model = BinaryData.fromString( - "{\"taskVersion\":1351173386215455176,\"enabled\":true,\"description\":\"ybb\",\"action\":{\"if\":{\"condition\":\"podepoo\",\"operations\":[{\"name\":\"SetBlobTier\",\"parameters\":{\"theotusiv\":\"amiheognarxz\",\"bwjzr\":\"evcciqihnhun\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTags\",\"parameters\":{\"qeof\":\"pemvtzfkufubljof\",\"jqul\":\"aeqjhqjbasvms\",\"clxxwrljdo\":\"gsntnbybkzgcwr\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"jdkwtnhxbnjb\":\"cr\",\"qpjwnzlljfm\":\"ksqrglssai\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"zevndhkrwpdappds\":\"abkyqduujitcjcz\",\"snhu\":\"dkvwrwjfe\",\"tmrldhugjzzdatq\":\"je\",\"gphuticndvka\":\"hocdgeab\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTags\",\"parameters\":{\"rokft\":\"hxh\",\"iawxklry\":\"xolniwpwcukjfk\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"Canceled\",\"creationTimeInUtc\":\"2021-11-03T18:10:18Z\"}") - .toObject(StorageTaskProperties.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("ybb", model.description()); - Assertions.assertEquals("podepoo", model.action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - model.action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("amiheognarxz", - model.action().ifProperty().operations().get(0).parameters().get("theotusiv")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, - model.action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("abkyqduujitcjcz", - model.action().elseProperty().operations().get(0).parameters().get("zevndhkrwpdappds")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.action().elseProperty().operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskProperties model - = new StorageTaskProperties().withEnabled(true) - .withDescription("ybb") - .withAction( - new StorageTaskAction() - .withIfProperty( - new IfCondition().withCondition("podepoo") - .withOperations( - Arrays - .asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters( - mapOf("theotusiv", "amiheognarxz", "bwjzr", "evcciqihnhun")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("qeof", "pemvtzfkufubljof", "jqul", - "aeqjhqjbasvms", "clxxwrljdo", "gsntnbybkzgcwr")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) - .withParameters( - mapOf("jdkwtnhxbnjb", "cr", "qpjwnzlljfm", "ksqrglssai")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) - .withParameters(mapOf("zevndhkrwpdappds", "abkyqduujitcjcz", "snhu", "dkvwrwjfe", - "tmrldhugjzzdatq", "je", "gphuticndvka", "hocdgeab")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("rokft", "hxh", "iawxklry", "xolniwpwcukjfk")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK))))); - model = BinaryData.fromObject(model).toObject(StorageTaskProperties.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("ybb", model.description()); - Assertions.assertEquals("podepoo", model.action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - model.action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("amiheognarxz", - model.action().ifProperty().operations().get(0).parameters().get("theotusiv")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, - model.action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("abkyqduujitcjcz", - model.action().elseProperty().operations().get(0).parameters().get("zevndhkrwpdappds")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.action().elseProperty().operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.java deleted file mode 100644 index 379e192c020f..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.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.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportProperties; - -public final class StorageTaskReportInstanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskReportInstanceInner model = BinaryData.fromString( - "{\"properties\":{\"taskAssignmentId\":\"puozmyzydag\",\"storageAccountId\":\"axbezyiuo\",\"startTime\":\"twhrdxwzywqsm\",\"finishTime\":\"ureximoryocfs\",\"objectsTargetedCount\":\"s\",\"objectsOperatedOnCount\":\"ddystkiiuxhqy\",\"objectFailedCount\":\"xorrqnb\",\"objectsSucceededCount\":\"czvyifq\",\"runStatusError\":\"kdvjsll\",\"runStatusEnum\":\"Finished\",\"summaryReportPath\":\"d\",\"taskId\":\"atkpnp\",\"taskVersion\":\"exxbczwtr\",\"runResult\":\"Succeeded\"},\"id\":\"zb\",\"name\":\"j\",\"type\":\"sovmyokacspkwl\"}") - .toObject(StorageTaskReportInstanceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskReportInstanceInner model - = new StorageTaskReportInstanceInner().withProperties(new StorageTaskReportProperties()); - model = BinaryData.fromObject(model).toObject(StorageTaskReportInstanceInner.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java deleted file mode 100644 index 870ff01379bf..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportProperties; - -public final class StorageTaskReportPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskReportProperties model = BinaryData.fromString( - "{\"taskAssignmentId\":\"dobpxjmflbvvn\",\"storageAccountId\":\"rkcciwwzjuqk\",\"startTime\":\"sa\",\"finishTime\":\"wkuofoskghsauu\",\"objectsTargetedCount\":\"jmvxie\",\"objectsOperatedOnCount\":\"ugidyjrr\",\"objectFailedCount\":\"y\",\"objectsSucceededCount\":\"svexcsonpclhoco\",\"runStatusError\":\"lkevle\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"buhfmvfaxkffeiit\",\"taskId\":\"vmezy\",\"taskVersion\":\"hxmzsbbzoggig\",\"runResult\":\"Failed\"}") - .toObject(StorageTaskReportProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskReportProperties model = new StorageTaskReportProperties(); - model = BinaryData.fromObject(model).toObject(StorageTaskReportProperties.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java deleted file mode 100644 index 934a8d7d7f11..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportSummary; - -public final class StorageTaskReportSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskReportSummary model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"taskAssignmentId\":\"hrc\",\"storageAccountId\":\"nc\",\"startTime\":\"pec\",\"finishTime\":\"m\",\"objectsTargetedCount\":\"oo\",\"objectsOperatedOnCount\":\"xlzevgbmqjqabcy\",\"objectFailedCount\":\"ivkwlzuvccfwnfnb\",\"objectsSucceededCount\":\"fionl\",\"runStatusError\":\"x\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"tzxdpnqbqqwx\",\"taskId\":\"feallnwsu\",\"taskVersion\":\"snjampmng\",\"runResult\":\"Succeeded\"},\"id\":\"xaqwoochcbonqv\",\"name\":\"kvlrxnj\",\"type\":\"ase\"},{\"properties\":{\"taskAssignmentId\":\"eo\",\"storageAccountId\":\"okeyyienj\",\"startTime\":\"lwtgrhpdj\",\"finishTime\":\"umasxazjpq\",\"objectsTargetedCount\":\"gual\",\"objectsOperatedOnCount\":\"xxhejjzzvd\",\"objectFailedCount\":\"gwdslfhotwm\",\"objectsSucceededCount\":\"npwlbjnpg\",\"runStatusError\":\"ftadehxnltyfs\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"suesnzw\",\"taskId\":\"jbavorxzdm\",\"taskVersion\":\"ctbqvudwx\",\"runResult\":\"Succeeded\"},\"id\":\"vo\",\"name\":\"gujjugwdkcglh\",\"type\":\"lazjdyggdtjixhbk\"},{\"properties\":{\"taskAssignmentId\":\"qweykhmenev\",\"storageAccountId\":\"exfwhy\",\"startTime\":\"i\",\"finishTime\":\"yvdcsitynnaa\",\"objectsTargetedCount\":\"ectehf\",\"objectsOperatedOnCount\":\"scjeypv\",\"objectFailedCount\":\"zrkgqhcjrefovg\",\"objectsSucceededCount\":\"qsl\",\"runStatusError\":\"yvxyqjp\",\"runStatusEnum\":\"Finished\",\"summaryReportPath\":\"tpngjcrcczsqpjh\",\"taskId\":\"daj\",\"taskVersion\":\"ysou\",\"runResult\":\"Succeeded\"},\"id\":\"a\",\"name\":\"oaeupfhyhltrpmo\",\"type\":\"jmcmatuokthfu\"}],\"nextLink\":\"aodsfcpkv\"}") - .toObject(StorageTaskReportSummary.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskReportSummary model = new StorageTaskReportSummary(); - model = BinaryData.fromObject(model).toObject(StorageTaskReportSummary.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java deleted file mode 100644 index 65534bbfad97..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; -import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; -import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskUpdateParameters model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"838c709e-d905-4afd-955d-758ab957c691\",\"tenantId\":\"55a2cb0d-d988-4293-bb87-09311695d8e2\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"erhhbcsglumm\":{\"principalId\":\"45fb4590-b03c-423d-ac10-69640fedb353\",\"clientId\":\"294f6de9-60c4-4e07-a9da-b4de45485384\"},\"j\":{\"principalId\":\"b50a1a9e-01cb-4184-85d2-1ee058774378\",\"clientId\":\"bbce8433-aa26-4cb2-9468-9869e19e63eb\"}}},\"tags\":{\"jionpimexgstxgc\":\"xobnbdxkqpxok\"},\"properties\":{\"taskVersion\":8018866075965400544,\"enabled\":false,\"description\":\"ajrmvdjwzrlovmc\",\"action\":{\"if\":{\"condition\":\"whijcoejctbza\",\"operations\":[{\"name\":\"SetBlobTags\",\"parameters\":{\"kdkexxp\":\"cbkbfkg\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobExpiry\",\"parameters\":{\"dtocj\":\"pg\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"Deleting\",\"creationTimeInUtc\":\"2021-01-21T14:33:44Z\"}}") - .toObject(StorageTaskUpdateParameters.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xobnbdxkqpxok", model.tags().get("jionpimexgstxgc")); - Assertions.assertEquals(false, model.properties().enabled()); - Assertions.assertEquals("ajrmvdjwzrlovmc", model.properties().description()); - Assertions.assertEquals("whijcoejctbza", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("cbkbfkg", - model.properties().action().ifProperty().operations().get(0).parameters().get("kdkexxp")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_EXPIRY, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("pg", - model.properties().action().elseProperty().operations().get(0).parameters().get("dtocj")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().elseProperty().operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskUpdateParameters model - = new StorageTaskUpdateParameters() - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf("erhhbcsglumm", new UserAssignedIdentity(), "j", new UserAssignedIdentity()))) - .withTags(mapOf("jionpimexgstxgc", "xobnbdxkqpxok")) - .withProperties(new StorageTaskProperties().withEnabled(false) - .withDescription("ajrmvdjwzrlovmc") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("whijcoejctbza") - .withOperations(Arrays - .asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("kdkexxp", "cbkbfkg")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations( - Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_EXPIRY) - .withParameters(mapOf("dtocj", "pg")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))))); - model = BinaryData.fromObject(model).toObject(StorageTaskUpdateParameters.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xobnbdxkqpxok", model.tags().get("jionpimexgstxgc")); - Assertions.assertEquals(false, model.properties().enabled()); - Assertions.assertEquals("ajrmvdjwzrlovmc", model.properties().description()); - Assertions.assertEquals("whijcoejctbza", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("cbkbfkg", - model.properties().action().ifProperty().operations().get(0).parameters().get("kdkexxp")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_EXPIRY, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("pg", - model.properties().action().elseProperty().operations().get(0).parameters().get("dtocj")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().elseProperty().operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java deleted file mode 100644 index fa287cbacaf5..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.StorageTask; -import com.azure.resourcemanager.storageactions.models.StorageTaskAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; -import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTasksCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"1b510eb5-6c9f-4b8f-9ff7-78353843d48c\",\"tenantId\":\"262137ad-8f80-476e-8c7a-51b65844b07b\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ilovnot\":{\"principalId\":\"0d06c126-2c34-41d9-a026-f8a348e8283d\",\"clientId\":\"553049a2-2ba6-4495-ae9c-a892d1be2abc\"}}},\"properties\":{\"taskVersion\":4609095733155720227,\"enabled\":true,\"description\":\"njbkcnxdhbttkph\",\"action\":{\"if\":{\"condition\":\"wpn\",\"operations\":[{\"name\":\"UndeleteBlob\"},{\"name\":\"UndeleteBlob\"}]},\"else\":{\"operations\":[{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobExpiry\"}]}},\"provisioningState\":\"Succeeded\",\"creationTimeInUtc\":\"2021-09-12T23:58:43Z\"},\"location\":\"lphox\",\"tags\":{\"epsbjtazqu\":\"rpabg\",\"jidsuyonobglaoc\":\"xywpmueefjzwfqkq\"},\"id\":\"xtccmg\",\"name\":\"udxytlmoyrx\",\"type\":\"wfudwpzntxhdzhl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - StorageTask response - = manager.storageTasks() - .define("lcuhxwtctyqiklb") - .withRegion("uebbaumnyqup") - .withExistingResourceGroup("fzab") - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("hvgyuguosvmk", new UserAssignedIdentity(), "xquk", - new UserAssignedIdentity(), "l", new UserAssignedIdentity()))) - .withProperties( - new StorageTaskProperties().withEnabled(true) - .withDescription("nkjzkdeslpvlop") - .withAction( - new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("i") - .withOperations(Arrays.asList( - new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_EXPIRY)))) - .withElseProperty(new ElseCondition().withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_EXPIRY)))))) - .withTags(mapOf("tfhvpesapskrdqmh", "ojnabckhsmtxpsie", "tkncwsc", "jdhtldwkyzxu")) - .create(); - - Assertions.assertEquals("lphox", response.location()); - Assertions.assertEquals("rpabg", response.tags().get("epsbjtazqu")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals(true, response.properties().enabled()); - Assertions.assertEquals("njbkcnxdhbttkph", response.properties().description()); - Assertions.assertEquals("wpn", response.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, - response.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.DELETE_BLOB, - response.properties().action().elseProperty().operations().get(0).name()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 3b429ce2e9c1..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.StorageTask; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTasksGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"dd346b4e-f036-411b-88ea-baa83a1b9240\",\"tenantId\":\"4ddc9b95-5d48-4052-8c06-348c77ba6aa8\",\"type\":\"None\",\"userAssignedIdentities\":{\"noc\":{\"principalId\":\"5ae34fa1-5435-45b8-bd67-35737de83ec5\",\"clientId\":\"a69f306b-dbcb-4933-be58-2c2942e620b4\"}}},\"properties\":{\"taskVersion\":3525992913673198952,\"enabled\":false,\"description\":\"yaxuconuqszfkb\",\"action\":{\"if\":{\"condition\":\"ypewrmjmwvvjekt\",\"operations\":[{\"name\":\"SetBlobExpiry\"},{\"name\":\"SetBlobLegalHold\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTags\"},{\"name\":\"SetBlobLegalHold\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaBegin\",\"creationTimeInUtc\":\"2021-01-30T03:05:29Z\"},\"location\":\"zpwv\",\"tags\":{\"biqylihkaet\":\"q\",\"fcivfsnkym\":\"kt\",\"jf\":\"ctq\",\"fuwutttxf\":\"ebrjcxe\"},\"id\":\"jrbirphxepcyv\",\"name\":\"hfnljkyq\",\"type\":\"j\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - StorageTask response = manager.storageTasks() - .getByResourceGroupWithResponse("cohoq", "nwvlryavwhheunmm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zpwv", response.location()); - Assertions.assertEquals("q", response.tags().get("biqylihkaet")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); - Assertions.assertEquals(false, response.properties().enabled()); - Assertions.assertEquals("yaxuconuqszfkb", response.properties().description()); - Assertions.assertEquals("ypewrmjmwvvjekt", response.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_EXPIRY, - response.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - response.properties().action().elseProperty().operations().get(0).name()); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.java deleted file mode 100644 index 6dd59226d62b..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.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.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.StorageTask; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTasksListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"be9f13b5-b2e7-4a5c-8a49-223e6b37cc35\",\"tenantId\":\"8fcedcd3-0d9a-4af7-8aa8-82ff16a5b9d2\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"pbh\":{\"principalId\":\"8d0b8ab6-d73e-4f23-8cce-c76f1bac1178\",\"clientId\":\"8ae28a47-747d-4147-8269-72d46eeb43dd\"},\"tkcxywnytnrsy\":{\"principalId\":\"0f47c83b-3283-4ef3-97c5-f9941b061a93\",\"clientId\":\"eadd77f7-4eae-4f1f-98ef-ba4d1fc85ef7\"}}},\"properties\":{\"taskVersion\":7976782507588786268,\"enabled\":true,\"description\":\"ybyxc\",\"action\":{\"if\":{\"condition\":\"fclhaaxdbabphlwr\",\"operations\":[{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobTier\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobLegalHold\"}]}},\"provisioningState\":\"Canceled\",\"creationTimeInUtc\":\"2021-12-06T09:51:12Z\"},\"location\":\"mnyyazt\",\"tags\":{\"uedck\":\"wwrq\",\"bxu\":\"ywbiexzfeyueax\"},\"id\":\"wbhqwal\",\"name\":\"uzyoxaep\",\"type\":\"kzjancuxrhdwbav\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.storageTasks().listByResourceGroup("ttdbhrbnl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mnyyazt", response.iterator().next().location()); - Assertions.assertEquals("wwrq", response.iterator().next().tags().get("uedck")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, - response.iterator().next().identity().type()); - Assertions.assertEquals(true, response.iterator().next().properties().enabled()); - Assertions.assertEquals("ybyxc", response.iterator().next().properties().description()); - Assertions.assertEquals("fclhaaxdbabphlwr", - response.iterator().next().properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - response.iterator().next().properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, - response.iterator().next().properties().action().elseProperty().operations().get(0).name()); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java deleted file mode 100644 index 09a13e00bf00..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.StorageTask; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTasksListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"b4be81b0-30ea-4abb-9b1b-a95ba863f87b\",\"tenantId\":\"5653e8b4-0aa4-4c8a-83a2-ab0c7e790879\",\"type\":\"None\",\"userAssignedIdentities\":{\"ok\":{\"principalId\":\"41ce4222-6da7-4ee6-be14-0c5d99bdf6a1\",\"clientId\":\"61d7474c-2f29-4bae-9f91-f0d3eb85b9f8\"},\"jyoxgvclt\":{\"principalId\":\"4b1ca8cd-7eb8-49e0-a9a5-07fa4c82d123\",\"clientId\":\"19c94147-a13f-4402-9723-b5b6f87ef8f4\"},\"ncghkje\":{\"principalId\":\"fb8e79f2-de64-48ee-96f7-7b653e345bc3\",\"clientId\":\"510cd219-f0d4-46f3-af9f-52114f562f61\"},\"hbijhtxfvgxb\":{\"principalId\":\"789e2a49-3f91-4a84-8f72-72a9d81c1b21\",\"clientId\":\"8ca4febc-ddaa-451e-bc2d-5debbddd980d\"}}},\"properties\":{\"taskVersion\":7678271281177155084,\"enabled\":true,\"description\":\"eh\",\"action\":{\"if\":{\"condition\":\"pvecxgodeb\",\"operations\":[{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobLegalHold\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobExpiry\"},{\"name\":\"UndeleteBlob\"}]}},\"provisioningState\":\"Failed\",\"creationTimeInUtc\":\"2021-10-09T22:24:23Z\"},\"location\":\"flz\",\"tags\":{\"qzahmgkbrp\":\"xzpuzycisp\",\"hibnuqqkpika\":\"y\",\"buynhijggm\":\"rgvtqag\"},\"id\":\"bfs\",\"name\":\"arbu\",\"type\":\"rcvpnazzmhjrunmp\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.storageTasks().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("flz", response.iterator().next().location()); - Assertions.assertEquals("xzpuzycisp", response.iterator().next().tags().get("qzahmgkbrp")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals(true, response.iterator().next().properties().enabled()); - Assertions.assertEquals("eh", response.iterator().next().properties().description()); - Assertions.assertEquals("pvecxgodeb", - response.iterator().next().properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - response.iterator().next().properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - response.iterator().next().properties().action().elseProperty().operations().get(0).name()); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java deleted file mode 100644 index 7dc13467932a..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTasksListResult; - -public final class StorageTasksListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTasksListResult model = BinaryData.fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"e639a3a1-aa82-4e09-81cc-a1a540bd135b\",\"tenantId\":\"abf75570-f906-41f1-a20d-232090494e90\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ojnxqbzvdd\":{\"principalId\":\"41febecf-5439-4c4c-9375-6d8693dd76b7\",\"clientId\":\"d40bfb25-6e67-48f1-8368-d89aa2ef1a97\"}}},\"properties\":{\"taskVersion\":2783260712694826920,\"enabled\":true,\"description\":\"eic\",\"action\":{\"if\":{\"condition\":\"twnpzaoqvuhrhcf\",\"operations\":[{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobLegalHold\"},{\"name\":\"DeleteBlob\"},{\"name\":\"DeleteBlob\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTags\"},{\"name\":\"UndeleteBlob\"},{\"name\":\"DeleteBlob\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaBegin\",\"creationTimeInUtc\":\"2021-09-17T22:07:46Z\"},\"location\":\"yeicxmqciwqvhk\",\"tags\":{\"m\":\"uigdtopbobjog\",\"a\":\"w\",\"hrzayvvtpgvdf\":\"a\"},\"id\":\"iotkftutqxl\",\"name\":\"gxlefgugnxkrxd\",\"type\":\"mi\"}],\"nextLink\":\"thz\"}") - .toObject(StorageTasksListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTasksListResult model = new StorageTasksListResult(); - model = BinaryData.fromObject(model).toObject(StorageTasksListResult.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java deleted file mode 100644 index d5a9e566df87..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.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.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportInstance; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTasksReportsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"taskAssignmentId\":\"mx\",\"storageAccountId\":\"kv\",\"startTime\":\"elmqk\",\"finishTime\":\"ahvljuaha\",\"objectsTargetedCount\":\"hcdhmdual\",\"objectsOperatedOnCount\":\"xqpvfadmw\",\"objectFailedCount\":\"crgvxpvgom\",\"objectsSucceededCount\":\"fmisg\",\"runStatusError\":\"nbbelda\",\"runStatusEnum\":\"Finished\",\"summaryReportPath\":\"ali\",\"taskId\":\"rqhakauha\",\"taskVersion\":\"sfwxosowzxc\",\"runResult\":\"Succeeded\"},\"id\":\"jooxdjebw\",\"name\":\"ucww\",\"type\":\"vo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.storageTasksReports() - .list("fkuwbcrnwbmehhse", "v", 421254098, "srtslhspkdeem", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java deleted file mode 100644 index ae401848eebb..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"39616d0f-80ff-44e5-a852-755662fff2ff\",\"clientId\":\"3535e471-793d-4061-ab0d-5650c1a65320\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -}