From 13e33961bc3b3ff0acc3665390d028a4fca38585 Mon Sep 17 00:00:00 2001 From: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:09:36 +0800 Subject: [PATCH] fix (#2953) --- fluent-tests/Initialize-Tests.ps1 | 3 +++ .../test/java/com/azure/mgmttest/CompilationTests.java | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/fluent-tests/Initialize-Tests.ps1 b/fluent-tests/Initialize-Tests.ps1 index 61142e704b..26b344aea1 100644 --- a/fluent-tests/Initialize-Tests.ps1 +++ b/fluent-tests/Initialize-Tests.ps1 @@ -114,6 +114,9 @@ $job = @( # resource with writable name "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/2548fe40102c9b5aa27a75a126c8367f55cb9e7d/specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/FirewallRules.json --java.namespace=com.azure.mgmttest.resourcewithwritablename" + # non-string expandable enum + "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --regenerate-pom=false --input-file=https://github.com/Azure/azure-rest-api-specs/blob/926540515b9d8059904f023d38c45dda8ba87c9f/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-12-01/scheduledQueryRule_API.json --java.namespace=com.azure.mgmttest.nonstringexpandableenum" + # fluent lite "--version=$AUTOREST_CORE_VERSION $FLUENTLITE_ARGUMENTS --pom-file=pom_generated_resources.xml https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/resources/resource-manager/readme.md --tag=package-resources-2021-01 --java.namespace=com.azure.mgmtlitetest.resources", "--version=$AUTOREST_CORE_VERSION $FLUENTLITE_ARGUMENTS --regenerate-pom=false https://raw.githubusercontent.com/Azure/azure-rest-api-specs/da0cfefaa0e6c237e1e3819f1cb2e11d7606878d/specification/storage/resource-manager/readme.md --tag=package-2021-01 --java.namespace=com.azure.mgmtlitetest.storage", diff --git a/fluent-tests/src/test/java/com/azure/mgmttest/CompilationTests.java b/fluent-tests/src/test/java/com/azure/mgmttest/CompilationTests.java index 6ae67a5258..7db3be1e04 100644 --- a/fluent-tests/src/test/java/com/azure/mgmttest/CompilationTests.java +++ b/fluent-tests/src/test/java/com/azure/mgmttest/CompilationTests.java @@ -26,6 +26,8 @@ import com.azure.mgmttest.network.fluent.models.NetworkInterfaceInner; import com.azure.mgmttest.network.fluent.models.NetworkSecurityGroupInner; import com.azure.mgmttest.networkwatcher.fluent.models.PacketCaptureResultInner; +import com.azure.mgmttest.nonstringexpandableenum.fluent.models.ScheduledQueryRuleProperties; +import com.azure.mgmttest.nonstringexpandableenum.models.AlertSeverity; import com.azure.mgmttest.postgresqlhsc.fluent.models.ServerConfigurationInner; import com.azure.mgmttest.resources.fluent.DeploymentsClient; import com.azure.mgmttest.resources.fluent.models.DeploymentExtendedInner; @@ -38,6 +40,8 @@ import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.io.IOException; + import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.anyString; @@ -175,4 +179,9 @@ public void testSchemaCleanup() { public void testResourceWithWritableName() { FirewallRuleInner firewallRuleInner = new FirewallRuleInner(); } + + public void testNonStringExpandableEnum() throws IOException { + ScheduledQueryRuleProperties properties = new ScheduledQueryRuleProperties(); + String jsonString = properties.toJsonString(); + } }