From 0a9e44c051e38e51ed540106ce6ec95df784139e Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 11 Oct 2024 21:12:24 +0800 Subject: [PATCH 1/2] mgmt, mongocluster, update commit ID after 0.61 --- .../azure-resourcemanager-mongocluster/README.md | 15 +++++---------- .../azure-resourcemanager-mongocluster/pom.xml | 16 +++------------- .../tsp-location.yaml | 2 +- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/README.md b/sdk/mongocluster/azure-resourcemanager-mongocluster/README.md index 59a479acc7624..1190015dc8375 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/README.md +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/README.md @@ -77,17 +77,12 @@ mongoCluster = mongoClusterManager.mongoClusters() .withExistingResourceGroup(resourceGroupName) .withProperties( new MongoClusterProperties() - .withAdministratorLogin(loginUser) - .withAdministratorLoginPassword(loginPwd) + .withAdministrator(new AdministratorProperties().withUserName(loginUser).withPassword(loginPwd)) .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withNodeGroupSpecs(Arrays.asList( - new NodeGroupSpec() - .withKind(NodeKind.SHARD) - .withSku("M30") - .withDiskSizeGB(128L) - .withEnableHa(true) - .withNodeCount(1) - )) + .withStorage(new StorageProperties().withSizeGb(128L)) + .withCompute(new ComputeProperties().withTier("M30")) + .withHighAvailability(new HighAvailabilityProperties().withTargetMode(HighAvailabilityMode.DISABLED)) + .withSharding(new ShardingProperties().withShardCount(1)) .withServerVersion("7.0") ) .create(); diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/pom.xml b/sdk/mongocluster/azure-resourcemanager-mongocluster/pom.xml index ef56b2f5b0a61..b3b1298b24fc1 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/pom.xml +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -46,13 +46,9 @@ 0 0 true + false - - com.azure - azure-json - 1.3.0 - com.azure azure-core @@ -68,12 +64,6 @@ azure-core-test 1.27.0-beta.2 test - - - com.azure - azure-core-http-jdk-httpclient - - com.azure diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/tsp-location.yaml b/sdk/mongocluster/azure-resourcemanager-mongocluster/tsp-location.yaml index ff819c5df3ba4..ee73a0cd70d3a 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/tsp-location.yaml +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/mongocluster/DocumentDB.MongoCluster.Management -commit: 2cec543b4bf04ccd1971ae69a136cf06878439b2 +commit: 07bdede4651ce2ea0e4039d76e81a69df23a3d6e repo: Azure/azure-rest-api-specs additionalDirectories: From 65d48708d211f387c3cd2dad21411bf763b3e231 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 11 Oct 2024 23:52:58 +0800 Subject: [PATCH 2/2] format --- .../MongoClusterManagerTests.java | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/test/java/com/azure/resourcemanager/mongocluster/MongoClusterManagerTests.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/test/java/com/azure/resourcemanager/mongocluster/MongoClusterManagerTests.java index 731504bf30247..d5b883eaab82c 100644 --- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/test/java/com/azure/resourcemanager/mongocluster/MongoClusterManagerTests.java +++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/test/java/com/azure/resourcemanager/mongocluster/MongoClusterManagerTests.java @@ -43,13 +43,11 @@ public void beforeTest() { final TokenCredential credential = new AzurePowerShellCredentialBuilder().build(); final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); - mongoClusterManager = MongoClusterManager - .configure() + mongoClusterManager = MongoClusterManager.configure() .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile); - resourceManager = ResourceManager - .configure() + resourceManager = ResourceManager.configure() .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile) .withDefaultSubscription(); @@ -60,10 +58,7 @@ public void beforeTest() { if (testEnv) { resourceGroupName = testResourceGroup; } else { - resourceManager.resourceGroups() - .define(resourceGroupName) - .withRegion(REGION) - .create(); + resourceManager.resourceGroups().define(resourceGroupName).withRegion(REGION).create(); } } @@ -87,22 +82,23 @@ public void testCreateMongoCluster() { .define(clusterName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) - .withProperties( - new MongoClusterProperties() - .withAdministrator(new AdministratorProperties().withUserName(loginUser).withPassword(loginPwd)) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withStorage(new StorageProperties().withSizeGb(128L)) - .withCompute(new ComputeProperties().withTier("M30")) - .withHighAvailability(new HighAvailabilityProperties().withTargetMode(HighAvailabilityMode.DISABLED)) - .withSharding(new ShardingProperties().withShardCount(1)) - .withServerVersion("7.0") - ) + .withProperties(new MongoClusterProperties() + .withAdministrator(new AdministratorProperties().withUserName(loginUser).withPassword(loginPwd)) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withStorage(new StorageProperties().withSizeGb(128L)) + .withCompute(new ComputeProperties().withTier("M30")) + .withHighAvailability( + new HighAvailabilityProperties().withTargetMode(HighAvailabilityMode.DISABLED)) + .withSharding(new ShardingProperties().withShardCount(1)) + .withServerVersion("7.0")) .create(); // @embedmeEnd mongoCluster.refresh(); Assertions.assertEquals(clusterName, mongoCluster.name()); - Assertions.assertEquals(mongoCluster.name(), mongoClusterManager.mongoClusters().getById(mongoCluster.id()).name()); - Assertions.assertTrue(mongoClusterManager.mongoClusters().listByResourceGroup(resourceGroupName).stream().count() > 0); + Assertions.assertEquals(mongoCluster.name(), + mongoClusterManager.mongoClusters().getById(mongoCluster.id()).name()); + Assertions.assertTrue( + mongoClusterManager.mongoClusters().listByResourceGroup(resourceGroupName).stream().count() > 0); } finally { if (mongoCluster != null) { mongoClusterManager.mongoClusters().deleteById(mongoCluster.id());