diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md index 2f3eaf19ab37..abda882d23a0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2023-04-17) + +- Azure Resource Manager NewRelicObservability client library for Java. This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. Package tag package-2022-07-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/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md index 262df73c4586..1d0cca4d472b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md @@ -2,7 +2,7 @@ Azure Resource Manager NewRelicObservability client library for Java. -This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. Package tag package-2022-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. Package tag package-2022-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-newrelicobservability - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md index b736dbce1080..fc31930c8213 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md @@ -46,7 +46,7 @@ /** Samples for Accounts List. */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Accounts_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MinimumSet_Gen.json */ /** * Sample code: Accounts_List_MinimumSet_Gen. @@ -59,7 +59,7 @@ public final class AccountsListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Accounts_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json */ /** * Sample code: Accounts_List_MaximumSet_Gen. @@ -98,7 +98,7 @@ import java.util.Map; /** Samples for Monitors CreateOrUpdate. */ public final class MonitorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Monitors_CreateOrUpdate_MaximumSet_Gen. @@ -169,7 +169,7 @@ public final class MonitorsCreateOrUpdateSamples { /** Samples for Monitors Delete. */ public final class MonitorsDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MinimumSet_Gen.json */ /** * Sample code: Monitors_Delete_MinimumSet_Gen. @@ -182,7 +182,7 @@ public final class MonitorsDeleteSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json */ /** * Sample code: Monitors_Delete_MaximumSet_Gen. @@ -208,7 +208,7 @@ public final class MonitorsDeleteSamples { /** Samples for Monitors GetByResourceGroup. */ public final class MonitorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json */ /** * Sample code: Monitors_Get_MaximumSet_Gen. @@ -230,7 +230,7 @@ import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; /** Samples for Monitors GetMetricRules. */ public final class MonitorsGetMetricRulesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_GetMetricRules_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MinimumSet_Gen.json */ /** * Sample code: Monitors_GetMetricRules_MinimumSet_Gen. @@ -249,7 +249,7 @@ public final class MonitorsGetMetricRulesSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_GetMetricRules_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json */ /** * Sample code: Monitors_GetMetricRules_MaximumSet_Gen. @@ -278,7 +278,7 @@ import java.util.Arrays; /** Samples for Monitors GetMetricStatus. */ public final class MonitorsGetMetricStatusSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json */ /** * Sample code: Monitors_GetMetricStatus_MinimumSet_Gen. @@ -297,7 +297,7 @@ public final class MonitorsGetMetricStatusSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json */ /** * Sample code: Monitors_GetMetricStatus_MaximumSet_Gen. @@ -325,7 +325,7 @@ public final class MonitorsGetMetricStatusSamples { /** Samples for Monitors List. */ public final class MonitorsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListBySubscription_MaximumSet_Gen. @@ -348,7 +348,7 @@ import java.util.Arrays; /** Samples for Monitors ListAppServices. */ public final class MonitorsListAppServicesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListAppServices_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListAppServices_MaximumSet_Gen. @@ -369,7 +369,7 @@ public final class MonitorsListAppServicesSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListAppServices_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListAppServices_MinimumSet_Gen. @@ -395,7 +395,7 @@ public final class MonitorsListAppServicesSamples { /** Samples for Monitors ListByResourceGroup. */ public final class MonitorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListByResourceGroup_MaximumSet_Gen. @@ -418,7 +418,7 @@ import java.util.Arrays; /** Samples for Monitors ListHosts. */ public final class MonitorsListHostsSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListHosts_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListHosts_MinimumSet_Gen. @@ -439,7 +439,7 @@ public final class MonitorsListHostsSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListHosts_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListHosts_MaximumSet_Gen. @@ -467,7 +467,7 @@ public final class MonitorsListHostsSamples { /** Samples for Monitors ListMonitoredResources. */ public final class MonitorsListMonitoredResourcesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListMonitoredResources_MinimumSet_Gen. @@ -482,7 +482,7 @@ public final class MonitorsListMonitoredResourcesSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListMonitoredResources_MaximumSet_Gen. @@ -510,7 +510,7 @@ import java.time.OffsetDateTime; /** Samples for Monitors SwitchBilling. */ public final class MonitorsSwitchBillingSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_SwitchBilling_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MinimumSet_Gen.json */ /** * Sample code: Monitors_SwitchBilling_MinimumSet_Gen. @@ -529,7 +529,7 @@ public final class MonitorsSwitchBillingSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_SwitchBilling_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json */ /** * Sample code: Monitors_SwitchBilling_MaximumSet_Gen. @@ -584,7 +584,7 @@ import java.util.Map; /** Samples for Monitors Update. */ public final class MonitorsUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json */ /** * Sample code: Monitors_Update_MaximumSet_Gen. @@ -657,7 +657,7 @@ public final class MonitorsUpdateSamples { /** Samples for Monitors VmHostPayload. */ public final class MonitorsVmHostPayloadSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_VmHostPayload_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MinimumSet_Gen.json */ /** * Sample code: Monitors_VmHostPayload_MinimumSet_Gen. @@ -672,7 +672,7 @@ public final class MonitorsVmHostPayloadSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_VmHostPayload_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json */ /** * Sample code: Monitors_VmHostPayload_MaximumSet_Gen. @@ -694,7 +694,7 @@ public final class MonitorsVmHostPayloadSamples { /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. @@ -707,7 +707,7 @@ public final class OperationsListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. @@ -727,7 +727,7 @@ public final class OperationsListSamples { /** Samples for Organizations List. */ public final class OrganizationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Organizations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MinimumSet_Gen.json */ /** * Sample code: Organizations_List_MinimumSet_Gen. @@ -740,7 +740,7 @@ public final class OrganizationsListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Organizations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json */ /** * Sample code: Organizations_List_MaximumSet_Gen. @@ -760,7 +760,7 @@ public final class OrganizationsListSamples { /** Samples for Plans List. */ public final class PlansListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Plans_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json */ /** * Sample code: Plans_List_MaximumSet_Gen. @@ -773,7 +773,7 @@ public final class PlansListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Plans_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MinimumSet_Gen.json */ /** * Sample code: Plans_List_MinimumSet_Gen. @@ -802,7 +802,7 @@ import java.util.Arrays; /** Samples for TagRules CreateOrUpdate. */ public final class TagRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: TagRules_CreateOrUpdate_MaximumSet_Gen. @@ -841,7 +841,7 @@ public final class TagRulesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: TagRules_CreateOrUpdate_MinimumSet_Gen. @@ -865,7 +865,7 @@ public final class TagRulesCreateOrUpdateSamples { /** Samples for TagRules Delete. */ public final class TagRulesDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MinimumSet_Gen.json */ /** * Sample code: TagRules_Delete_MinimumSet_Gen. @@ -884,7 +884,7 @@ public final class TagRulesDeleteSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json */ /** * Sample code: TagRules_Delete_MaximumSet_Gen. @@ -910,7 +910,7 @@ public final class TagRulesDeleteSamples { /** Samples for TagRules Get. */ public final class TagRulesGetSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json */ /** * Sample code: TagRules_Get_MinimumSet_Gen. @@ -929,7 +929,7 @@ public final class TagRulesGetSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json */ /** * Sample code: TagRules_Get_MaximumSet_Gen. @@ -955,7 +955,7 @@ public final class TagRulesGetSamples { /** Samples for TagRules ListByNewRelicMonitorResource. */ public final class TagRulesListByNewRelicMonitorResourceSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json */ /** * Sample code: TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen. @@ -971,7 +971,7 @@ public final class TagRulesListByNewRelicMonitorResourceSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json */ /** * Sample code: TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen. @@ -1004,7 +1004,7 @@ import java.util.Arrays; /** Samples for TagRules Update. */ public final class TagRulesUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json */ /** * Sample code: TagRules_Update_MaximumSet_Gen. @@ -1050,7 +1050,7 @@ public final class TagRulesUpdateSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MinimumSet_Gen.json */ /** * Sample code: TagRules_Update_MinimumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml index 60cc2cbcd253..6e880530ad3f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for NewRelicObservability Management - This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2022-07-01-preview. + This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2022-07-01. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java index 2a5d1782353f..974a640345eb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java @@ -22,6 +22,7 @@ import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; +import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse; import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; @@ -358,10 +359,10 @@ PagedIterable listAppServices( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response switchBillingWithResponse( + MonitorsSwitchBillingResponse switchBillingWithResponse( String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context); /** @@ -373,9 +374,11 @@ Response switchBillingWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request); + NewRelicMonitorResourceInner switchBilling( + String resourceGroupName, String monitorName, SwitchBillingRequest request); /** * List the compute vm resources currently being monitored by the NewRelic resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java index fabf74bf73f8..5bd0c27357ca 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java @@ -47,6 +47,7 @@ import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; import com.azure.resourcemanager.newrelicobservability.models.MonitoredResourceListResponse; +import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse; import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceListResult; import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; @@ -211,9 +212,9 @@ Mono> listAppServices( @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/switchBilling") - @ExpectedResponses({204}) + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> switchBilling( + Mono switchBilling( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -1988,10 +1989,10 @@ public PagedIterable listAppServices( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> switchBillingWithResponseAsync( + private Mono switchBillingWithResponseAsync( String resourceGroupName, String monitorName, SwitchBillingRequest request) { if (this.client.getEndpoint() == null) { return Mono @@ -2044,10 +2045,10 @@ private Mono> switchBillingWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> switchBillingWithResponseAsync( + private Mono switchBillingWithResponseAsync( String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -2096,11 +2097,13 @@ private Mono> switchBillingWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono switchBillingAsync(String resourceGroupName, String monitorName, SwitchBillingRequest request) { - return switchBillingWithResponseAsync(resourceGroupName, monitorName, request).flatMap(ignored -> Mono.empty()); + private Mono switchBillingAsync( + String resourceGroupName, String monitorName, SwitchBillingRequest request) { + return switchBillingWithResponseAsync(resourceGroupName, monitorName, request) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2113,10 +2116,10 @@ private Mono switchBillingAsync(String resourceGroupName, String monitorNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response switchBillingWithResponse( + public MonitorsSwitchBillingResponse switchBillingWithResponse( String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) { return switchBillingWithResponseAsync(resourceGroupName, monitorName, request, context).block(); } @@ -2130,10 +2133,12 @@ public Response switchBillingWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request) { - switchBillingWithResponse(resourceGroupName, monitorName, request, Context.NONE); + public NewRelicMonitorResourceInner switchBilling( + String resourceGroupName, String monitorName, SwitchBillingRequest request) { + return switchBillingWithResponse(resourceGroupName, monitorName, request, Context.NONE).getValue(); } /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java index 22d7b5148050..6d8880b1276b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java @@ -26,6 +26,7 @@ import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusResponse; import com.azure.resourcemanager.newrelicobservability.models.MonitoredResource; import com.azure.resourcemanager.newrelicobservability.models.Monitors; +import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse; import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; import com.azure.resourcemanager.newrelicobservability.models.VMExtensionPayload; @@ -162,13 +163,30 @@ public PagedIterable listAppServices( return Utils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); } - public Response switchBillingWithResponse( + public Response switchBillingWithResponse( String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) { - return this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context); + MonitorsSwitchBillingResponse inner = + this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NewRelicMonitorResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request) { - this.serviceClient().switchBilling(resourceGroupName, monitorName, request); + public NewRelicMonitorResource switchBilling( + String resourceGroupName, String monitorName, SwitchBillingRequest request) { + NewRelicMonitorResourceInner inner = + this.serviceClient().switchBilling(resourceGroupName, monitorName, request); + if (inner != null) { + return new NewRelicMonitorResourceImpl(inner, this.manager()); + } else { + return null; + } } public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request) { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java index bbeb053af85b..fbf595fb3c19 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java @@ -253,12 +253,12 @@ public PagedIterable listAppServices(AppServicesGetRequest reque return serviceManager.monitors().listAppServices(resourceGroupName, monitorName, request, context); } - public Response switchBillingWithResponse(SwitchBillingRequest request, Context context) { + public Response switchBillingWithResponse(SwitchBillingRequest request, Context context) { return serviceManager.monitors().switchBillingWithResponse(resourceGroupName, monitorName, request, context); } - public void switchBilling(SwitchBillingRequest request) { - serviceManager.monitors().switchBilling(resourceGroupName, monitorName, request); + public NewRelicMonitorResource switchBilling(SwitchBillingRequest request) { + return serviceManager.monitors().switchBilling(resourceGroupName, monitorName, request); } public PagedIterable listHosts(HostsGetRequest request) { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java index aac210c97b7c..e771fe627b1a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java @@ -207,7 +207,7 @@ public TagRulesClient getTagRules() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-07-01-preview"; + this.apiVersion = "2022-07-01"; this.operations = new OperationsClientImpl(this); this.accounts = new AccountsClientImpl(this); this.monitors = new MonitorsClientImpl(this); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java index 22569267b22d..003c100c0431 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java @@ -203,9 +203,9 @@ PagedIterable listAppServices( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return a Monitor Resource by NewRelic. */ - Response switchBillingWithResponse( + Response switchBillingWithResponse( String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context); /** @@ -217,8 +217,9 @@ Response switchBillingWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Monitor Resource by NewRelic. */ - void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request); + NewRelicMonitorResource switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request); /** * List the compute vm resources currently being monitored by the NewRelic resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingHeaders.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingHeaders.java new file mode 100644 index 000000000000..10dcd94faf92 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingHeaders.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MonitorsSwitchBillingHeaders model. */ +@Fluent +public final class MonitorsSwitchBillingHeaders { + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of MonitorsSwitchBillingHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public MonitorsSwitchBillingHeaders(HttpHeaders rawHeaders) { + String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER); + if (retryAfter != null) { + this.retryAfter = Integer.parseInt(retryAfter); + } + } + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the MonitorsSwitchBillingHeaders object itself. + */ + public MonitorsSwitchBillingHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingResponse.java new file mode 100644 index 000000000000..cf0db79e8f5f --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingResponse.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner; + +/** Contains all response data for the switchBilling operation. */ +public final class MonitorsSwitchBillingResponse + extends ResponseBase { + /** + * Creates an instance of MonitorsSwitchBillingResponse. + * + * @param request the request which resulted in this MonitorsSwitchBillingResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public MonitorsSwitchBillingResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + NewRelicMonitorResourceInner value, + MonitorsSwitchBillingHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public NewRelicMonitorResourceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java index 423a21b507b7..3359f02510db 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java @@ -502,9 +502,9 @@ interface WithAccountCreationSource { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return a Monitor Resource by NewRelic. */ - Response switchBillingWithResponse(SwitchBillingRequest request, Context context); + Response switchBillingWithResponse(SwitchBillingRequest request, Context context); /** * Switches the billing for NewRelic monitor resource. @@ -513,8 +513,9 @@ interface WithAccountCreationSource { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Monitor Resource by NewRelic. */ - void switchBilling(SwitchBillingRequest request); + NewRelicMonitorResource switchBilling(SwitchBillingRequest request); /** * List the compute vm resources currently being monitored by the NewRelic resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java index 516eb19d31b2..3d96f7c3ac16 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Accounts List. */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Accounts_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MinimumSet_Gen.json */ /** * Sample code: Accounts_List_MinimumSet_Gen. @@ -20,7 +20,7 @@ public static void accountsListMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Accounts_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json */ /** * Sample code: Accounts_List_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java index 7bdd63ba12f7..358ae8b94c5a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java @@ -26,7 +26,7 @@ /** Samples for Monitors CreateOrUpdate. */ public final class MonitorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Monitors_CreateOrUpdate_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java index 14a23120df53..0079a6338cbe 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors Delete. */ public final class MonitorsDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MinimumSet_Gen.json */ /** * Sample code: Monitors_Delete_MinimumSet_Gen. @@ -20,7 +20,7 @@ public static void monitorsDeleteMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json */ /** * Sample code: Monitors_Delete_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java index 1fd0ec7174ba..f3c289c7d18b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors GetByResourceGroup. */ public final class MonitorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json */ /** * Sample code: Monitors_Get_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java index 542936e66350..4c135009373f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java @@ -9,7 +9,7 @@ /** Samples for Monitors GetMetricRules. */ public final class MonitorsGetMetricRulesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_GetMetricRules_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MinimumSet_Gen.json */ /** * Sample code: Monitors_GetMetricRules_MinimumSet_Gen. @@ -28,7 +28,7 @@ public static void monitorsGetMetricRulesMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_GetMetricRules_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json */ /** * Sample code: Monitors_GetMetricRules_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java index 21a9cd119e3a..729dd907b15b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java @@ -10,7 +10,7 @@ /** Samples for Monitors GetMetricStatus. */ public final class MonitorsGetMetricStatusSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json */ /** * Sample code: Monitors_GetMetricStatus_MinimumSet_Gen. @@ -29,7 +29,7 @@ public static void monitorsGetMetricStatusMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json */ /** * Sample code: Monitors_GetMetricStatus_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java index 3b3dde31184a..70fd06e09d50 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java @@ -10,7 +10,7 @@ /** Samples for Monitors ListAppServices. */ public final class MonitorsListAppServicesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListAppServices_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListAppServices_MaximumSet_Gen. @@ -31,7 +31,7 @@ public static void monitorsListAppServicesMaximumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListAppServices_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListAppServices_MinimumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java index cab99236d2cc..69c7e4adf0dd 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors ListByResourceGroup. */ public final class MonitorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListByResourceGroup_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java index 2e9cb754e589..d5875b2680b4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java @@ -10,7 +10,7 @@ /** Samples for Monitors ListHosts. */ public final class MonitorsListHostsSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListHosts_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListHosts_MinimumSet_Gen. @@ -31,7 +31,7 @@ public static void monitorsListHostsMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListHosts_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListHosts_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java index f55726953027..7e2390ebe2b1 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors ListMonitoredResources. */ public final class MonitorsListMonitoredResourcesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json */ /** * Sample code: Monitors_ListMonitoredResources_MinimumSet_Gen. @@ -22,7 +22,7 @@ public static void monitorsListMonitoredResourcesMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListMonitoredResources_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java index ad07a7b7b3e4..ebbf77092329 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors List. */ public final class MonitorsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: Monitors_ListBySubscription_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java index 1b9b2bc23ed8..8ce20bd6d228 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java @@ -13,7 +13,7 @@ /** Samples for Monitors SwitchBilling. */ public final class MonitorsSwitchBillingSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_SwitchBilling_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MinimumSet_Gen.json */ /** * Sample code: Monitors_SwitchBilling_MinimumSet_Gen. @@ -32,7 +32,7 @@ public static void monitorsSwitchBillingMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_SwitchBilling_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json */ /** * Sample code: Monitors_SwitchBilling_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java index 5a330c682937..59cdb1788e21 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java @@ -27,7 +27,7 @@ /** Samples for Monitors Update. */ public final class MonitorsUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json */ /** * Sample code: Monitors_Update_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java index d98e2a0a91b2..36c4a80ae49f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors VmHostPayload. */ public final class MonitorsVmHostPayloadSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_VmHostPayload_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MinimumSet_Gen.json */ /** * Sample code: Monitors_VmHostPayload_MinimumSet_Gen. @@ -22,7 +22,7 @@ public static void monitorsVmHostPayloadMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Monitors_VmHostPayload_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json */ /** * Sample code: Monitors_VmHostPayload_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java index 56d831fb8596..40771394c2e9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. @@ -20,7 +20,7 @@ public static void operationsListMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java index cda13f6729a0..bd4d2591aa4b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Organizations List. */ public final class OrganizationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Organizations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MinimumSet_Gen.json */ /** * Sample code: Organizations_List_MinimumSet_Gen. @@ -20,7 +20,7 @@ public static void organizationsListMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Organizations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json */ /** * Sample code: Organizations_List_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java index 5eb4e5e14803..798b3ae411d5 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java @@ -7,7 +7,7 @@ /** Samples for Plans List. */ public final class PlansListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Plans_List_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json */ /** * Sample code: Plans_List_MaximumSet_Gen. @@ -20,7 +20,7 @@ public static void plansListMaximumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/Plans_List_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MinimumSet_Gen.json */ /** * Sample code: Plans_List_MinimumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java index c90c7ff28236..779d3a5818e4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java @@ -16,7 +16,7 @@ /** Samples for TagRules CreateOrUpdate. */ public final class TagRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: TagRules_CreateOrUpdate_MaximumSet_Gen. @@ -55,7 +55,7 @@ public static void tagRulesCreateOrUpdateMaximumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: TagRules_CreateOrUpdate_MinimumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java index 224eaf1b0243..bf2ee37a5c51 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for TagRules Delete. */ public final class TagRulesDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MinimumSet_Gen.json */ /** * Sample code: TagRules_Delete_MinimumSet_Gen. @@ -26,7 +26,7 @@ public static void tagRulesDeleteMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json */ /** * Sample code: TagRules_Delete_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java index 67deb0246151..4dde5c5ce9f9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java @@ -7,7 +7,7 @@ /** Samples for TagRules Get. */ public final class TagRulesGetSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json */ /** * Sample code: TagRules_Get_MinimumSet_Gen. @@ -26,7 +26,7 @@ public static void tagRulesGetMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json */ /** * Sample code: TagRules_Get_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java index a21cea33e641..b28c3e3c9fec 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java @@ -7,7 +7,7 @@ /** Samples for TagRules ListByNewRelicMonitorResource. */ public final class TagRulesListByNewRelicMonitorResourceSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json */ /** * Sample code: TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen. @@ -23,7 +23,7 @@ public static void tagRulesListByNewRelicMonitorResourceMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json */ /** * Sample code: TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java index bc12b201c173..1aad4f817a39 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java @@ -17,7 +17,7 @@ /** Samples for TagRules Update. */ public final class TagRulesUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json */ /** * Sample code: TagRules_Update_MaximumSet_Gen. @@ -63,7 +63,7 @@ public static void tagRulesUpdateMaximumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/preview/2022-07-01-preview/examples/TagRules_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MinimumSet_Gen.json */ /** * Sample code: TagRules_Update_MinimumSet_Gen. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountPropertiesTests.java deleted file mode 100644 index 72eef6f3fb19..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.AccountProperties; -import org.junit.jupiter.api.Assertions; - -public final class AccountPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountProperties model = - BinaryData - .fromString( - "{\"organizationId\":\"wixjsprozvcp\",\"accountId\":\"eg\",\"accountName\":\"wmfdatscmdvpjhul\",\"region\":\"uvm\"}") - .toObject(AccountProperties.class); - Assertions.assertEquals("wixjsprozvcp", model.organizationId()); - Assertions.assertEquals("eg", model.accountId()); - Assertions.assertEquals("wmfdatscmdvpjhul", model.accountName()); - Assertions.assertEquals("uvm", model.region()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountProperties model = - new AccountProperties() - .withOrganizationId("wixjsprozvcp") - .withAccountId("eg") - .withAccountName("wmfdatscmdvpjhul") - .withRegion("uvm"); - model = BinaryData.fromObject(model).toObject(AccountProperties.class); - Assertions.assertEquals("wixjsprozvcp", model.organizationId()); - Assertions.assertEquals("eg", model.accountId()); - Assertions.assertEquals("wmfdatscmdvpjhul", model.accountName()); - Assertions.assertEquals("uvm", model.region()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountResourceInnerTests.java deleted file mode 100644 index d48031a8f819..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountResourceInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.AccountResourceInner; -import org.junit.jupiter.api.Assertions; - -public final class AccountResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"organizationId\":\"s\",\"accountId\":\"nyejhkryhtnap\",\"accountName\":\"wlokjyem\",\"region\":\"vnipjox\"},\"id\":\"nchgej\",\"name\":\"podmailzydehojwy\",\"type\":\"huxinpmqnj\"}") - .toObject(AccountResourceInner.class); - Assertions.assertEquals("s", model.organizationId()); - Assertions.assertEquals("nyejhkryhtnap", model.accountId()); - Assertions.assertEquals("wlokjyem", model.accountName()); - Assertions.assertEquals("vnipjox", model.region()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountResourceInner model = - new AccountResourceInner() - .withOrganizationId("s") - .withAccountId("nyejhkryhtnap") - .withAccountName("wlokjyem") - .withRegion("vnipjox"); - model = BinaryData.fromObject(model).toObject(AccountResourceInner.class); - Assertions.assertEquals("s", model.organizationId()); - Assertions.assertEquals("nyejhkryhtnap", model.accountId()); - Assertions.assertEquals("wlokjyem", model.accountName()); - Assertions.assertEquals("vnipjox", model.region()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java deleted file mode 100644 index 8e0eb3771d64..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccountsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"organizationId\":\"fclhaaxdbabphlwr\",\"accountId\":\"fkts\",\"accountName\":\"sucocmnyyazttbtw\",\"region\":\"qpuedckzywbiex\"},\"id\":\"eyueaxibxujwb\",\"name\":\"qwalmuzyoxaepd\",\"type\":\"zjancuxr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.accounts().list("tkcxywnytnrsy", "lqidyby", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fclhaaxdbabphlwr", response.iterator().next().organizationId()); - Assertions.assertEquals("fkts", response.iterator().next().accountId()); - Assertions.assertEquals("sucocmnyyazttbtw", response.iterator().next().accountName()); - Assertions.assertEquals("qpuedckzywbiex", response.iterator().next().region()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListResponseTests.java deleted file mode 100644 index d1749734275b..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListResponseTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.AccountResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.AccountsListResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AccountsListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountsListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"organizationId\":\"ithxqhabifpi\",\"accountId\":\"wczbys\",\"accountName\":\"pqxu\",\"region\":\"vyq\"},\"id\":\"wby\",\"name\":\"rkxvdum\",\"type\":\"grtfwvu\"}],\"nextLink\":\"gaudcc\"}") - .toObject(AccountsListResponse.class); - Assertions.assertEquals("ithxqhabifpi", model.value().get(0).organizationId()); - Assertions.assertEquals("wczbys", model.value().get(0).accountId()); - Assertions.assertEquals("pqxu", model.value().get(0).accountName()); - Assertions.assertEquals("vyq", model.value().get(0).region()); - Assertions.assertEquals("gaudcc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountsListResponse model = - new AccountsListResponse() - .withValue( - Arrays - .asList( - new AccountResourceInner() - .withOrganizationId("ithxqhabifpi") - .withAccountId("wczbys") - .withAccountName("pqxu") - .withRegion("vyq"))) - .withNextLink("gaudcc"); - model = BinaryData.fromObject(model).toObject(AccountsListResponse.class); - Assertions.assertEquals("ithxqhabifpi", model.value().get(0).organizationId()); - Assertions.assertEquals("wczbys", model.value().get(0).accountId()); - Assertions.assertEquals("pqxu", model.value().get(0).accountName()); - Assertions.assertEquals("vyq", model.value().get(0).region()); - Assertions.assertEquals("gaudcc", model.nextLink()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.java deleted file mode 100644 index 8b390223fdc4..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.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.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner; -import org.junit.jupiter.api.Assertions; - -public final class AppServiceInfoInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AppServiceInfoInner model = - BinaryData - .fromString( - "{\"azureResourceId\":\"azjdyggd\",\"agentVersion\":\"ixhbkuofqweykhm\",\"agentStatus\":\"evfyexfwhybcib\"}") - .toObject(AppServiceInfoInner.class); - Assertions.assertEquals("azjdyggd", model.azureResourceId()); - Assertions.assertEquals("ixhbkuofqweykhm", model.agentVersion()); - Assertions.assertEquals("evfyexfwhybcib", model.agentStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppServiceInfoInner model = - new AppServiceInfoInner() - .withAzureResourceId("azjdyggd") - .withAgentVersion("ixhbkuofqweykhm") - .withAgentStatus("evfyexfwhybcib"); - model = BinaryData.fromObject(model).toObject(AppServiceInfoInner.class); - Assertions.assertEquals("azjdyggd", model.azureResourceId()); - Assertions.assertEquals("ixhbkuofqweykhm", model.agentVersion()); - Assertions.assertEquals("evfyexfwhybcib", model.agentStatus()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.java deleted file mode 100644 index 01035bd93e67..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.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.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AppServicesGetRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AppServicesGetRequest model = - BinaryData - .fromString("{\"azureResourceIds\":[\"dudgwdslfhot\"],\"userEmail\":\"mcy\"}") - .toObject(AppServicesGetRequest.class); - Assertions.assertEquals("dudgwdslfhot", model.azureResourceIds().get(0)); - Assertions.assertEquals("mcy", model.userEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppServicesGetRequest model = - new AppServicesGetRequest().withAzureResourceIds(Arrays.asList("dudgwdslfhot")).withUserEmail("mcy"); - model = BinaryData.fromObject(model).toObject(AppServicesGetRequest.class); - Assertions.assertEquals("dudgwdslfhot", model.azureResourceIds().get(0)); - Assertions.assertEquals("mcy", model.userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java deleted file mode 100644 index 82be020a7c68..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner; -import com.azure.resourcemanager.newrelicobservability.models.AppServicesListResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AppServicesListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AppServicesListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"azureResourceId\":\"lbjnpgacftadehx\",\"agentVersion\":\"tyfsoppusuesn\",\"agentStatus\":\"dejbavo\"},{\"azureResourceId\":\"zdmohctbqvu\",\"agentVersion\":\"xdn\",\"agentStatus\":\"vo\"}],\"nextLink\":\"ujjugwdkcglh\"}") - .toObject(AppServicesListResponse.class); - Assertions.assertEquals("lbjnpgacftadehx", model.value().get(0).azureResourceId()); - Assertions.assertEquals("tyfsoppusuesn", model.value().get(0).agentVersion()); - Assertions.assertEquals("dejbavo", model.value().get(0).agentStatus()); - Assertions.assertEquals("ujjugwdkcglh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppServicesListResponse model = - new AppServicesListResponse() - .withValue( - Arrays - .asList( - new AppServiceInfoInner() - .withAzureResourceId("lbjnpgacftadehx") - .withAgentVersion("tyfsoppusuesn") - .withAgentStatus("dejbavo"), - new AppServiceInfoInner() - .withAzureResourceId("zdmohctbqvu") - .withAgentVersion("xdn") - .withAgentStatus("vo"))) - .withNextLink("ujjugwdkcglh"); - model = BinaryData.fromObject(model).toObject(AppServicesListResponse.class); - Assertions.assertEquals("lbjnpgacftadehx", model.value().get(0).azureResourceId()); - Assertions.assertEquals("tyfsoppusuesn", model.value().get(0).agentVersion()); - Assertions.assertEquals("dejbavo", model.value().get(0).agentStatus()); - Assertions.assertEquals("ujjugwdkcglh", model.nextLink()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java deleted file mode 100644 index cdb298e9303b..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; -import com.azure.resourcemanager.newrelicobservability.models.TagAction; -import org.junit.jupiter.api.Assertions; - -public final class FilteringTagTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FilteringTag model = - BinaryData - .fromString("{\"name\":\"nqvpkvlrxnje\",\"value\":\"eipheoflokeyy\",\"action\":\"Include\"}") - .toObject(FilteringTag.class); - Assertions.assertEquals("nqvpkvlrxnje", model.name()); - Assertions.assertEquals("eipheoflokeyy", model.value()); - Assertions.assertEquals(TagAction.INCLUDE, model.action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FilteringTag model = - new FilteringTag().withName("nqvpkvlrxnje").withValue("eipheoflokeyy").withAction(TagAction.INCLUDE); - model = BinaryData.fromObject(model).toObject(FilteringTag.class); - Assertions.assertEquals("nqvpkvlrxnje", model.name()); - Assertions.assertEquals("eipheoflokeyy", model.value()); - Assertions.assertEquals(TagAction.INCLUDE, model.action()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.java deleted file mode 100644 index a16732f0db83..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.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.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class HostsGetRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HostsGetRequest model = - BinaryData - .fromString("{\"vmIds\":[\"xyqj\",\"k\",\"attpngjcrcczsq\",\"jh\"],\"userEmail\":\"mdajv\"}") - .toObject(HostsGetRequest.class); - Assertions.assertEquals("xyqj", model.vmIds().get(0)); - Assertions.assertEquals("mdajv", model.userEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HostsGetRequest model = - new HostsGetRequest().withVmIds(Arrays.asList("xyqj", "k", "attpngjcrcczsq", "jh")).withUserEmail("mdajv"); - model = BinaryData.fromObject(model).toObject(HostsGetRequest.class); - Assertions.assertEquals("xyqj", model.vmIds().get(0)); - Assertions.assertEquals("mdajv", model.userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java deleted file mode 100644 index ea9ee3973b43..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; -import com.azure.resourcemanager.newrelicobservability.models.LogRules; -import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.TagAction; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogRulesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogRules model = - BinaryData - .fromString( - "{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"gyxzk\",\"value\":\"ocukoklyax\",\"action\":\"Include\"},{\"name\":\"uqszfk\",\"value\":\"ypewrmjmwvvjekt\",\"action\":\"Include\"},{\"name\":\"nhwlrsffrzpwvl\",\"value\":\"q\",\"action\":\"Exclude\"},{\"name\":\"ylihkaetckt\",\"value\":\"civfsnkymuctq\",\"action\":\"Exclude\"}]}") - .toObject(LogRules.class); - Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.sendActivityLogs()); - Assertions.assertEquals("gyxzk", model.filteringTags().get(0).name()); - Assertions.assertEquals("ocukoklyax", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.filteringTags().get(0).action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogRules model = - new LogRules() - .withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag().withName("gyxzk").withValue("ocukoklyax").withAction(TagAction.INCLUDE), - new FilteringTag() - .withName("uqszfk") - .withValue("ypewrmjmwvvjekt") - .withAction(TagAction.INCLUDE), - new FilteringTag().withName("nhwlrsffrzpwvl").withValue("q").withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("ylihkaetckt") - .withValue("civfsnkymuctq") - .withAction(TagAction.EXCLUDE))); - model = BinaryData.fromObject(model).toObject(LogRules.class); - Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.sendActivityLogs()); - Assertions.assertEquals("gyxzk", model.filteringTags().get(0).name()); - Assertions.assertEquals("ocukoklyax", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.filteringTags().get(0).action()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index c00dfb67cf00..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.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\":\"22344daa-b3dd-4871-a36a-d87329d7986e\",\"tenantId\":\"16bf6317-f9b6-4a61-9cf6-7456b48948f6\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"t\":{\"principalId\":\"5fa19924-3de4-47a7-b9c4-9328b71f5f21\",\"clientId\":\"e177acc9-ba17-48b1-a55c-2b6bdc7b7d26\"},\"zzvypyqrimzinp\":{\"principalId\":\"2d1bab91-f616-4374-a992-3ba8e0b0a973\",\"clientId\":\"578e4597-1acb-4521-8b85-f56d5236689e\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("t", new UserAssignedIdentity(), "zzvypyqrimzinp", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java deleted file mode 100644 index f55f60fa3e46..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; -import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; -import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; -import com.azure.resourcemanager.newrelicobservability.models.TagAction; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetricRulesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricRulesInner model = - BinaryData - .fromString( - "{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"m\",\"value\":\"qabcypm\",\"action\":\"Exclude\"},{\"name\":\"lzu\",\"value\":\"c\",\"action\":\"Exclude\"},{\"name\":\"nbacfi\",\"value\":\"l\",\"action\":\"Include\"},{\"name\":\"tqgtzxdpnqbqq\",\"value\":\"rjfeallnwsubisnj\",\"action\":\"Include\"}],\"userEmail\":\"ngnzscxaqwoochc\"}") - .toObject(MetricRulesInner.class); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.sendMetrics()); - Assertions.assertEquals("m", model.filteringTags().get(0).name()); - Assertions.assertEquals("qabcypm", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); - Assertions.assertEquals("ngnzscxaqwoochc", model.userEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricRulesInner model = - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.ENABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag().withName("m").withValue("qabcypm").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("lzu").withValue("c").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("nbacfi").withValue("l").withAction(TagAction.INCLUDE), - new FilteringTag() - .withName("tqgtzxdpnqbqq") - .withValue("rjfeallnwsubisnj") - .withAction(TagAction.INCLUDE))) - .withUserEmail("ngnzscxaqwoochc"); - model = BinaryData.fromObject(model).toObject(MetricRulesInner.class); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.sendMetrics()); - Assertions.assertEquals("m", model.filteringTags().get(0).name()); - Assertions.assertEquals("qabcypm", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); - Assertions.assertEquals("ngnzscxaqwoochc", model.userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.java deleted file mode 100644 index f75bed659942..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.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.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; -import org.junit.jupiter.api.Assertions; - -public final class MetricsRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricsRequest model = BinaryData.fromString("{\"userEmail\":\"ofsx\"}").toObject(MetricsRequest.class); - Assertions.assertEquals("ofsx", model.userEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricsRequest model = new MetricsRequest().withUserEmail("ofsx"); - model = BinaryData.fromObject(model).toObject(MetricsRequest.class); - Assertions.assertEquals("ofsx", model.userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java deleted file mode 100644 index 3de4e83529a5..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetricsStatusRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricsStatusRequest model = - BinaryData - .fromString( - "{\"azureResourceIds\":[\"dlwtgrhpdj\",\"jumasx\",\"zj\",\"qyeg\"],\"userEmail\":\"alhbx\"}") - .toObject(MetricsStatusRequest.class); - Assertions.assertEquals("dlwtgrhpdj", model.azureResourceIds().get(0)); - Assertions.assertEquals("alhbx", model.userEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricsStatusRequest model = - new MetricsStatusRequest() - .withAzureResourceIds(Arrays.asList("dlwtgrhpdj", "jumasx", "zj", "qyeg")) - .withUserEmail("alhbx"); - model = BinaryData.fromObject(model).toObject(MetricsStatusRequest.class); - Assertions.assertEquals("dlwtgrhpdj", model.azureResourceIds().get(0)); - Assertions.assertEquals("alhbx", model.userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java deleted file mode 100644 index b1a22fb7525f..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetricsStatusResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricsStatusResponseInner model = - BinaryData.fromString("{\"azureResourceIds\":[\"jj\"]}").toObject(MetricsStatusResponseInner.class); - Assertions.assertEquals("jj", model.azureResourceIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricsStatusResponseInner model = new MetricsStatusResponseInner().withAzureResourceIds(Arrays.asList("jj")); - model = BinaryData.fromObject(model).toObject(MetricsStatusResponseInner.class); - Assertions.assertEquals("jj", model.azureResourceIds().get(0)); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java deleted file mode 100644 index b73a117dc48a..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.SendingLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendingMetricsStatus; -import org.junit.jupiter.api.Assertions; - -public final class MonitoredResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitoredResourceInner model = - BinaryData - .fromString( - "{\"id\":\"uqkhrsajiwku\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"kg\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"uimjmvx\"}") - .toObject(MonitoredResourceInner.class); - Assertions.assertEquals("uqkhrsajiwku", model.id()); - Assertions.assertEquals(SendingMetricsStatus.ENABLED, model.sendingMetrics()); - Assertions.assertEquals("kg", model.reasonForMetricsStatus()); - Assertions.assertEquals(SendingLogsStatus.ENABLED, model.sendingLogs()); - Assertions.assertEquals("uimjmvx", model.reasonForLogsStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitoredResourceInner model = - new MonitoredResourceInner() - .withId("uqkhrsajiwku") - .withSendingMetrics(SendingMetricsStatus.ENABLED) - .withReasonForMetricsStatus("kg") - .withSendingLogs(SendingLogsStatus.ENABLED) - .withReasonForLogsStatus("uimjmvx"); - model = BinaryData.fromObject(model).toObject(MonitoredResourceInner.class); - Assertions.assertEquals("uqkhrsajiwku", model.id()); - Assertions.assertEquals(SendingMetricsStatus.ENABLED, model.sendingMetrics()); - Assertions.assertEquals("kg", model.reasonForMetricsStatus()); - Assertions.assertEquals(SendingLogsStatus.ENABLED, model.sendingLogs()); - Assertions.assertEquals("uimjmvx", model.reasonForLogsStatus()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java deleted file mode 100644 index 25d9a05d8acb..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.MonitoredResourceListResponse; -import com.azure.resourcemanager.newrelicobservability.models.SendingLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendingMetricsStatus; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MonitoredResourceListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitoredResourceListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"gf\",\"sendingMetrics\":\"Disabled\",\"reasonForMetricsStatus\":\"ezyiuokktwhrdxw\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"sm\"},{\"id\":\"ureximoryocfs\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"mddystkiiux\",\"sendingLogs\":\"Disabled\",\"reasonForLogsStatus\":\"dxorrqnbpoczv\"},{\"id\":\"fqrvkdvjsllrmvvd\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"kpnpulexxbczwtr\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"zb\"},{\"id\":\"vsovmyokac\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"lhzdobp\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"lb\"}],\"nextLink\":\"nchrkcciww\"}") - .toObject(MonitoredResourceListResponse.class); - Assertions.assertEquals("gf", model.value().get(0).id()); - Assertions.assertEquals(SendingMetricsStatus.DISABLED, model.value().get(0).sendingMetrics()); - Assertions.assertEquals("ezyiuokktwhrdxw", model.value().get(0).reasonForMetricsStatus()); - Assertions.assertEquals(SendingLogsStatus.ENABLED, model.value().get(0).sendingLogs()); - Assertions.assertEquals("sm", model.value().get(0).reasonForLogsStatus()); - Assertions.assertEquals("nchrkcciww", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitoredResourceListResponse model = - new MonitoredResourceListResponse() - .withValue( - Arrays - .asList( - new MonitoredResourceInner() - .withId("gf") - .withSendingMetrics(SendingMetricsStatus.DISABLED) - .withReasonForMetricsStatus("ezyiuokktwhrdxw") - .withSendingLogs(SendingLogsStatus.ENABLED) - .withReasonForLogsStatus("sm"), - new MonitoredResourceInner() - .withId("ureximoryocfs") - .withSendingMetrics(SendingMetricsStatus.ENABLED) - .withReasonForMetricsStatus("mddystkiiux") - .withSendingLogs(SendingLogsStatus.DISABLED) - .withReasonForLogsStatus("dxorrqnbpoczv"), - new MonitoredResourceInner() - .withId("fqrvkdvjsllrmvvd") - .withSendingMetrics(SendingMetricsStatus.ENABLED) - .withReasonForMetricsStatus("kpnpulexxbczwtr") - .withSendingLogs(SendingLogsStatus.ENABLED) - .withReasonForLogsStatus("zb"), - new MonitoredResourceInner() - .withId("vsovmyokac") - .withSendingMetrics(SendingMetricsStatus.ENABLED) - .withReasonForMetricsStatus("lhzdobp") - .withSendingLogs(SendingLogsStatus.ENABLED) - .withReasonForLogsStatus("lb"))) - .withNextLink("nchrkcciww"); - model = BinaryData.fromObject(model).toObject(MonitoredResourceListResponse.class); - Assertions.assertEquals("gf", model.value().get(0).id()); - Assertions.assertEquals(SendingMetricsStatus.DISABLED, model.value().get(0).sendingMetrics()); - Assertions.assertEquals("ezyiuokktwhrdxw", model.value().get(0).reasonForMetricsStatus()); - Assertions.assertEquals(SendingLogsStatus.ENABLED, model.value().get(0).sendingLogs()); - Assertions.assertEquals("sm", model.value().get(0).reasonForLogsStatus()); - Assertions.assertEquals("nchrkcciww", model.nextLink()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java deleted file mode 100644 index e40fbe92d6b6..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; -import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner; -import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; -import com.azure.resourcemanager.newrelicobservability.models.LogRules; -import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.TagAction; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MonitoringTagRulesPropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitoringTagRulesPropertiesInner model = - BinaryData - .fromString( - "{\"provisioningState\":\"Accepted\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"o\",\"value\":\"ukgjnpiucgygevq\",\"action\":\"Exclude\"},{\"name\":\"pmr\",\"value\":\"izcdrqjsd\",\"action\":\"Exclude\"},{\"name\":\"fyhxde\",\"value\":\"jzicwifsjt\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"bkh\",\"value\":\"deyeamdphagalpbu\",\"action\":\"Exclude\"},{\"name\":\"pwhonowkg\",\"value\":\"wankixzbi\",\"action\":\"Exclude\"},{\"name\":\"uttmrywnuzoqft\",\"value\":\"qzrnkcqvyxlwhz\",\"action\":\"Exclude\"}],\"userEmail\":\"ohoqqnwvlryav\"}}") - .toObject(MonitoringTagRulesPropertiesInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("o", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("ukgjnpiucgygevq", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("bkh", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("deyeamdphagalpbu", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ohoqqnwvlryav", model.metricRules().userEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitoringTagRulesPropertiesInner model = - new MonitoringTagRulesPropertiesInner() - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("o") - .withValue("ukgjnpiucgygevq") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("pmr") - .withValue("izcdrqjsd") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("fyhxde") - .withValue("jzicwifsjt") - .withAction(TagAction.EXCLUDE)))) - .withMetricRules( - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.ENABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("bkh") - .withValue("deyeamdphagalpbu") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("pwhonowkg") - .withValue("wankixzbi") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("uttmrywnuzoqft") - .withValue("qzrnkcqvyxlwhz") - .withAction(TagAction.EXCLUDE))) - .withUserEmail("ohoqqnwvlryav")); - model = BinaryData.fromObject(model).toObject(MonitoringTagRulesPropertiesInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("o", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("ukgjnpiucgygevq", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("bkh", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("deyeamdphagalpbu", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ohoqqnwvlryav", model.metricRules().userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateMockTests.java deleted file mode 100644 index e4ccac9f1c67..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import com.azure.resourcemanager.newrelicobservability.models.UserInfo; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"monitoringStatus\":\"Enabled\",\"marketplaceSubscriptionStatus\":\"Suspended\",\"marketplaceSubscriptionId\":\"pswiydmcwyh\",\"newRelicAccountProperties\":{\"userId\":\"ss\"},\"userInfo\":{\"firstName\":\"vdfznudaodvxzb\",\"lastName\":\"blylpstdbh\",\"emailAddress\":\"srzdzucerscdn\",\"phoneNumber\":\"evfiwjmygt\",\"country\":\"slswtm\"},\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"pyqs\",\"effectiveDate\":\"2021-06-06T05:20:48Z\"},\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":792180038,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"a33037ed-f83c-469d-bb38-f80fc867d6a7\",\"tenantId\":\"6a6cba0a-fdd0-492c-9a74-1d473e6092eb\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"vwiwubmwmbesld\",\"tags\":{\"z\":\"wtppjflcxogaoko\",\"fzxmhhvhgureodkw\":\"nsikvmkqzeqqkdl\"},\"id\":\"bdagxt\",\"name\":\"bqdxbx\",\"type\":\"akbogqxndlkzgxh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NewRelicMonitorResource response = - manager - .monitors() - .define("qtdo") - .withRegion("taruoujmkcj") - .withExistingResourceGroup("ivetvtcq") - .withTags( - mapOf("ervnaenqpehi", "ytjrybnwjewgdr", "mifthnzdnd", "doy", "nayqi", "l", "hqlkthumaqo", "ynduha")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("obl")) - .withUserInfo( - new UserInfo() - .withFirstName("pe") - .withLastName("wfbkrvrns") - .withEmailAddress("hqjohxcrsbfova") - .withPhoneNumber("ruvw") - .withCountry("sqfsubcgjbirxb")) - .withPlanData( - new PlanData() - .withUsageType(UsageType.COMMITTED) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("jfdtwssotftpvj") - .withEffectiveDate(OffsetDateTime.parse("2021-04-19T06:05:29Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.LIFTR) - .create(); - - Assertions.assertEquals("vwiwubmwmbesld", response.location()); - Assertions.assertEquals("wtppjflcxogaoko", response.tags().get("z")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("ss", response.newRelicAccountProperties().userId()); - Assertions.assertEquals("vdfznudaodvxzb", response.userInfo().firstName()); - Assertions.assertEquals("blylpstdbh", response.userInfo().lastName()); - Assertions.assertEquals("srzdzucerscdn", response.userInfo().emailAddress()); - Assertions.assertEquals("evfiwjmygt", response.userInfo().phoneNumber()); - Assertions.assertEquals("slswtm", response.userInfo().country()); - Assertions.assertEquals(UsageType.PAYG, response.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, response.planData().billingCycle()); - Assertions.assertEquals("pyqs", response.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-06T05:20:48Z"), response.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, response.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, response.accountCreationSource()); - } - - @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/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java deleted file mode 100644 index 58544416f15e..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.monitors().delete("l", "zbtd", "xujznbmpowu", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 4c4b03835f22..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Creating\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"melmqkrha\",\"newRelicAccountProperties\":{\"userId\":\"juahaquhcdhmdual\"},\"userInfo\":{\"firstName\":\"fadmws\",\"lastName\":\"r\",\"emailAddress\":\"xpvgo\",\"phoneNumber\":\"lf\",\"country\":\"sgwbnbbeld\"},\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"WEEKLY\",\"planDetails\":\"io\",\"effectiveDate\":\"2021-05-06T22:54:03Z\"},\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":391809232,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"94f25019-17d7-4c3a-8bc1-8d1485fe3a2f\",\"tenantId\":\"8f4549ec-b990-4e80-9ce5-b8a9d4ee21e8\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"owzxcu\",\"tags\":{\"ucww\":\"jooxdjebw\",\"bvmeuecivy\":\"vo\",\"ueiotwmcdyt\":\"zceuojgjrw\",\"it\":\"x\"},\"id\":\"nrjawgqwg\",\"name\":\"hniskxfbkpyc\",\"type\":\"klwndnhjdauwhv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NewRelicMonitorResource response = - manager - .monitors() - .getByResourceGroupWithResponse("ehhseyvjusrts", "hspkdeemao", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("owzxcu", response.location()); - Assertions.assertEquals("jooxdjebw", response.tags().get("ucww")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("juahaquhcdhmdual", response.newRelicAccountProperties().userId()); - Assertions.assertEquals("fadmws", response.userInfo().firstName()); - Assertions.assertEquals("r", response.userInfo().lastName()); - Assertions.assertEquals("xpvgo", response.userInfo().emailAddress()); - Assertions.assertEquals("lf", response.userInfo().phoneNumber()); - Assertions.assertEquals("sgwbnbbeld", response.userInfo().country()); - Assertions.assertEquals(UsageType.COMMITTED, response.planData().usageType()); - Assertions.assertEquals(BillingCycle.WEEKLY, response.planData().billingCycle()); - Assertions.assertEquals("io", response.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T22:54:03Z"), response.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, response.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, response.accountCreationSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java deleted file mode 100644 index 9e0c776c5b3b..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.MetricRules; -import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; -import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; -import com.azure.resourcemanager.newrelicobservability.models.TagAction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsGetMetricRulesWithResponseMockTests { - @Test - public void testGetMetricRulesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"bpbewtghfgb\",\"value\":\"gw\",\"action\":\"Exclude\"},{\"name\":\"v\",\"value\":\"jkbegibtnmxiebww\",\"action\":\"Include\"},{\"name\":\"yqcgwrtzjuzgwy\",\"value\":\"htxongmtsavjc\",\"action\":\"Exclude\"},{\"name\":\"qpsrknftguvri\",\"value\":\"prwmdyvxqt\",\"action\":\"Include\"}],\"userEmail\":\"ww\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MetricRules response = - manager - .monitors() - .getMetricRulesWithResponse( - "przqlveu", - "lupj", - new MetricsRequest().withUserEmail("khfxobbcswsrt"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(SendMetricsStatus.DISABLED, response.sendMetrics()); - Assertions.assertEquals("bpbewtghfgb", response.filteringTags().get(0).name()); - Assertions.assertEquals("gw", response.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, response.filteringTags().get(0).action()); - Assertions.assertEquals("ww", response.userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java deleted file mode 100644 index 65526cf5d25b..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; -import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsGetMetricStatusWithResponseMockTests { - @Test - public void testGetMetricStatusWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"azureResourceIds\":[\"vxdjzlmwlxkvugf\",\"zovawjvz\",\"nluthnnp\"]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MetricsStatusResponse response = - manager - .monitors() - .getMetricStatusWithResponse( - "oyq", - "exrmcqibycnojvk", - new MetricsStatusRequest() - .withAzureResourceIds(Arrays.asList("fqsgzvahapjy")) - .withUserEmail("hpvgqz"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vxdjzlmwlxkvugf", response.azureResourceIds().get(0)); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java deleted file mode 100644 index 8fd56d8b4eee..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AppServiceInfo; -import com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsListAppServicesMockTests { - @Test - public void testListAppServices() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"azureResourceId\":\"nsmvbxwyj\",\"agentVersion\":\"lh\",\"agentStatus\":\"aalnjixi\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .monitors() - .listAppServices( - "nxipeil", - "jzuaejxdultskzbb", - new AppServicesGetRequest() - .withAzureResourceIds(Arrays.asList("umveekgpwozuhkf", "bsjyofdx", "uusdttouwa")) - .withUserEmail("oekqvk"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nsmvbxwyj", response.iterator().next().azureResourceId()); - Assertions.assertEquals("lh", response.iterator().next().agentVersion()); - Assertions.assertEquals("aalnjixi", response.iterator().next().agentStatus()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupMockTests.java deleted file mode 100644 index f41b077c0eaf..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Suspended\",\"marketplaceSubscriptionId\":\"pqsxvnmicy\",\"newRelicAccountProperties\":{\"userId\":\"eoveilovnotyf\"},\"userInfo\":{\"firstName\":\"k\",\"lastName\":\"x\",\"emailAddress\":\"bttk\",\"phoneNumber\":\"ywpnvjt\",\"country\":\"nermcl\"},\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"YEARLY\",\"planDetails\":\"uscrpabgyepsb\",\"effectiveDate\":\"2021-01-26T13:24:27Z\"},\"liftrResourceCategory\":\"MonitorLogs\",\"liftrResourcePreference\":2075352957,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"0e016be2-2bd8-410f-9d18-558e9202d2f7\",\"tenantId\":\"16d88632-ea98-4e49-896c-e28b45bcda55\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"wfqkquj\",\"tags\":{\"xtccmg\":\"uyonobglaoc\",\"wfudwpzntxhdzhl\":\"udxytlmoyrx\",\"hckfrlhrx\":\"qj\",\"ca\":\"bkyvp\"},\"id\":\"uzbpzkafku\",\"name\":\"b\",\"type\":\"rnwb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.monitors().listByResourceGroup("cwscwsvlx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wfqkquj", response.iterator().next().location()); - Assertions.assertEquals("uyonobglaoc", response.iterator().next().tags().get("xtccmg")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("eoveilovnotyf", response.iterator().next().newRelicAccountProperties().userId()); - Assertions.assertEquals("k", response.iterator().next().userInfo().firstName()); - Assertions.assertEquals("x", response.iterator().next().userInfo().lastName()); - Assertions.assertEquals("bttk", response.iterator().next().userInfo().emailAddress()); - Assertions.assertEquals("ywpnvjt", response.iterator().next().userInfo().phoneNumber()); - Assertions.assertEquals("nermcl", response.iterator().next().userInfo().country()); - Assertions.assertEquals(UsageType.PAYG, response.iterator().next().planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, response.iterator().next().planData().billingCycle()); - Assertions.assertEquals("uscrpabgyepsb", response.iterator().next().planData().planDetails()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-01-26T13:24:27Z"), response.iterator().next().planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, response.iterator().next().orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, response.iterator().next().accountCreationSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java deleted file mode 100644 index 1ccd536ad56b..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; -import com.azure.resourcemanager.newrelicobservability.models.VMInfo; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsListHostsMockTests { - @Test - public void testListHosts() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{\"vmId\":\"hhuao\",\"agentVersion\":\"pcqeqx\",\"agentStatus\":\"z\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .monitors() - .listHosts( - "gylgqgitxmedjvcs", - "ynqwwncwzzhxgk", - new HostsGetRequest() - .withVmIds(Arrays.asList("gucnapkte", "ellwptfdy")) - .withUserEmail("pfqbuaceopzf"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hhuao", response.iterator().next().vmId()); - Assertions.assertEquals("pcqeqx", response.iterator().next().agentVersion()); - Assertions.assertEquals("z", response.iterator().next().agentStatus()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMockTests.java deleted file mode 100644 index 01f66d7c6df3..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMockTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"niwdjsw\",\"newRelicAccountProperties\":{\"userId\":\"dbpgnxytxhp\"},\"userInfo\":{\"firstName\":\"zabglcuhxwt\",\"lastName\":\"yqiklbbovplwzb\",\"emailAddress\":\"gy\",\"phoneNumber\":\"uosvmkfssxqukk\",\"country\":\"l\"},\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"jzkdeslpvlopwi\",\"effectiveDate\":\"2021-09-12T13:52:28Z\"},\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":1973154307,\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"4e8ba1ef-23ef-477b-9f32-b2e658ef3a60\",\"tenantId\":\"ad135c6f-ebb7-45a1-8f3a-ce2d8ddfbb6e\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"umnyqu\",\"tags\":{\"hsmtxpsiebtfhvp\":\"eojnabc\"},\"id\":\"sapskr\",\"name\":\"qmhjjdhtld\",\"type\":\"kyzxuutk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.monitors().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("umnyqu", response.iterator().next().location()); - Assertions.assertEquals("eojnabc", response.iterator().next().tags().get("hsmtxpsiebtfhvp")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("dbpgnxytxhp", response.iterator().next().newRelicAccountProperties().userId()); - Assertions.assertEquals("zabglcuhxwt", response.iterator().next().userInfo().firstName()); - Assertions.assertEquals("yqiklbbovplwzb", response.iterator().next().userInfo().lastName()); - Assertions.assertEquals("gy", response.iterator().next().userInfo().emailAddress()); - Assertions.assertEquals("uosvmkfssxqukk", response.iterator().next().userInfo().phoneNumber()); - Assertions.assertEquals("l", response.iterator().next().userInfo().country()); - Assertions.assertEquals(UsageType.COMMITTED, response.iterator().next().planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, response.iterator().next().planData().billingCycle()); - Assertions.assertEquals("jzkdeslpvlopwi", response.iterator().next().planData().planDetails()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-09-12T13:52:28Z"), response.iterator().next().planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.LIFTR, response.iterator().next().orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, response.iterator().next().accountCreationSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java deleted file mode 100644 index ad12cf1ac8dd..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.MonitoredResource; -import com.azure.resourcemanager.newrelicobservability.models.SendingLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendingMetricsStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsListMonitoredResourcesMockTests { - @Test - public void testListMonitoredResources() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"grcfb\",\"sendingMetrics\":\"Disabled\",\"reasonForMetricsStatus\":\"fqjhhkxbpvjymj\",\"sendingLogs\":\"Disabled\",\"reasonForLogsStatus\":\"yngudivk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.monitors().listMonitoredResources("ahzxctobgbk", "moizpos", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("grcfb", response.iterator().next().id()); - Assertions.assertEquals(SendingMetricsStatus.DISABLED, response.iterator().next().sendingMetrics()); - Assertions.assertEquals("fqjhhkxbpvjymj", response.iterator().next().reasonForMetricsStatus()); - Assertions.assertEquals(SendingLogsStatus.DISABLED, response.iterator().next().sendingLogs()); - Assertions.assertEquals("yngudivk", response.iterator().next().reasonForLogsStatus()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingWithResponseMockTests.java deleted file mode 100644 index 17feff54f7c1..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsSwitchBillingWithResponseMockTests { - @Test - public void testSwitchBillingWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .monitors() - .switchBillingWithResponse( - "xyawj", - "yaqcslyjpkiidz", - new SwitchBillingRequest() - .withAzureResourceId("xznelixhnrztf") - .withOrganizationId("hb") - .withPlanData( - new PlanData() - .withUsageType(UsageType.COMMITTED) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("ulppggdtpnapnyir") - .withEffectiveDate(OffsetDateTime.parse("2021-02-09T03:01:47Z"))) - .withUserEmail("hpigv"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceInnerTests.java deleted file mode 100644 index 1654a42da2c0..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceInnerTests.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity; -import com.azure.resourcemanager.newrelicobservability.models.UserInfo; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NewRelicMonitorResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NewRelicMonitorResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"ltmrldh\",\"newRelicAccountProperties\":{\"userId\":\"zzd\"},\"userInfo\":{\"firstName\":\"cdgea\",\"lastName\":\"gphuticndvka\",\"emailAddress\":\"wyiftyhxhur\",\"phoneNumber\":\"ftyxolniw\",\"country\":\"cukjf\"},\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"lryplwckbasyy\",\"effectiveDate\":\"2021-05-24T00:31:31Z\"},\"liftrResourceCategory\":\"MonitorLogs\",\"liftrResourcePreference\":1048772360,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"identity\":{\"principalId\":\"96d7edcd-0c52-430f-b2fa-82859d2d3ef7\",\"tenantId\":\"b2670463-2fea-43c1-8eb4-5bbfdd7627f7\",\"type\":\"None\",\"userAssignedIdentities\":{\"nqgoulzndli\":{\"principalId\":\"465c095f-6de6-4b12-b166-ea36812a31df\",\"clientId\":\"e9483262-5c27-4b61-bbeb-696bb4bacdf7\"}}},\"location\":\"yqkgfg\",\"tags\":{\"qedqytbciqfoufl\":\"adgakeqsrxybz\",\"glougpbk\":\"mnkzsmod\",\"uqktap\":\"tmut\",\"kdosvqw\":\"pwgcuertu\"},\"id\":\"bmdg\",\"name\":\"bjf\",\"type\":\"dgmb\"}") - .toObject(NewRelicMonitorResourceInner.class); - Assertions.assertEquals("yqkgfg", model.location()); - Assertions.assertEquals("adgakeqsrxybz", model.tags().get("qedqytbciqfoufl")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("zzd", model.newRelicAccountProperties().userId()); - Assertions.assertEquals("cdgea", model.userInfo().firstName()); - Assertions.assertEquals("gphuticndvka", model.userInfo().lastName()); - Assertions.assertEquals("wyiftyhxhur", model.userInfo().emailAddress()); - Assertions.assertEquals("ftyxolniw", model.userInfo().phoneNumber()); - Assertions.assertEquals("cukjf", model.userInfo().country()); - Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("lryplwckbasyy", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T00:31:31Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NewRelicMonitorResourceInner model = - new NewRelicMonitorResourceInner() - .withLocation("yqkgfg") - .withTags( - mapOf( - "qedqytbciqfoufl", - "adgakeqsrxybz", - "glougpbk", - "mnkzsmod", - "uqktap", - "tmut", - "kdosvqw", - "pwgcuertu")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("nqgoulzndli", new UserAssignedIdentity()))) - .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("zzd")) - .withUserInfo( - new UserInfo() - .withFirstName("cdgea") - .withLastName("gphuticndvka") - .withEmailAddress("wyiftyhxhur") - .withPhoneNumber("ftyxolniw") - .withCountry("cukjf")) - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("lryplwckbasyy") - .withEffectiveDate(OffsetDateTime.parse("2021-05-24T00:31:31Z"))) - .withOrgCreationSource(OrgCreationSource.NEWRELIC) - .withAccountCreationSource(AccountCreationSource.LIFTR); - model = BinaryData.fromObject(model).toObject(NewRelicMonitorResourceInner.class); - Assertions.assertEquals("yqkgfg", model.location()); - Assertions.assertEquals("adgakeqsrxybz", model.tags().get("qedqytbciqfoufl")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("zzd", model.newRelicAccountProperties().userId()); - Assertions.assertEquals("cdgea", model.userInfo().firstName()); - Assertions.assertEquals("gphuticndvka", model.userInfo().lastName()); - Assertions.assertEquals("wyiftyhxhur", model.userInfo().emailAddress()); - Assertions.assertEquals("ftyxolniw", model.userInfo().phoneNumber()); - Assertions.assertEquals("cukjf", model.userInfo().country()); - Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("lryplwckbasyy", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T00:31:31Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); - } - - @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/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceListResultTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceListResultTests.java deleted file mode 100644 index 2c0cc2829031..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceListResultTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceListResult; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NewRelicMonitorResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NewRelicMonitorResourceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"monitoringStatus\":\"Enabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"dio\",\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":2028392349,\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"1b8fcac0-b482-4b73-8719-25248d69c81c\",\"tenantId\":\"917057b0-f8a6-4286-860e-5e0902e1b69d\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"oacctaza\",\"tags\":{\"fdosyg\":\"lahbcryff\"},\"id\":\"xpaojakhmsbz\",\"name\":\"hcrzevd\",\"type\":\"hlxaolthqtr\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Suspended\",\"marketplaceSubscriptionId\":\"s\",\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":1595507269,\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"569d6c49-cbaf-4199-a099-bf5fcc9f90c9\",\"tenantId\":\"7135d2f3-4192-4d96-94b1-1b0c3e2fc42e\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"location\":\"lluwfzitonpeq\",\"tags\":{\"xypininmayhuybbk\":\"kjlxofpdvhpf\",\"vamih\":\"odepoogin\",\"vyevcciqi\":\"ognarxzxtheotus\",\"zrnf\":\"nhungbw\"},\"id\":\"gxg\",\"name\":\"spemvtzfk\",\"type\":\"fublj\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"marketplaceSubscriptionId\":\"aeqjhqjbasvms\",\"liftrResourceCategory\":\"MonitorLogs\",\"liftrResourcePreference\":951964300,\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"},\"identity\":{\"principalId\":\"1b9e35c8-de99-4b89-a4c3-49a4e72d7d0b\",\"tenantId\":\"549cc254-c08c-4bd3-a22b-c0f95928d25a\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"location\":\"wrwclxxwrljd\",\"tags\":{\"dkwt\":\"kcqvkocrc\",\"ssainqpjwnzll\":\"hxbnjbiksqrg\",\"bvmgxsabkyqduuji\":\"fmppe\"},\"id\":\"c\",\"name\":\"czdzev\",\"type\":\"dhkrwpdappdsbdk\"}],\"nextLink\":\"rwjfe\"}") - .toObject(NewRelicMonitorResourceListResult.class); - Assertions.assertEquals("oacctaza", model.value().get(0).location()); - Assertions.assertEquals("lahbcryff", model.value().get(0).tags().get("fdosyg")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.value().get(0).orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.value().get(0).accountCreationSource()); - Assertions.assertEquals("rwjfe", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NewRelicMonitorResourceListResult model = - new NewRelicMonitorResourceListResult() - .withValue( - Arrays - .asList( - new NewRelicMonitorResourceInner() - .withLocation("oacctaza") - .withTags(mapOf("fdosyg", "lahbcryff")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withOrgCreationSource(OrgCreationSource.NEWRELIC) - .withAccountCreationSource(AccountCreationSource.NEWRELIC), - new NewRelicMonitorResourceInner() - .withLocation("lluwfzitonpeq") - .withTags( - mapOf( - "xypininmayhuybbk", - "kjlxofpdvhpf", - "vamih", - "odepoogin", - "vyevcciqi", - "ognarxzxtheotus", - "zrnf", - "nhungbw")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.NEWRELIC), - new NewRelicMonitorResourceInner() - .withLocation("wrwclxxwrljd") - .withTags( - mapOf( - "dkwt", - "kcqvkocrc", - "ssainqpjwnzll", - "hxbnjbiksqrg", - "bvmgxsabkyqduuji", - "fmppe")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.NEWRELIC))) - .withNextLink("rwjfe"); - model = BinaryData.fromObject(model).toObject(NewRelicMonitorResourceListResult.class); - Assertions.assertEquals("oacctaza", model.value().get(0).location()); - Assertions.assertEquals("lahbcryff", model.value().get(0).tags().get("fdosyg")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.value().get(0).orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.value().get(0).accountCreationSource()); - Assertions.assertEquals("rwjfe", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceUpdateTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceUpdateTests.java deleted file mode 100644 index adfc2be33a61..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicMonitorResourceUpdateTests.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; -import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity; -import com.azure.resourcemanager.newrelicobservability.models.UserInfo; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NewRelicMonitorResourceUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NewRelicMonitorResourceUpdate model = - BinaryData - .fromString( - "{\"identity\":{\"principalId\":\"1a229709-966b-4c7f-a10e-e1b83d14b25f\",\"tenantId\":\"e3759aca-c424-4e1f-9ba5-76ed425217ed\",\"type\":\"None\",\"userAssignedIdentities\":{\"ciwqvhk\":{\"principalId\":\"0bea0406-1e3e-48bf-b2c4-a019deba09e0\",\"clientId\":\"93097a20-e541-4d02-a86b-cafbdaf536bd\"},\"uigdtopbobjog\":{\"principalId\":\"3b5ccaab-5fc4-4abb-af0e-98daef31efee\",\"clientId\":\"22926b3c-4f92-4cc1-8428-887eb82abe1d\"}}},\"tags\":{\"a\":\"w\"},\"properties\":{\"newRelicAccountProperties\":{\"userId\":\"rzayv\"},\"userInfo\":{\"firstName\":\"f\",\"lastName\":\"otkftutqxlngx\",\"emailAddress\":\"fgugnxkrxdqmid\",\"phoneNumber\":\"hzrvqd\",\"country\":\"bhj\"},\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"YEARLY\",\"planDetails\":\"qfbow\",\"effectiveDate\":\"2021-05-19T19:15:18Z\"},\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"}}") - .toObject(NewRelicMonitorResourceUpdate.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("w", model.tags().get("a")); - Assertions.assertEquals("rzayv", model.newRelicAccountProperties().userId()); - Assertions.assertEquals("f", model.userInfo().firstName()); - Assertions.assertEquals("otkftutqxlngx", model.userInfo().lastName()); - Assertions.assertEquals("fgugnxkrxdqmid", model.userInfo().emailAddress()); - Assertions.assertEquals("hzrvqd", model.userInfo().phoneNumber()); - Assertions.assertEquals("bhj", model.userInfo().country()); - Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, model.planData().billingCycle()); - Assertions.assertEquals("qfbow", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T19:15:18Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.LIFTR, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.accountCreationSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NewRelicMonitorResourceUpdate model = - new NewRelicMonitorResourceUpdate() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities( - mapOf("ciwqvhk", new UserAssignedIdentity(), "uigdtopbobjog", new UserAssignedIdentity()))) - .withTags(mapOf("a", "w")) - .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("rzayv")) - .withUserInfo( - new UserInfo() - .withFirstName("f") - .withLastName("otkftutqxlngx") - .withEmailAddress("fgugnxkrxdqmid") - .withPhoneNumber("hzrvqd") - .withCountry("bhj")) - .withPlanData( - new PlanData() - .withUsageType(UsageType.COMMITTED) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("qfbow") - .withEffectiveDate(OffsetDateTime.parse("2021-05-19T19:15:18Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.NEWRELIC); - model = BinaryData.fromObject(model).toObject(NewRelicMonitorResourceUpdate.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("w", model.tags().get("a")); - Assertions.assertEquals("rzayv", model.newRelicAccountProperties().userId()); - Assertions.assertEquals("f", model.userInfo().firstName()); - Assertions.assertEquals("otkftutqxlngx", model.userInfo().lastName()); - Assertions.assertEquals("fgugnxkrxdqmid", model.userInfo().emailAddress()); - Assertions.assertEquals("hzrvqd", model.userInfo().phoneNumber()); - Assertions.assertEquals("bhj", model.userInfo().country()); - Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, model.planData().billingCycle()); - Assertions.assertEquals("qfbow", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T19:15:18Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.LIFTR, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.accountCreationSource()); - } - - @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/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java deleted file mode 100644 index 3f64b074eae5..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.NewRelicSingleSignOnProperties; -import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; -import com.azure.resourcemanager.newrelicobservability.models.SingleSignOnStates; -import org.junit.jupiter.api.Assertions; - -public final class NewRelicSingleSignOnPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NewRelicSingleSignOnProperties model = - BinaryData - .fromString( - "{\"singleSignOnState\":\"Initial\",\"enterpriseAppId\":\"itnwuizgazxufi\",\"singleSignOnUrl\":\"ckyfih\",\"provisioningState\":\"NotSpecified\"}") - .toObject(NewRelicSingleSignOnProperties.class); - Assertions.assertEquals(SingleSignOnStates.INITIAL, model.singleSignOnState()); - Assertions.assertEquals("itnwuizgazxufi", model.enterpriseAppId()); - Assertions.assertEquals("ckyfih", model.singleSignOnUrl()); - Assertions.assertEquals(ProvisioningState.NOT_SPECIFIED, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NewRelicSingleSignOnProperties model = - new NewRelicSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL) - .withEnterpriseAppId("itnwuizgazxufi") - .withSingleSignOnUrl("ckyfih") - .withProvisioningState(ProvisioningState.NOT_SPECIFIED); - model = BinaryData.fromObject(model).toObject(NewRelicSingleSignOnProperties.class); - Assertions.assertEquals(SingleSignOnStates.INITIAL, model.singleSignOnState()); - Assertions.assertEquals("itnwuizgazxufi", model.enterpriseAppId()); - Assertions.assertEquals("ckyfih", model.singleSignOnUrl()); - Assertions.assertEquals(ProvisioningState.NOT_SPECIFIED, model.provisioningState()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationDisplayTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationDisplayTests.java deleted file mode 100644 index eb95705cc2d7..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.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/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationInnerTests.java deleted file mode 100644 index 17f43b2e1daa..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.OperationInner; -import com.azure.resourcemanager.newrelicobservability.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/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationListResultTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationListResultTests.java deleted file mode 100644 index 2e507159686a..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.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/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java deleted file mode 100644 index 56422a5cd731..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"uynhijg\",\"isDataAction\":false,\"display\":{\"provider\":\"siarbutrcvpn\",\"resource\":\"zmhjrunmp\",\"operation\":\"tdbhrbnla\",\"description\":\"xmyskp\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .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/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.java deleted file mode 100644 index 63d7fbe57c8a..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.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.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.OrganizationInfo; -import org.junit.jupiter.api.Assertions; - -public final class OrganizationInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OrganizationInfo model = BinaryData.fromString("{\"organizationId\":\"zw\"}").toObject(OrganizationInfo.class); - Assertions.assertEquals("zw", model.organizationId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OrganizationInfo model = new OrganizationInfo().withOrganizationId("zw"); - model = BinaryData.fromObject(model).toObject(OrganizationInfo.class); - Assertions.assertEquals("zw", model.organizationId()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.java deleted file mode 100644 index fd2c0dc1577e..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.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.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationProperties; -import com.azure.resourcemanager.newrelicobservability.models.BillingSource; -import org.junit.jupiter.api.Assertions; - -public final class OrganizationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OrganizationProperties model = - BinaryData - .fromString( - "{\"organizationId\":\"jwzrl\",\"organizationName\":\"mcl\",\"billingSource\":\"NEWRELIC\"}") - .toObject(OrganizationProperties.class); - Assertions.assertEquals("jwzrl", model.organizationId()); - Assertions.assertEquals("mcl", model.organizationName()); - Assertions.assertEquals(BillingSource.NEWRELIC, model.billingSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OrganizationProperties model = - new OrganizationProperties() - .withOrganizationId("jwzrl") - .withOrganizationName("mcl") - .withBillingSource(BillingSource.NEWRELIC); - model = BinaryData.fromObject(model).toObject(OrganizationProperties.class); - Assertions.assertEquals("jwzrl", model.organizationId()); - Assertions.assertEquals("mcl", model.organizationName()); - Assertions.assertEquals(BillingSource.NEWRELIC, model.billingSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.java deleted file mode 100644 index d76476215ebd..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.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.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.BillingSource; -import org.junit.jupiter.api.Assertions; - -public final class OrganizationResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OrganizationResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"organizationId\":\"okaj\",\"organizationName\":\"npime\",\"billingSource\":\"AZURE\"},\"id\":\"xgcp\",\"name\":\"dg\",\"type\":\"aajrm\"}") - .toObject(OrganizationResourceInner.class); - Assertions.assertEquals("okaj", model.organizationId()); - Assertions.assertEquals("npime", model.organizationName()); - Assertions.assertEquals(BillingSource.AZURE, model.billingSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OrganizationResourceInner model = - new OrganizationResourceInner() - .withOrganizationId("okaj") - .withOrganizationName("npime") - .withBillingSource(BillingSource.AZURE); - model = BinaryData.fromObject(model).toObject(OrganizationResourceInner.class); - Assertions.assertEquals("okaj", model.organizationId()); - Assertions.assertEquals("npime", model.organizationName()); - Assertions.assertEquals(BillingSource.AZURE, model.billingSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java deleted file mode 100644 index bc3f06e7f758..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.BillingSource; -import com.azure.resourcemanager.newrelicobservability.models.OrganizationResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OrganizationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"organizationId\":\"mubyynt\",\"organizationName\":\"rbqtkoie\",\"billingSource\":\"AZURE\"},\"id\":\"tgqr\",\"name\":\"ltmuwlauwzizx\",\"type\":\"mpgcjefuzmuvpbt\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.organizations().list("ripl", "podxunkb", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mubyynt", response.iterator().next().organizationId()); - Assertions.assertEquals("rbqtkoie", response.iterator().next().organizationName()); - Assertions.assertEquals(BillingSource.AZURE, response.iterator().next().billingSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java deleted file mode 100644 index 1da9f7158aa0..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.BillingSource; -import com.azure.resourcemanager.newrelicobservability.models.OrganizationsListResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OrganizationsListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OrganizationsListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"organizationId\":\"irsoodqxhcrmnohj\",\"organizationName\":\"kwh\",\"billingSource\":\"NEWRELIC\"},\"id\":\"fiyipjxsqwpgrj\",\"name\":\"znorcj\",\"type\":\"vsnb\"},{\"properties\":{\"organizationId\":\"abnmocpcyshu\",\"organizationName\":\"afbljjgpbtoqcjmk\",\"billingSource\":\"AZURE\"},\"id\":\"bqidtqaj\",\"name\":\"yulpkudjkr\",\"type\":\"khbzhfepgzg\"},{\"properties\":{\"organizationId\":\"zloc\",\"organizationName\":\"c\",\"billingSource\":\"NEWRELIC\"},\"id\":\"rhhbcs\",\"name\":\"l\",\"type\":\"mmajtjaodx\"}],\"nextLink\":\"nbdxk\"}") - .toObject(OrganizationsListResponse.class); - Assertions.assertEquals("irsoodqxhcrmnohj", model.value().get(0).organizationId()); - Assertions.assertEquals("kwh", model.value().get(0).organizationName()); - Assertions.assertEquals(BillingSource.NEWRELIC, model.value().get(0).billingSource()); - Assertions.assertEquals("nbdxk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OrganizationsListResponse model = - new OrganizationsListResponse() - .withValue( - Arrays - .asList( - new OrganizationResourceInner() - .withOrganizationId("irsoodqxhcrmnohj") - .withOrganizationName("kwh") - .withBillingSource(BillingSource.NEWRELIC), - new OrganizationResourceInner() - .withOrganizationId("abnmocpcyshu") - .withOrganizationName("afbljjgpbtoqcjmk") - .withBillingSource(BillingSource.AZURE), - new OrganizationResourceInner() - .withOrganizationId("zloc") - .withOrganizationName("c") - .withBillingSource(BillingSource.NEWRELIC))) - .withNextLink("nbdxk"); - model = BinaryData.fromObject(model).toObject(OrganizationsListResponse.class); - Assertions.assertEquals("irsoodqxhcrmnohj", model.value().get(0).organizationId()); - Assertions.assertEquals("kwh", model.value().get(0).organizationName()); - Assertions.assertEquals(BillingSource.NEWRELIC, model.value().get(0).billingSource()); - Assertions.assertEquals("nbdxk", model.nextLink()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java deleted file mode 100644 index 3c146b86aa76..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanDataListResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PlanDataListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlanDataListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"},\"id\":\"zaqsqsycbkbfk\",\"name\":\"ukdkexxppofmxa\",\"type\":\"c\"}],\"nextLink\":\"pg\"}") - .toObject(PlanDataListResponse.class); - Assertions.assertEquals(OrgCreationSource.LIFTR, model.value().get(0).orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.value().get(0).accountCreationSource()); - Assertions.assertEquals("pg", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlanDataListResponse model = - new PlanDataListResponse() - .withValue( - Arrays - .asList( - new PlanDataResourceInner() - .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.NEWRELIC))) - .withNextLink("pg"); - model = BinaryData.fromObject(model).toObject(PlanDataListResponse.class); - Assertions.assertEquals(OrgCreationSource.LIFTR, model.value().get(0).orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.value().get(0).accountCreationSource()); - Assertions.assertEquals("pg", model.nextLink()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java deleted file mode 100644 index d7d14f72dfc4..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataProperties; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class PlanDataPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlanDataProperties model = - BinaryData - .fromString( - "{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"ddglm\",\"effectiveDate\":\"2020-12-21T16:15:31Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"}") - .toObject(PlanDataProperties.class); - Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("ddglm", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T16:15:31Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.accountCreationSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlanDataProperties model = - new PlanDataProperties() - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("ddglm") - .withEffectiveDate(OffsetDateTime.parse("2020-12-21T16:15:31Z"))) - .withOrgCreationSource(OrgCreationSource.NEWRELIC) - .withAccountCreationSource(AccountCreationSource.NEWRELIC); - model = BinaryData.fromObject(model).toObject(PlanDataProperties.class); - Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("ddglm", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T16:15:31Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.accountCreationSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java deleted file mode 100644 index d3fa0b968230..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class PlanDataResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlanDataResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"YEARLY\",\"planDetails\":\"hvpmoue\",\"effectiveDate\":\"2021-06-30T20:07:19Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"eojnxqbzvddn\",\"name\":\"wndeicbtwnp\",\"type\":\"aoqvuh\"}") - .toObject(PlanDataResourceInner.class); - Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, model.planData().billingCycle()); - Assertions.assertEquals("hvpmoue", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T20:07:19Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlanDataResourceInner model = - new PlanDataResourceInner() - .withPlanData( - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("hvpmoue") - .withEffectiveDate(OffsetDateTime.parse("2021-06-30T20:07:19Z"))) - .withOrgCreationSource(OrgCreationSource.NEWRELIC) - .withAccountCreationSource(AccountCreationSource.LIFTR); - model = BinaryData.fromObject(model).toObject(PlanDataResourceInner.class); - Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.YEARLY, model.planData().billingCycle()); - Assertions.assertEquals("hvpmoue", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T20:07:19Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java deleted file mode 100644 index 69a3e3041b2e..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class PlanDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlanData model = - BinaryData - .fromString( - "{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"mdwzjeiachboo\",\"effectiveDate\":\"2021-07-31T08:54:57Z\"}") - .toObject(PlanData.class); - Assertions.assertEquals(UsageType.PAYG, model.usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.billingCycle()); - Assertions.assertEquals("mdwzjeiachboo", model.planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T08:54:57Z"), model.effectiveDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlanData model = - new PlanData() - .withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("mdwzjeiachboo") - .withEffectiveDate(OffsetDateTime.parse("2021-07-31T08:54:57Z")); - model = BinaryData.fromObject(model).toObject(PlanData.class); - Assertions.assertEquals(UsageType.PAYG, model.usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.billingCycle()); - Assertions.assertEquals("mdwzjeiachboo", model.planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T08:54:57Z"), model.effectiveDate()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java deleted file mode 100644 index 188fbdb5683e..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.PlanDataResource; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PlansListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"hdneuelfph\",\"effectiveDate\":\"2021-11-10T22:29:39Z\"},\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"ikdowwquuvx\",\"name\":\"xclvit\",\"type\":\"hqzonosggbhcoh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.plans().list("d", "morppxebmnzbtbh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(UsageType.COMMITTED, response.iterator().next().planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, response.iterator().next().planData().billingCycle()); - Assertions.assertEquals("hdneuelfph", response.iterator().next().planData().planDetails()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-11-10T22:29:39Z"), response.iterator().next().planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.LIFTR, response.iterator().next().orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, response.iterator().next().accountCreationSource()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java deleted file mode 100644 index 51bfece6cd93..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; -import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; -import com.azure.resourcemanager.newrelicobservability.models.UsageType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class SwitchBillingRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SwitchBillingRequest model = - BinaryData - .fromString( - "{\"azureResourceId\":\"vdcsitynn\",\"organizationId\":\"mdectehfiqscjey\",\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"gqhcjrefovg\",\"effectiveDate\":\"2021-10-26T09:37:04Z\"},\"userEmail\":\"sle\"}") - .toObject(SwitchBillingRequest.class); - Assertions.assertEquals("vdcsitynn", model.azureResourceId()); - Assertions.assertEquals("mdectehfiqscjey", model.organizationId()); - Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("gqhcjrefovg", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T09:37:04Z"), model.planData().effectiveDate()); - Assertions.assertEquals("sle", model.userEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SwitchBillingRequest model = - new SwitchBillingRequest() - .withAzureResourceId("vdcsitynn") - .withOrganizationId("mdectehfiqscjey") - .withPlanData( - new PlanData() - .withUsageType(UsageType.COMMITTED) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("gqhcjrefovg") - .withEffectiveDate(OffsetDateTime.parse("2021-10-26T09:37:04Z"))) - .withUserEmail("sle"); - model = BinaryData.fromObject(model).toObject(SwitchBillingRequest.class); - Assertions.assertEquals("vdcsitynn", model.azureResourceId()); - Assertions.assertEquals("mdectehfiqscjey", model.organizationId()); - Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("gqhcjrefovg", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T09:37:04Z"), model.planData().effectiveDate()); - Assertions.assertEquals("sle", model.userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java deleted file mode 100644 index f446c92709af..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; -import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner; -import com.azure.resourcemanager.newrelicobservability.models.LogRules; -import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TagRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[],\"userEmail\":\"burvjxxjnspy\"}},\"id\":\"tko\",\"name\":\"nkoukn\",\"type\":\"udwtiukbl\"}") - .toObject(TagRuleInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("burvjxxjnspy", model.metricRules().userEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagRuleInner model = - new TagRuleInner() - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags(Arrays.asList())) - .withMetricRules( - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.ENABLED) - .withFilteringTags(Arrays.asList()) - .withUserEmail("burvjxxjnspy")); - model = BinaryData.fromObject(model).toObject(TagRuleInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("burvjxxjnspy", model.metricRules().userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java deleted file mode 100644 index 82b1370b03de..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner; -import com.azure.resourcemanager.newrelicobservability.models.TagRuleListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TagRuleListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagRuleListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"dyjrrfbyaosv\",\"name\":\"xc\",\"type\":\"onpc\"},{\"properties\":{\"provisioningState\":\"Accepted\"},\"id\":\"slkevle\",\"name\":\"gz\",\"type\":\"buhfmvfaxkffeiit\"}],\"nextLink\":\"vmezy\"}") - .toObject(TagRuleListResult.class); - Assertions.assertEquals("vmezy", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagRuleListResult model = - new TagRuleListResult() - .withValue(Arrays.asList(new TagRuleInner(), new TagRuleInner())) - .withNextLink("vmezy"); - model = BinaryData.fromObject(model).toObject(TagRuleListResult.class); - Assertions.assertEquals("vmezy", model.nextLink()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java deleted file mode 100644 index 9009dbb1fc46..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; -import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdateInner; -import com.azure.resourcemanager.newrelicobservability.models.LogRules; -import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TagRuleUpdateInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagRuleUpdateInner model = - BinaryData - .fromString( - "{\"properties\":{\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[],\"userEmail\":\"xfvjrbirp\"}}}") - .toObject(TagRuleUpdateInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("xfvjrbirp", model.metricRules().userEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagRuleUpdateInner model = - new TagRuleUpdateInner() - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags(Arrays.asList())) - .withMetricRules( - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags(Arrays.asList()) - .withUserEmail("xfvjrbirp")); - model = BinaryData.fromObject(model).toObject(TagRuleUpdateInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("xfvjrbirp", model.metricRules().userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java deleted file mode 100644 index 6b4858324a0b..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; -import com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdatePropertiesInner; -import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; -import com.azure.resourcemanager.newrelicobservability.models.LogRules; -import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.TagAction; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TagRuleUpdatePropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagRuleUpdatePropertiesInner model = - BinaryData - .fromString( - "{\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"ljkyqxjvuuj\",\"value\":\"idokgjlj\",\"action\":\"Include\"},{\"name\":\"vcltbgsncgh\",\"value\":\"esz\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"vgxbfs\",\"value\":\"nehmpvecx\",\"action\":\"Exclude\"},{\"name\":\"bfqkkr\",\"value\":\"pukgriwflzlfb\",\"action\":\"Include\"},{\"name\":\"zycispn\",\"value\":\"ahmgkbrp\",\"action\":\"Include\"}],\"userEmail\":\"ibnuqqkpik\"}}") - .toObject(TagRuleUpdatePropertiesInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("ljkyqxjvuuj", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("idokgjlj", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("vgxbfs", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("nehmpvecx", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ibnuqqkpik", model.metricRules().userEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagRuleUpdatePropertiesInner model = - new TagRuleUpdatePropertiesInner() - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("ljkyqxjvuuj") - .withValue("idokgjlj") - .withAction(TagAction.INCLUDE), - new FilteringTag() - .withName("vcltbgsncgh") - .withValue("esz") - .withAction(TagAction.EXCLUDE)))) - .withMetricRules( - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("vgxbfs") - .withValue("nehmpvecx") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("bfqkkr") - .withValue("pukgriwflzlfb") - .withAction(TagAction.INCLUDE), - new FilteringTag() - .withName("zycispn") - .withValue("ahmgkbrp") - .withAction(TagAction.INCLUDE))) - .withUserEmail("ibnuqqkpik")); - model = BinaryData.fromObject(model).toObject(TagRuleUpdatePropertiesInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("ljkyqxjvuuj", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("idokgjlj", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("vgxbfs", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("nehmpvecx", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ibnuqqkpik", model.metricRules().userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java deleted file mode 100644 index 2aa11b823552..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; -import com.azure.resourcemanager.newrelicobservability.models.LogRules; -import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.TagRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TagRulesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[],\"userEmail\":\"qrhzoymibmrqyib\"}},\"id\":\"wfluszdt\",\"name\":\"hrkwo\",\"type\":\"yyv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - TagRule response = - manager - .tagRules() - .define("ksmond") - .withExistingMonitor("ouyftaakc", "wiyzvqtmnubexkp") - .withLogRules( - new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags(Arrays.asList())) - .withMetricRules( - new MetricRulesInner() - .withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags(Arrays.asList()) - .withUserEmail("hojvpajqgxysmocm")) - .create(); - - Assertions.assertEquals(SendAadLogsStatus.ENABLED, response.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, response.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.ENABLED, response.logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, response.metricRules().sendMetrics()); - Assertions.assertEquals("qrhzoymibmrqyib", response.metricRules().userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java deleted file mode 100644 index 6d01ebe7e3e7..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TagRulesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.tagRules().delete("zl", "mbmpaxmodfvuefy", "sbpfvmwyhr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java deleted file mode 100644 index a6c4b6145318..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.TagRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TagRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Creating\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[],\"userEmail\":\"utwu\"}},\"id\":\"grpkhjwniyqs\",\"name\":\"uicpd\",\"type\":\"gk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - TagRule response = - manager - .tagRules() - .getWithResponse("dcvd", "hvoodsotbobzd", "pcjwv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(SendAadLogsStatus.DISABLED, response.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, response.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, response.logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, response.metricRules().sendMetrics()); - Assertions.assertEquals("utwu", response.metricRules().userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java deleted file mode 100644 index b01cb9514022..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; -import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; -import com.azure.resourcemanager.newrelicobservability.models.TagRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TagRulesListByNewRelicMonitorResourceMockTests { - @Test - public void testListByNewRelicMonitorResource() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[],\"userEmail\":\"fuflrwdmhdlx\"}},\"id\":\"rxsagafcnihgwqa\",\"name\":\"nedgfbc\",\"type\":\"kcvqvpke\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NewRelicObservabilityManager manager = - NewRelicObservabilityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .tagRules() - .listByNewRelicMonitorResource("wdsjnkalju", "iiswacffgdkzze", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(SendAadLogsStatus.DISABLED, response.iterator().next().logRules().sendAadLogs()); - Assertions - .assertEquals( - SendSubscriptionLogsStatus.DISABLED, response.iterator().next().logRules().sendSubscriptionLogs()); - Assertions - .assertEquals(SendActivityLogsStatus.DISABLED, response.iterator().next().logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, response.iterator().next().metricRules().sendMetrics()); - Assertions.assertEquals("fuflrwdmhdlx", response.iterator().next().metricRules().userEmail()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java deleted file mode 100644 index e25eada855f9..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"0788ae95-8898-400e-843e-d9d894d9190d\",\"clientId\":\"2ffb5be1-8a16-4713-9491-5b5fc922e623\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java deleted file mode 100644 index 616acfe584a5..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.UserInfo; -import org.junit.jupiter.api.Assertions; - -public final class UserInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserInfo model = - BinaryData - .fromString( - "{\"firstName\":\"fvzwdzuhty\",\"lastName\":\"isdkfthwxmnteiw\",\"emailAddress\":\"pvkmijcmmxdcuf\",\"phoneNumber\":\"srp\",\"country\":\"zidnsezcxtbzsgfy\"}") - .toObject(UserInfo.class); - Assertions.assertEquals("fvzwdzuhty", model.firstName()); - Assertions.assertEquals("isdkfthwxmnteiw", model.lastName()); - Assertions.assertEquals("pvkmijcmmxdcuf", model.emailAddress()); - Assertions.assertEquals("srp", model.phoneNumber()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.country()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserInfo model = - new UserInfo() - .withFirstName("fvzwdzuhty") - .withLastName("isdkfthwxmnteiw") - .withEmailAddress("pvkmijcmmxdcuf") - .withPhoneNumber("srp") - .withCountry("zidnsezcxtbzsgfy"); - model = BinaryData.fromObject(model).toObject(UserInfo.class); - Assertions.assertEquals("fvzwdzuhty", model.firstName()); - Assertions.assertEquals("isdkfthwxmnteiw", model.lastName()); - Assertions.assertEquals("pvkmijcmmxdcuf", model.emailAddress()); - Assertions.assertEquals("srp", model.phoneNumber()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.country()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.java deleted file mode 100644 index c3077072d312..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.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.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.VMInfoInner; -import com.azure.resourcemanager.newrelicobservability.models.VMHostsListResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VMHostsListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VMHostsListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"vmId\":\"ounqecano\",\"agentVersion\":\"upfh\",\"agentStatus\":\"ltrpmopj\"}],\"nextLink\":\"matuok\"}") - .toObject(VMHostsListResponse.class); - Assertions.assertEquals("ounqecano", model.value().get(0).vmId()); - Assertions.assertEquals("upfh", model.value().get(0).agentVersion()); - Assertions.assertEquals("ltrpmopj", model.value().get(0).agentStatus()); - Assertions.assertEquals("matuok", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VMHostsListResponse model = - new VMHostsListResponse() - .withValue( - Arrays - .asList( - new VMInfoInner() - .withVmId("ounqecano") - .withAgentVersion("upfh") - .withAgentStatus("ltrpmopj"))) - .withNextLink("matuok"); - model = BinaryData.fromObject(model).toObject(VMHostsListResponse.class); - Assertions.assertEquals("ounqecano", model.value().get(0).vmId()); - Assertions.assertEquals("upfh", model.value().get(0).agentVersion()); - Assertions.assertEquals("ltrpmopj", model.value().get(0).agentStatus()); - Assertions.assertEquals("matuok", model.nextLink()); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.java deleted file mode 100644 index 8679fe629885..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.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.newrelicobservability.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.fluent.models.VMInfoInner; -import org.junit.jupiter.api.Assertions; - -public final class VMInfoInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VMInfoInner model = - BinaryData - .fromString("{\"vmId\":\"fu\",\"agentVersion\":\"aodsfcpkv\",\"agentStatus\":\"dpuozmyz\"}") - .toObject(VMInfoInner.class); - Assertions.assertEquals("fu", model.vmId()); - Assertions.assertEquals("aodsfcpkv", model.agentVersion()); - Assertions.assertEquals("dpuozmyz", model.agentStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VMInfoInner model = new VMInfoInner().withVmId("fu").withAgentVersion("aodsfcpkv").withAgentStatus("dpuozmyz"); - model = BinaryData.fromObject(model).toObject(VMInfoInner.class); - Assertions.assertEquals("fu", model.vmId()); - Assertions.assertEquals("aodsfcpkv", model.agentVersion()); - Assertions.assertEquals("dpuozmyz", model.agentStatus()); - } -}