diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md index 579af662cfc5c..d0c87a646199a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.0-beta.1 (2023-05-11) + +- Azure Resource Manager PostgreSql client library for Java. This package contains Microsoft Azure SDK for PostgreSql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2022-12-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + ## 1.0.0-beta.6 (2023-04-18) - Azure Resource Manager PostgreSql client library for Java. This package contains Microsoft Azure SDK for PostgreSql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2022-12-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java index db3138bbea50d..4795757193df9 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java @@ -255,7 +255,7 @@ public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile p .append("-") .append("com.azure.resourcemanager.postgresqlflexibleserver") .append("/") - .append("1.0.0-beta.6"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java index 47db10fbfcee9..e95a2df26a436 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; @@ -79,6 +80,12 @@ public final class ServerPropertiesForUpdate { @JsonProperty(value = "replicationRole") private ReplicationRole replicationRole; + /* + * Network properties of a server. + */ + @JsonProperty(value = "network") + private Network network; + /** Creates an instance of ServerPropertiesForUpdate class. */ public ServerPropertiesForUpdate() { } @@ -283,6 +290,26 @@ public ServerPropertiesForUpdate withReplicationRole(ReplicationRole replication return this; } + /** + * Get the network property: Network properties of a server. + * + * @return the network value. + */ + public Network network() { + return this.network; + } + + /** + * Set the network property: Network properties of a server. + * + * @param network the network value to set. + * @return the ServerPropertiesForUpdate object itself. + */ + public ServerPropertiesForUpdate withNetwork(Network network) { + this.network = network; + return this; + } + /** * Validates the instance. * @@ -307,5 +334,8 @@ public void validate() { if (dataEncryption() != null) { dataEncryption().validate(); } + if (network() != null) { + network().validate(); + } } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java index b21887357a17d..97bcdf9b1fe3a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java @@ -383,8 +383,13 @@ public ServerImpl withBackup(Backup backup) { } public ServerImpl withNetwork(Network network) { - this.innerModel().withNetwork(network); - return this; + if (isInCreateMode()) { + this.innerModel().withNetwork(network); + return this; + } else { + this.updateParameters.withNetwork(network); + return this; + } } public ServerImpl withHighAvailability(HighAvailability highAvailability) { diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java index 517285ae4ece4..c9a5ec7f11d8d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java @@ -520,7 +520,8 @@ interface Update UpdateStages.WithAuthConfig, UpdateStages.WithDataEncryption, UpdateStages.WithCreateMode, - UpdateStages.WithReplicationRole { + UpdateStages.WithReplicationRole, + UpdateStages.WithNetwork { /** * Executes the update request. * @@ -668,6 +669,16 @@ interface WithReplicationRole { */ Update withReplicationRole(ReplicationRole replicationRole); } + /** The stage of the Server update allowing to specify network. */ + interface WithNetwork { + /** + * Specifies the network property: Network properties of a server.. + * + * @param network Network properties of a server. + * @return the next definition stage. + */ + Update withNetwork(Network network); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerForUpdate.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerForUpdate.java index 596f50184b8c0..77994df46c7e1 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerForUpdate.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerForUpdate.java @@ -341,6 +341,29 @@ public ServerForUpdate withReplicationRole(ReplicationRole replicationRole) { return this; } + /** + * Get the network property: Network properties of a server. + * + * @return the network value. + */ + public Network network() { + return this.innerProperties() == null ? null : this.innerProperties().network(); + } + + /** + * Set the network property: Network properties of a server. + * + * @param network the network value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withNetwork(Network network) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerPropertiesForUpdate(); + } + this.innerProperties().withNetwork(network); + return this; + } + /** * Validates the instance. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorAddTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorAddTests.java deleted file mode 100644 index f28b1696a5520..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorAddTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministratorAdd; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class ActiveDirectoryAdministratorAddTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ActiveDirectoryAdministratorAdd model = - BinaryData - .fromString( - "{\"properties\":{\"principalType\":\"Unknown\",\"principalName\":\"uv\",\"tenantId\":\"xpyb\"}}") - .toObject(ActiveDirectoryAdministratorAdd.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("uv", model.principalName()); - Assertions.assertEquals("xpyb", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActiveDirectoryAdministratorAdd model = - new ActiveDirectoryAdministratorAdd() - .withPrincipalType(PrincipalType.UNKNOWN) - .withPrincipalName("uv") - .withTenantId("xpyb"); - model = BinaryData.fromObject(model).toObject(ActiveDirectoryAdministratorAdd.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("uv", model.principalName()); - Assertions.assertEquals("xpyb", model.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorInnerTests.java deleted file mode 100644 index f3d63398be3f8..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorInnerTests.java +++ /dev/null @@ -1,40 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ActiveDirectoryAdministratorInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class ActiveDirectoryAdministratorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ActiveDirectoryAdministratorInner model = - BinaryData - .fromString( - "{\"properties\":{\"principalType\":\"Unknown\",\"principalName\":\"msxaobhd\",\"objectId\":\"mtqio\",\"tenantId\":\"zehtbmu\"},\"id\":\"ownoizhw\",\"name\":\"rxybqsoq\",\"type\":\"jgkdmbpazlobcu\"}") - .toObject(ActiveDirectoryAdministratorInner.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("msxaobhd", model.principalName()); - Assertions.assertEquals("mtqio", model.objectId()); - Assertions.assertEquals("zehtbmu", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActiveDirectoryAdministratorInner model = - new ActiveDirectoryAdministratorInner() - .withPrincipalType(PrincipalType.UNKNOWN) - .withPrincipalName("msxaobhd") - .withObjectId("mtqio") - .withTenantId("zehtbmu"); - model = BinaryData.fromObject(model).toObject(ActiveDirectoryAdministratorInner.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("msxaobhd", model.principalName()); - Assertions.assertEquals("mtqio", model.objectId()); - Assertions.assertEquals("zehtbmu", model.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorListResultTests.java deleted file mode 100644 index 4f244da44c62c..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorListResultTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ActiveDirectoryAdministratorInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.AdministratorListResult; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"principalType\":\"User\",\"principalName\":\"xrifkwmrvkts\",\"objectId\":\"nt\",\"tenantId\":\"ipa\"},\"id\":\"ajpsquc\",\"name\":\"poyfdkfogkn\",\"type\":\"gjofjd\"},{\"properties\":{\"principalType\":\"Unknown\",\"principalName\":\"rd\",\"objectId\":\"pewnw\",\"tenantId\":\"itjz\"},\"id\":\"lusarh\",\"name\":\"ofcqhsm\",\"type\":\"urkdtmlx\"},{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"k\",\"objectId\":\"txukcdmp\",\"tenantId\":\"cryuan\"},\"id\":\"uxzdxtay\",\"name\":\"lhmwhfpmrqobm\",\"type\":\"u\"},{\"properties\":{\"principalType\":\"User\",\"principalName\":\"yrtih\",\"objectId\":\"tijbpzvgnwzsymgl\",\"tenantId\":\"fcyzkohdbihanufh\"},\"id\":\"bj\",\"name\":\"s\",\"type\":\"git\"}],\"nextLink\":\"qhabifpikxwcz\"}") - .toObject(AdministratorListResult.class); - Assertions.assertEquals(PrincipalType.USER, model.value().get(0).principalType()); - Assertions.assertEquals("xrifkwmrvkts", model.value().get(0).principalName()); - Assertions.assertEquals("nt", model.value().get(0).objectId()); - Assertions.assertEquals("ipa", model.value().get(0).tenantId()); - Assertions.assertEquals("qhabifpikxwcz", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorListResult model = - new AdministratorListResult() - .withValue( - Arrays - .asList( - new ActiveDirectoryAdministratorInner() - .withPrincipalType(PrincipalType.USER) - .withPrincipalName("xrifkwmrvkts") - .withObjectId("nt") - .withTenantId("ipa"), - new ActiveDirectoryAdministratorInner() - .withPrincipalType(PrincipalType.UNKNOWN) - .withPrincipalName("rd") - .withObjectId("pewnw") - .withTenantId("itjz"), - new ActiveDirectoryAdministratorInner() - .withPrincipalType(PrincipalType.GROUP) - .withPrincipalName("k") - .withObjectId("txukcdmp") - .withTenantId("cryuan"), - new ActiveDirectoryAdministratorInner() - .withPrincipalType(PrincipalType.USER) - .withPrincipalName("yrtih") - .withObjectId("tijbpzvgnwzsymgl") - .withTenantId("fcyzkohdbihanufh"))) - .withNextLink("qhabifpikxwcz"); - model = BinaryData.fromObject(model).toObject(AdministratorListResult.class); - Assertions.assertEquals(PrincipalType.USER, model.value().get(0).principalType()); - Assertions.assertEquals("xrifkwmrvkts", model.value().get(0).principalName()); - Assertions.assertEquals("nt", model.value().get(0).objectId()); - Assertions.assertEquals("ipa", model.value().get(0).tenantId()); - Assertions.assertEquals("qhabifpikxwcz", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesForAddTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesForAddTests.java deleted file mode 100644 index 72b2a7ea4da9a..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesForAddTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.AdministratorPropertiesForAdd; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorPropertiesForAddTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorPropertiesForAdd model = - BinaryData - .fromString( - "{\"principalType\":\"Unknown\",\"principalName\":\"hmtzopbsphrup\",\"tenantId\":\"gsybbejhp\"}") - .toObject(AdministratorPropertiesForAdd.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("hmtzopbsphrup", model.principalName()); - Assertions.assertEquals("gsybbejhp", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorPropertiesForAdd model = - new AdministratorPropertiesForAdd() - .withPrincipalType(PrincipalType.UNKNOWN) - .withPrincipalName("hmtzopbsphrup") - .withTenantId("gsybbejhp"); - model = BinaryData.fromObject(model).toObject(AdministratorPropertiesForAdd.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("hmtzopbsphrup", model.principalName()); - Assertions.assertEquals("gsybbejhp", model.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesTests.java deleted file mode 100644 index 06f0731f9a684..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesTests.java +++ /dev/null @@ -1,40 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.AdministratorProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorProperties model = - BinaryData - .fromString( - "{\"principalType\":\"Group\",\"principalName\":\"nrbtcqqjnq\",\"objectId\":\"hqgnufooojywif\",\"tenantId\":\"esaagdfm\"}") - .toObject(AdministratorProperties.class); - Assertions.assertEquals(PrincipalType.GROUP, model.principalType()); - Assertions.assertEquals("nrbtcqqjnq", model.principalName()); - Assertions.assertEquals("hqgnufooojywif", model.objectId()); - Assertions.assertEquals("esaagdfm", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorProperties model = - new AdministratorProperties() - .withPrincipalType(PrincipalType.GROUP) - .withPrincipalName("nrbtcqqjnq") - .withObjectId("hqgnufooojywif") - .withTenantId("esaagdfm"); - model = BinaryData.fromObject(model).toObject(AdministratorProperties.class); - Assertions.assertEquals(PrincipalType.GROUP, model.principalType()); - Assertions.assertEquals("nrbtcqqjnq", model.principalName()); - Assertions.assertEquals("hqgnufooojywif", model.objectId()); - Assertions.assertEquals("esaagdfm", model.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateMockTests.java deleted file mode 100644 index e57c72a6c3978..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -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 AdministratorsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"pe\",\"objectId\":\"wfbkrvrns\",\"tenantId\":\"hqjohxcrsbfova\"},\"id\":\"ruvw\",\"name\":\"hsqfsubcgjbirxbp\",\"type\":\"bsrfbj\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ActiveDirectoryAdministrator response = - manager - .administrators() - .define("qtdo") - .withExistingFlexibleServer("vjfdx", "ivetvtcq") - .withPrincipalType(PrincipalType.USER) - .withPrincipalName("vwvxyslqbhsfx") - .withTenantId("lyt") - .create(); - - Assertions.assertEquals(PrincipalType.GROUP, response.principalType()); - Assertions.assertEquals("pe", response.principalName()); - Assertions.assertEquals("wfbkrvrns", response.objectId()); - Assertions.assertEquals("hqjohxcrsbfova", response.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.java deleted file mode 100644 index c98bc3d4bbec3..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -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 AdministratorsDeleteMockTests { - @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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.administrators().delete("xisxyawjoyaqcsl", "jpkiidzyexznelix", "nr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.java deleted file mode 100644 index 6fdd1a87f9ba8..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -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 AdministratorsGetWithResponseMockTests { - @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\":{\"principalType\":\"ServicePrincipal\",\"principalName\":\"gylgqgitxmedjvcs\",\"objectId\":\"n\",\"tenantId\":\"wncwzzhxgktrmg\"},\"id\":\"napkteoellw\",\"name\":\"tfdygpfqb\",\"type\":\"ac\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ActiveDirectoryAdministrator response = - manager - .administrators() - .getWithResponse("tfolhbnx", "nalaulppg", "dtpnapnyiropuhp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrincipalType.SERVICE_PRINCIPAL, response.principalType()); - Assertions.assertEquals("gylgqgitxmedjvcs", response.principalName()); - Assertions.assertEquals("n", response.objectId()); - Assertions.assertEquals("wncwzzhxgktrmg", response.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.java deleted file mode 100644 index 169404de90aee..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -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 AdministratorsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"ol\",\"objectId\":\"ahzxctobgbk\",\"tenantId\":\"oizpostmgrcfbun\"},\"id\":\"fqjhhkxbpvjymj\",\"name\":\"xxjyngudivkrtsw\",\"type\":\"xqzvszjfa\"}]}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.administrators().listByServer("op", "fqrhhuaopppc", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrincipalType.GROUP, response.iterator().next().principalType()); - Assertions.assertEquals("ol", response.iterator().next().principalName()); - Assertions.assertEquals("ahzxctobgbk", response.iterator().next().objectId()); - Assertions.assertEquals("oizpostmgrcfbun", response.iterator().next().tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.java deleted file mode 100644 index 696a427c228da..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.java +++ /dev/null @@ -1,32 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; -import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoRedundantBackupEnum; -import org.junit.jupiter.api.Assertions; - -public final class BackupTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Backup model = - BinaryData - .fromString( - "{\"backupRetentionDays\":136140206,\"geoRedundantBackup\":\"Disabled\",\"earliestRestoreDate\":\"2021-10-14T11:42:47Z\"}") - .toObject(Backup.class); - Assertions.assertEquals(136140206, model.backupRetentionDays()); - Assertions.assertEquals(GeoRedundantBackupEnum.DISABLED, model.geoRedundantBackup()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Backup model = - new Backup().withBackupRetentionDays(136140206).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED); - model = BinaryData.fromObject(model).toObject(Backup.class); - Assertions.assertEquals(136140206, model.backupRetentionDays()); - Assertions.assertEquals(GeoRedundantBackupEnum.DISABLED, model.geoRedundantBackup()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java deleted file mode 100644 index e3fcdc7f52471..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackup; -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 BackupsGetWithResponseMockTests { - @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\":{\"backupType\":\"Full\",\"completedTime\":\"2021-01-01T17:03:19Z\",\"source\":\"ujmkcjhwqy\"},\"id\":\"r\",\"name\":\"bnw\",\"type\":\"ewgdrjervn\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackup response = - manager - .backups() - .getWithResponse("dtws", "otftpvjzbexilz", "nfqqnvwp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(Origin.FULL, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-01T17:03:19Z"), response.completedTime()); - Assertions.assertEquals("ujmkcjhwqy", response.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java deleted file mode 100644 index 0ee1ad639eebe..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackup; -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 BackupsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"backupType\":\"Full\",\"completedTime\":\"2021-10-24T16:26:16Z\",\"source\":\"ifthnz\"},\"id\":\"dslgnayqigynduh\",\"name\":\"vhqlkthumaqo\",\"type\":\"bgycduiertgccym\"}]}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.backups().listByServer("enq", "eh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(Origin.FULL, response.iterator().next().backupType()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-10-24T16:26:16Z"), response.iterator().next().completedTime()); - Assertions.assertEquals("ifthnz", response.iterator().next().source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilitiesListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilitiesListResultTests.java deleted file mode 100644 index f0cb9cd0ee5c2..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilitiesListResultTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilitiesListResult; - -public final class CapabilitiesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilitiesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"zone\":\"wyahuxinpmqnja\",\"supportedHAMode\":[\"xj\",\"prozvcputegjvwmf\",\"atscmd\",\"pjhulsuuvmkj\"],\"geoBackupSupported\":false,\"zoneRedundantHaSupported\":true,\"zoneRedundantHaAndGeoBackupSupported\":true,\"supportedFlexibleServerEditions\":[],\"supportedHyperscaleNodeEditions\":[],\"fastProvisioningSupported\":true,\"supportedFastProvisioningEditions\":[],\"status\":\"ej\"}],\"nextLink\":\"vwryoqpso\"}") - .toObject(CapabilitiesListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilitiesListResult model = new CapabilitiesListResult(); - model = BinaryData.fromObject(model).toObject(CapabilitiesListResult.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilityPropertiesInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilityPropertiesInnerTests.java deleted file mode 100644 index 5080b63eb2803..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilityPropertiesInnerTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner; - -public final class CapabilityPropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityPropertiesInner model = - BinaryData - .fromString( - "{\"zone\":\"ctazakljlahbcryf\",\"supportedHAMode\":[\"dosyg\",\"xpaojakhmsbz\"],\"geoBackupSupported\":true,\"zoneRedundantHaSupported\":false,\"zoneRedundantHaAndGeoBackupSupported\":true,\"supportedFlexibleServerEditions\":[{\"name\":\"lxaolthqtrgqjbp\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"status\":\"zgvfcjrwz\"},{\"name\":\"xjtfelluwfzit\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"status\":\"pjkjlxofpdv\"}],\"supportedHyperscaleNodeEditions\":[{\"name\":\"xypininmayhuybbk\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"supportedNodeTypes\":[],\"status\":\"inuvamiheogn\"},{\"name\":\"xzxtheo\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"supportedNodeTypes\":[],\"status\":\"cciqihnhungbwjz\"},{\"name\":\"fygxgispemvtzfk\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"supportedNodeTypes\":[],\"status\":\"xqeofjaeqjhqjba\"},{\"name\":\"msmjqulngsntn\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"supportedNodeTypes\":[],\"status\":\"rwclxxwrljdo\"}],\"fastProvisioningSupported\":true,\"supportedFastProvisioningEditions\":[{\"supportedSku\":\"kocrcjdkwtnhx\",\"supportedStorageGb\":5581291117453536479,\"supportedServerVersions\":\"ksqrglssai\"},{\"supportedSku\":\"p\",\"supportedStorageGb\":2424305941403625714,\"supportedServerVersions\":\"ljfmppee\"}],\"status\":\"mgxsab\"}") - .toObject(CapabilityPropertiesInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityPropertiesInner model = new CapabilityPropertiesInner(); - model = BinaryData.fromObject(model).toObject(CapabilityPropertiesInner.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java deleted file mode 100644 index b7c2e0f483593..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NameAvailability; -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 CheckNameAvailabilitiesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"name\":\"c\",\"type\":\"fwdsj\",\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"tiiswacffg\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = - manager - .checkNameAvailabilities() - .executeWithResponse( - new CheckNameAvailabilityRequest().withName("uuvxz").withType("lvithhqzonosgg"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("tiiswacffg", response.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityRequestTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityRequestTests.java deleted file mode 100644 index 09e0e2f5b3872..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityRequestTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model = - BinaryData - .fromString("{\"name\":\"fgugnxkrxdqmid\",\"type\":\"hzrvqd\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("fgugnxkrxdqmid", model.name()); - Assertions.assertEquals("hzrvqd", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityRequest model = - new CheckNameAvailabilityRequest().withName("fgugnxkrxdqmid").withType("hzrvqd"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("fgugnxkrxdqmid", model.name()); - Assertions.assertEquals("hzrvqd", model.type()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityResponseTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityResponseTests.java deleted file mode 100644 index 3eea340ccd50d..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityResponseTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityResponse; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityResponse model = - BinaryData - .fromString("{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"rvynhzgpph\"}") - .toObject(CheckNameAvailabilityResponse.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("rvynhzgpph", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponse model = - new CheckNameAvailabilityResponse() - .withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("rvynhzgpph"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponse.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("rvynhzgpph", model.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java deleted file mode 100644 index 756a81511d3b6..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NameAvailability; -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 CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"name\":\"wdmhdlxyjrxs\",\"type\":\"afcnih\",\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"edgfbcvkcvq\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = - manager - .checkNameAvailabilityWithLocations() - .executeWithResponse( - "k", - new CheckNameAvailabilityRequest().withName("ewkfvhqcrai").withType("pnppfuf"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); - Assertions.assertEquals("edgfbcvkcvq", response.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationForUpdateTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationForUpdateTests.java deleted file mode 100644 index 30e48be0d36c7..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationForUpdateTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigurationForUpdate; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationForUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationForUpdate model = - BinaryData - .fromString( - "{\"properties\":{\"value\":\"onpc\",\"description\":\"ocohslkevleg\",\"defaultValue\":\"fbuhfmvfaxkffe\",\"dataType\":\"Boolean\",\"allowedValues\":\"lvmezyvshxmzsbbz\",\"source\":\"gigr\",\"isDynamicConfig\":true,\"isReadOnly\":false,\"isConfigPendingRestart\":false,\"unit\":\"xjnspy\",\"documentationLink\":\"tko\"}}") - .toObject(ConfigurationForUpdate.class); - Assertions.assertEquals("onpc", model.value()); - Assertions.assertEquals("gigr", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationForUpdate model = new ConfigurationForUpdate().withValue("onpc").withSource("gigr"); - model = BinaryData.fromObject(model).toObject(ConfigurationForUpdate.class); - Assertions.assertEquals("onpc", model.value()); - Assertions.assertEquals("gigr", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationInnerTests.java deleted file mode 100644 index 781abe63ed175..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ConfigurationInner; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationInner model = - BinaryData - .fromString( - "{\"properties\":{\"value\":\"xbezyiuokktwh\",\"description\":\"xw\",\"defaultValue\":\"wqsmbsur\",\"dataType\":\"Enumeration\",\"allowedValues\":\"o\",\"source\":\"ocfs\",\"isDynamicConfig\":false,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"stkiiuxhqyud\",\"documentationLink\":\"rrqnbpoczvyifqrv\"},\"id\":\"vjsllrmvvdfw\",\"name\":\"t\",\"type\":\"pnpulexxbczwtru\"}") - .toObject(ConfigurationInner.class); - Assertions.assertEquals("xbezyiuokktwh", model.value()); - Assertions.assertEquals("ocfs", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationInner model = new ConfigurationInner().withValue("xbezyiuokktwh").withSource("ocfs"); - model = BinaryData.fromObject(model).toObject(ConfigurationInner.class); - Assertions.assertEquals("xbezyiuokktwh", model.value()); - Assertions.assertEquals("ocfs", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationListResultTests.java deleted file mode 100644 index 43b8afe5fe0e0..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationListResultTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigurationListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"value\":\"cocpecfvmmcoofsx\",\"description\":\"evgbmqjq\",\"defaultValue\":\"c\",\"dataType\":\"Integer\",\"allowedValues\":\"vkwlzuvccfwnf\",\"source\":\"acfi\",\"isDynamicConfig\":false,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"qgtz\",\"documentationLink\":\"pnqbqqwxrjfe\"},\"id\":\"lnwsubisn\",\"name\":\"ampmngnz\",\"type\":\"c\"},{\"properties\":{\"value\":\"wooc\",\"description\":\"bonqvpkvlrxnjeas\",\"defaultValue\":\"pheoflokeyy\",\"dataType\":\"Boolean\",\"allowedValues\":\"bdlwtgrhpdjpj\",\"source\":\"asxazjpqyegualhb\",\"isDynamicConfig\":false,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"v\",\"documentationLink\":\"dgwdslfhot\"},\"id\":\"cynpwlbjnp\",\"name\":\"acfta\",\"type\":\"ehxnltyfsop\"},{\"properties\":{\"value\":\"uesnzwdejbavo\",\"description\":\"zdmohctbqvu\",\"defaultValue\":\"xdn\",\"dataType\":\"Boolean\",\"allowedValues\":\"w\",\"source\":\"jjugwdkcglhslaz\",\"isDynamicConfig\":true,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"ixhbkuofqweykhm\",\"documentationLink\":\"evfyexfwhybcib\"},\"id\":\"vdcsitynn\",\"name\":\"amdecte\",\"type\":\"f\"},{\"properties\":{\"value\":\"cj\",\"description\":\"pvhez\",\"defaultValue\":\"gqhcjrefovg\",\"dataType\":\"Boolean\",\"allowedValues\":\"leyyvx\",\"source\":\"jpkcattpng\",\"isDynamicConfig\":true,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"pjhvmdajvnys\",\"documentationLink\":\"nqecanoaeup\"},\"id\":\"yhltrpmopjmcm\",\"name\":\"tuo\",\"type\":\"thfuiuaodsfcpkvx\"}],\"nextLink\":\"puozmyzydag\"}") - .toObject(ConfigurationListResult.class); - Assertions.assertEquals("cocpecfvmmcoofsx", model.value().get(0).value()); - Assertions.assertEquals("acfi", model.value().get(0).source()); - Assertions.assertEquals("puozmyzydag", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationListResult model = - new ConfigurationListResult() - .withValue( - Arrays - .asList( - new ConfigurationInner().withValue("cocpecfvmmcoofsx").withSource("acfi"), - new ConfigurationInner().withValue("wooc").withSource("asxazjpqyegualhb"), - new ConfigurationInner().withValue("uesnzwdejbavo").withSource("jjugwdkcglhslaz"), - new ConfigurationInner().withValue("cj").withSource("jpkcattpng"))) - .withNextLink("puozmyzydag"); - model = BinaryData.fromObject(model).toObject(ConfigurationListResult.class); - Assertions.assertEquals("cocpecfvmmcoofsx", model.value().get(0).value()); - Assertions.assertEquals("acfi", model.value().get(0).source()); - Assertions.assertEquals("puozmyzydag", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationPropertiesTests.java deleted file mode 100644 index 50fb932766dfd..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationPropertiesTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ConfigurationProperties; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationProperties model = - BinaryData - .fromString( - "{\"value\":\"qzbqjvsov\",\"description\":\"okacspk\",\"defaultValue\":\"hzdobpxjmflbvvnc\",\"dataType\":\"Enumeration\",\"allowedValues\":\"ciwwzjuqkhr\",\"source\":\"jiwkuofoskghsau\",\"isDynamicConfig\":true,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"eduugi\",\"documentationLink\":\"jrrfbyaosve\"}") - .toObject(ConfigurationProperties.class); - Assertions.assertEquals("qzbqjvsov", model.value()); - Assertions.assertEquals("jiwkuofoskghsau", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationProperties model = - new ConfigurationProperties().withValue("qzbqjvsov").withSource("jiwkuofoskghsau"); - model = BinaryData.fromObject(model).toObject(ConfigurationProperties.class); - Assertions.assertEquals("qzbqjvsov", model.value()); - Assertions.assertEquals("jiwkuofoskghsau", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index 84bc4a441e540..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -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 ConfigurationsGetWithResponseMockTests { - @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\":{\"value\":\"uxvypomgkopkwh\",\"description\":\"v\",\"defaultValue\":\"jqg\",\"dataType\":\"Numeric\",\"allowedValues\":\"ocmbqfqvmkcxoza\",\"source\":\"helxprglya\",\"isDynamicConfig\":false,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"uejrjxgc\",\"documentationLink\":\"ibrhosxsdqr\"},\"id\":\"o\",\"name\":\"m\",\"type\":\"bmrqyibahwfl\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = - manager - .configurations() - .getWithResponse("iyzvqtmnub", "xkp", "ksmond", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("uxvypomgkopkwh", response.value()); - Assertions.assertEquals("helxprglya", response.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.java deleted file mode 100644 index 24aab3bc215ef..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -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 ConfigurationsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"value\":\"pcjwv\",\"description\":\"dldwmgxc\",\"defaultValue\":\"slpmutwuo\",\"dataType\":\"Numeric\",\"allowedValues\":\"khjwn\",\"source\":\"qsluicp\",\"isDynamicConfig\":false,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"mbmpaxmodfvuefy\",\"documentationLink\":\"bpfvm\"},\"id\":\"hrfou\",\"name\":\"ft\",\"type\":\"akcp\"}]}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.configurations().listByServer("pkeqdcvdrhvoo", "sotbob", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pcjwv", response.iterator().next().value()); - Assertions.assertEquals("qsluicp", response.iterator().next().source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.java deleted file mode 100644 index 591e47b9d0c3e..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -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 ConfigurationsPutMockTests { - @Test - public void testPut() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"value\":\"kpw\",\"description\":\"eqnovvqfovl\",\"defaultValue\":\"ywsuwsy\",\"dataType\":\"Integer\",\"allowedValues\":\"sytgadgvraea\",\"source\":\"e\",\"isDynamicConfig\":false,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"q\",\"documentationLink\":\"ijfqkacewiipfp\"},\"id\":\"ji\",\"name\":\"wwiftohqkvpuv\",\"type\":\"sgplsakn\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = - manager - .configurations() - .define("piexpbtgiw") - .withExistingFlexibleServer("szdtmhrkwof", "yvoqa") - .withValue("enwash") - .withSource("byuqerpqlp") - .create(); - - Assertions.assertEquals("kpw", response.value()); - Assertions.assertEquals("e", response.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseInnerTests.java deleted file mode 100644 index 4382a8364781e..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.DatabaseInner; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseInner model = - BinaryData - .fromString( - "{\"properties\":{\"charset\":\"ou\",\"collation\":\"vudwtiukbldng\"},\"id\":\"ocipazyxoeg\",\"name\":\"kgjn\",\"type\":\"iucgygevqzn\"}") - .toObject(DatabaseInner.class); - Assertions.assertEquals("ou", model.charset()); - Assertions.assertEquals("vudwtiukbldng", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseInner model = new DatabaseInner().withCharset("ou").withCollation("vudwtiukbldng"); - model = BinaryData.fromObject(model).toObject(DatabaseInner.class); - Assertions.assertEquals("ou", model.charset()); - Assertions.assertEquals("vudwtiukbldng", model.collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseListResultTests.java deleted file mode 100644 index acee74c70a411..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseListResultTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.DatabaseInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.DatabaseListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"charset\":\"yhxdeoejzicwi\",\"collation\":\"jttgzf\"},\"id\":\"shcbkhajdeyeamdp\",\"name\":\"agalpbuxwgipwhon\",\"type\":\"wkgshwa\"},{\"properties\":{\"charset\":\"xzbinjeputt\",\"collation\":\"ywnuzoq\"},\"id\":\"iyqzrnk\",\"name\":\"qvyxlwhzlsicoho\",\"type\":\"qnwvlrya\"},{\"properties\":{\"charset\":\"heun\",\"collation\":\"qhgyxzkonocukok\"},\"id\":\"axuconuq\",\"name\":\"zf\",\"type\":\"beypewrmjmw\"},{\"properties\":{\"charset\":\"ektcxsen\",\"collation\":\"lrsf\"},\"id\":\"zpwv\",\"name\":\"qdqgbi\",\"type\":\"ylihkaetckt\"}],\"nextLink\":\"civfsnkymuctq\"}") - .toObject(DatabaseListResult.class); - Assertions.assertEquals("yhxdeoejzicwi", model.value().get(0).charset()); - Assertions.assertEquals("jttgzf", model.value().get(0).collation()); - Assertions.assertEquals("civfsnkymuctq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseListResult model = - new DatabaseListResult() - .withValue( - Arrays - .asList( - new DatabaseInner().withCharset("yhxdeoejzicwi").withCollation("jttgzf"), - new DatabaseInner().withCharset("xzbinjeputt").withCollation("ywnuzoq"), - new DatabaseInner().withCharset("heun").withCollation("qhgyxzkonocukok"), - new DatabaseInner().withCharset("ektcxsen").withCollation("lrsf"))) - .withNextLink("civfsnkymuctq"); - model = BinaryData.fromObject(model).toObject(DatabaseListResult.class); - Assertions.assertEquals("yhxdeoejzicwi", model.value().get(0).charset()); - Assertions.assertEquals("jttgzf", model.value().get(0).collation()); - Assertions.assertEquals("civfsnkymuctq", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasePropertiesTests.java deleted file mode 100644 index 00348a8366eb1..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasePropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.DatabaseProperties; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseProperties model = - BinaryData - .fromString("{\"charset\":\"pmr\",\"collation\":\"izcdrqjsd\"}") - .toObject(DatabaseProperties.class); - Assertions.assertEquals("pmr", model.charset()); - Assertions.assertEquals("izcdrqjsd", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseProperties model = new DatabaseProperties().withCharset("pmr").withCollation("izcdrqjsd"); - model = BinaryData.fromObject(model).toObject(DatabaseProperties.class); - Assertions.assertEquals("pmr", model.charset()); - Assertions.assertEquals("izcdrqjsd", model.collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateMockTests.java deleted file mode 100644 index 99aa304b2d17b..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -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 DatabasesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"charset\":\"v\",\"collation\":\"gpiohgwxrtfudxe\"},\"id\":\"gyqagvrvmnpkuk\",\"name\":\"himdbl\",\"type\":\"gwimfn\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .define("z") - .withExistingFlexibleServer("lla", "melwuipiccjz") - .withCharset("vvcnayr") - .withCollation("rnxxmueed") - .create(); - - Assertions.assertEquals("v", response.charset()); - Assertions.assertEquals("gpiohgwxrtfudxe", response.collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.java deleted file mode 100644 index 2be7205e02321..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -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 DatabasesDeleteMockTests { - @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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.databases().delete("n", "synljphuopxodl", "iyntorzihle", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java deleted file mode 100644 index ad3354a36f1fb..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -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 DatabasesGetWithResponseMockTests { - @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\":{\"charset\":\"uiizynke\",\"collation\":\"atrwyhqmibzyh\"},\"id\":\"tsmypyynpcdp\",\"name\":\"mnzgmwznmabi\",\"type\":\"nsorgjhxbldt\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .getWithResponse("sjswsrms", "yzrpzbchckqqzq", "ox", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("uiizynke", response.charset()); - Assertions.assertEquals("atrwyhqmibzyh", response.collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.java deleted file mode 100644 index 1d57eac3b5903..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -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 DatabasesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"charset\":\"yhgsy\",\"collation\":\"ogjltdtbnnhad\"},\"id\":\"crkvcikhnv\",\"name\":\"amqgxqquezikyw\",\"type\":\"gxk\"}]}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.databases().listByServer("wwrlkdmtncv", "kotl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("yhgsy", response.iterator().next().charset()); - Assertions.assertEquals("ogjltdtbnnhad", response.iterator().next().collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DelegatedSubnetUsageTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DelegatedSubnetUsageTests.java deleted file mode 100644 index a5241768df272..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DelegatedSubnetUsageTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.DelegatedSubnetUsage; - -public final class DelegatedSubnetUsageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DelegatedSubnetUsage model = - BinaryData - .fromString("{\"subnetName\":\"bxwyjsflhhcaa\",\"usage\":8649013059747343935}") - .toObject(DelegatedSubnetUsage.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DelegatedSubnetUsage model = new DelegatedSubnetUsage(); - model = BinaryData.fromObject(model).toObject(DelegatedSubnetUsage.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FastProvisioningEditionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FastProvisioningEditionCapabilityTests.java deleted file mode 100644 index 3af31c3668714..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FastProvisioningEditionCapabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability; - -public final class FastProvisioningEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FastProvisioningEditionCapability model = - BinaryData - .fromString( - "{\"supportedSku\":\"uhrzayvvt\",\"supportedStorageGb\":8189670768631717659,\"supportedServerVersions\":\"giotkftutqxlngx\"}") - .toObject(FastProvisioningEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FastProvisioningEditionCapability model = new FastProvisioningEditionCapability(); - model = BinaryData.fromObject(model).toObject(FastProvisioningEditionCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleInnerTests.java deleted file mode 100644 index a0c3ae7d160f2..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FirewallRuleInner; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"startIpAddress\":\"jf\",\"endIpAddress\":\"ebrjcxe\"},\"id\":\"uwutttxfvjrbi\",\"name\":\"phxepcyvahf\",\"type\":\"ljkyqxjvuuj\"}") - .toObject(FirewallRuleInner.class); - Assertions.assertEquals("jf", model.startIpAddress()); - Assertions.assertEquals("ebrjcxe", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleInner model = new FirewallRuleInner().withStartIpAddress("jf").withEndIpAddress("ebrjcxe"); - model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class); - Assertions.assertEquals("jf", model.startIpAddress()); - Assertions.assertEquals("ebrjcxe", model.endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleListResultTests.java deleted file mode 100644 index b57025fa84e29..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleListResultTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FirewallRuleInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRuleListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRuleListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"startIpAddress\":\"txfvgx\",\"endIpAddress\":\"fsm\"},\"id\":\"eh\",\"name\":\"pvecxgodeb\",\"type\":\"qkkrb\"},{\"properties\":{\"startIpAddress\":\"pukgriwflzlfb\",\"endIpAddress\":\"zpuzycisp\"},\"id\":\"zahmgkbrpyydhibn\",\"name\":\"qqkpikadrg\",\"type\":\"tqagnbuynh\"},{\"properties\":{\"startIpAddress\":\"jggmebfsiarbu\",\"endIpAddress\":\"rcvpnazzmhjrunmp\"},\"id\":\"tdbhrbnla\",\"name\":\"kx\",\"type\":\"yskpbhen\"},{\"properties\":{\"startIpAddress\":\"tkcxywnytnrsy\",\"endIpAddress\":\"lqidyby\"},\"id\":\"zfcl\",\"name\":\"aaxdbabphlwrq\",\"type\":\"fkts\"}],\"nextLink\":\"sucocmnyyazttbtw\"}") - .toObject(FirewallRuleListResult.class); - Assertions.assertEquals("txfvgx", model.value().get(0).startIpAddress()); - Assertions.assertEquals("fsm", model.value().get(0).endIpAddress()); - Assertions.assertEquals("sucocmnyyazttbtw", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleListResult model = - new FirewallRuleListResult() - .withValue( - Arrays - .asList( - new FirewallRuleInner().withStartIpAddress("txfvgx").withEndIpAddress("fsm"), - new FirewallRuleInner().withStartIpAddress("pukgriwflzlfb").withEndIpAddress("zpuzycisp"), - new FirewallRuleInner() - .withStartIpAddress("jggmebfsiarbu") - .withEndIpAddress("rcvpnazzmhjrunmp"), - new FirewallRuleInner().withStartIpAddress("tkcxywnytnrsy").withEndIpAddress("lqidyby"))) - .withNextLink("sucocmnyyazttbtw"); - model = BinaryData.fromObject(model).toObject(FirewallRuleListResult.class); - Assertions.assertEquals("txfvgx", model.value().get(0).startIpAddress()); - Assertions.assertEquals("fsm", model.value().get(0).endIpAddress()); - Assertions.assertEquals("sucocmnyyazttbtw", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulePropertiesTests.java deleted file mode 100644 index b8f13210f7629..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FirewallRuleProperties; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleProperties model = - BinaryData - .fromString("{\"startIpAddress\":\"gidokgjljyoxgvcl\",\"endIpAddress\":\"bgsncghkjeszzhb\"}") - .toObject(FirewallRuleProperties.class); - Assertions.assertEquals("gidokgjljyoxgvcl", model.startIpAddress()); - Assertions.assertEquals("bgsncghkjeszzhb", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleProperties model = - new FirewallRuleProperties().withStartIpAddress("gidokgjljyoxgvcl").withEndIpAddress("bgsncghkjeszzhb"); - model = BinaryData.fromObject(model).toObject(FirewallRuleProperties.class); - Assertions.assertEquals("gidokgjljyoxgvcl", model.startIpAddress()); - Assertions.assertEquals("bgsncghkjeszzhb", model.endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java deleted file mode 100644 index 4179662f32399..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -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 FirewallRulesCreateOrUpdateMockTests { - @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\":{\"startIpAddress\":\"nbyxbaaabjyv\",\"endIpAddress\":\"yffimrzrtuzqogs\"},\"id\":\"nevfdnw\",\"name\":\"wmewzsyy\",\"type\":\"euzsoi\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = - manager - .firewallRules() - .define("duhpk") - .withExistingFlexibleServer("rw", "yc") - .withStartIpAddress("kgymareqnajxqug") - .withEndIpAddress("hky") - .create(); - - Assertions.assertEquals("nbyxbaaabjyv", response.startIpAddress()); - Assertions.assertEquals("yffimrzrtuzqogs", response.endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.java deleted file mode 100644 index 9a623a5e88517..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -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 FirewallRulesDeleteMockTests { - @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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.firewallRules().delete("hfjx", "mszkkfo", "rey", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java deleted file mode 100644 index 654b96ae2a615..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -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 FirewallRulesGetWithResponseMockTests { - @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\":{\"startIpAddress\":\"xbjhwuaanozjosph\",\"endIpAddress\":\"oulpjrv\"},\"id\":\"glrvimjwosytxi\",\"name\":\"cskfcktqumiekk\",\"type\":\"zzikhlyfjhdg\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = - manager - .firewallRules() - .getWithResponse("kzikfjawneaivxwc", "elpcirelsfeaenwa", "fatkld", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xbjhwuaanozjosph", response.startIpAddress()); - Assertions.assertEquals("oulpjrv", response.endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.java deleted file mode 100644 index 4e43d92099c3d..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -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 FirewallRulesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"startIpAddress\":\"eqidbqfatpx\",\"endIpAddress\":\"lr\"},\"id\":\"yjmoadsu\",\"name\":\"arm\",\"type\":\"wdmjsjqbjhhyx\"}]}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.firewallRules().listByServer("gge", "dunyg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("eqidbqfatpx", response.iterator().next().startIpAddress()); - Assertions.assertEquals("lr", response.iterator().next().endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerEditionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerEditionCapabilityTests.java deleted file mode 100644 index b2f0dde53355f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerEditionCapabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability; - -public final class FlexibleServerEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FlexibleServerEditionCapability model = - BinaryData - .fromString( - "{\"name\":\"qduujitcjczdz\",\"supportedStorageEditions\":[{\"name\":\"hkr\",\"supportedStorageMB\":[],\"status\":\"ppdsbdkvwrwj\"},{\"name\":\"usnhutje\",\"supportedStorageMB\":[],\"status\":\"ldhugjzzdatqxh\"}],\"supportedServerVersions\":[{\"name\":\"eablg\",\"supportedVersionsToUpgrade\":[\"ti\",\"ndv\",\"aozwyiftyhxhu\",\"okftyxolniwpwcuk\"],\"supportedVcores\":[],\"status\":\"iawxklry\"},{\"name\":\"wckbasyypnd\",\"supportedVersionsToUpgrade\":[\"gcbacphejkot\",\"nqgoulzndli\"],\"supportedVcores\":[],\"status\":\"kgfg\"},{\"name\":\"madgakeqsrxyb\",\"supportedVersionsToUpgrade\":[\"e\",\"qytbciq\",\"ouf\",\"mmnkzsmodmgl\"],\"supportedVcores\":[],\"status\":\"b\"}],\"status\":\"tmut\"}") - .toObject(FlexibleServerEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FlexibleServerEditionCapability model = new FlexibleServerEditionCapability(); - model = BinaryData.fromObject(model).toObject(FlexibleServerEditionCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java deleted file mode 100644 index 26a3dd202316b..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,65 +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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -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 GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "\"oxciqopidoamcio\""; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - String response = - manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("oxciqopidoamcio", response); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HighAvailabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HighAvailabilityTests.java deleted file mode 100644 index 69c89f5a0e56f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HighAvailabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailabilityMode; -import org.junit.jupiter.api.Assertions; - -public final class HighAvailabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HighAvailability model = - BinaryData - .fromString( - "{\"mode\":\"SameZone\",\"state\":\"FailingOver\",\"standbyAvailabilityZone\":\"xvnmicykvceov\"}") - .toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.SAME_ZONE, model.mode()); - Assertions.assertEquals("xvnmicykvceov", model.standbyAvailabilityZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HighAvailability model = - new HighAvailability() - .withMode(HighAvailabilityMode.SAME_ZONE) - .withStandbyAvailabilityZone("xvnmicykvceov"); - model = BinaryData.fromObject(model).toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.SAME_ZONE, model.mode()); - Assertions.assertEquals("xvnmicykvceov", model.standbyAvailabilityZone()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HyperscaleNodeEditionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HyperscaleNodeEditionCapabilityTests.java deleted file mode 100644 index 293b4bdb5356a..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HyperscaleNodeEditionCapabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.HyperscaleNodeEditionCapability; - -public final class HyperscaleNodeEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HyperscaleNodeEditionCapability model = - BinaryData - .fromString( - "{\"name\":\"nohjt\",\"supportedStorageEditions\":[{\"name\":\"dsoifiyipj\",\"supportedStorageMB\":[],\"status\":\"pgrjbz\"},{\"name\":\"rcjxvsnbyxqabn\",\"supportedStorageMB\":[],\"status\":\"cyshurzafbljjgp\"},{\"name\":\"oq\",\"supportedStorageMB\":[],\"status\":\"ljavbqid\"}],\"supportedServerVersions\":[{\"name\":\"zyulp\",\"supportedVersionsToUpgrade\":[\"jkrlkhbzhfepg\"],\"supportedVcores\":[],\"status\":\"xzlocxscp\"},{\"name\":\"erhhbcsglumm\",\"supportedVersionsToUpgrade\":[\"j\",\"odxobnbdxkqpxok\",\"jionpimexgstxgc\"],\"supportedVcores\":[],\"status\":\"maajrmvdjwzrlo\"}],\"supportedNodeTypes\":[{\"name\":\"whijcoejctbza\",\"nodeType\":\"qsycbkbfkgu\",\"status\":\"kexxppof\"},{\"name\":\"axcfjpgddtocjjx\",\"nodeType\":\"pmouexhdz\",\"status\":\"bqe\"},{\"name\":\"nxqbzvddn\",\"nodeType\":\"ndei\",\"status\":\"twnpzaoqvuhrhcf\"},{\"name\":\"yd\",\"nodeType\":\"lmjthjq\",\"status\":\"pyeicxm\"}],\"status\":\"iwqvhkh\"}") - .toObject(HyperscaleNodeEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HyperscaleNodeEditionCapability model = new HyperscaleNodeEditionCapability(); - model = BinaryData.fromObject(model).toObject(HyperscaleNodeEditionCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteMockTests.java deleted file mode 100644 index 6038010cd7cde..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteMockTests.java +++ /dev/null @@ -1,65 +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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityProperties; -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 LocationBasedCapabilitiesExecuteMockTests { - @Test - public void testExecute() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"zone\":\"qlfmmdnbb\",\"supportedHAMode\":[\"pswiydmcwyh\",\"dxssadbzm\",\"vdfznudaodvxzb\"],\"geoBackupSupported\":true,\"zoneRedundantHaSupported\":true,\"zoneRedundantHaAndGeoBackupSupported\":true,\"supportedFlexibleServerEditions\":[{\"name\":\"bhhxsrzdzuc\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"status\":\"t\"},{\"name\":\"vfiwjmygtdss\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"status\":\"eriofzpyqs\"},{\"name\":\"wab\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"status\":\"szhedplvw\"}],\"supportedHyperscaleNodeEditions\":[{\"name\":\"mwmbes\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"supportedNodeTypes\":[],\"status\":\"pjflcxogao\"},{\"name\":\"nzmnsikvm\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"supportedNodeTypes\":[],\"status\":\"l\"},{\"name\":\"zxmhhvhgu\",\"supportedStorageEditions\":[],\"supportedServerVersions\":[],\"supportedNodeTypes\":[],\"status\":\"dagxtibqd\"}],\"fastProvisioningSupported\":false,\"supportedFastProvisioningEditions\":[{\"supportedSku\":\"bogqxndlkzgxhu\",\"supportedStorageGb\":621942409607693787,\"supportedServerVersions\":\"podxunkb\"},{\"supportedSku\":\"xmubyyntwlrbq\",\"supportedStorageGb\":8060447161666090820,\"supportedServerVersions\":\"vseotgqrl\"},{\"supportedSku\":\"muwlauwzizxbm\",\"supportedStorageGb\":9118429342651119617,\"supportedServerVersions\":\"fuzmuvpbtt\"},{\"supportedSku\":\"morppxebmnzbtbh\",\"supportedStorageGb\":4679929570751619388,\"supportedServerVersions\":\"fgohdneuelfphs\"}],\"status\":\"htozfikdow\"}]}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.locationBasedCapabilities().execute("aolps", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MaintenanceWindowTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MaintenanceWindowTests.java deleted file mode 100644 index e5931b167b9f3..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MaintenanceWindowTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceWindowTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceWindow model = - BinaryData - .fromString( - "{\"customWindow\":\"lo\",\"startHour\":660644635,\"startMinute\":636252983,\"dayOfWeek\":1073138726}") - .toObject(MaintenanceWindow.class); - Assertions.assertEquals("lo", model.customWindow()); - Assertions.assertEquals(660644635, model.startHour()); - Assertions.assertEquals(636252983, model.startMinute()); - Assertions.assertEquals(1073138726, model.dayOfWeek()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceWindow model = - new MaintenanceWindow() - .withCustomWindow("lo") - .withStartHour(660644635) - .withStartMinute(636252983) - .withDayOfWeek(1073138726); - model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); - Assertions.assertEquals("lo", model.customWindow()); - Assertions.assertEquals(660644635, model.startHour()); - Assertions.assertEquals(636252983, model.startMinute()); - Assertions.assertEquals(1073138726, model.dayOfWeek()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.java deleted file mode 100644 index f675715e46ce9..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.NameAvailabilityInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityInner model = - BinaryData - .fromString( - "{\"name\":\"bhj\",\"type\":\"igeho\",\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"kanyktzlcuiywg\"}") - .toObject(NameAvailabilityInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); - Assertions.assertEquals("kanyktzlcuiywg", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityInner model = - new NameAvailabilityInner() - .withNameAvailable(false) - .withReason(CheckNameAvailabilityReason.INVALID) - .withMessage("kanyktzlcuiywg"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); - Assertions.assertEquals("kanyktzlcuiywg", model.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NetworkTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NetworkTests.java deleted file mode 100644 index 860b75defc2cf..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NetworkTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Network model = - BinaryData - .fromString( - "{\"publicNetworkAccess\":\"Enabled\",\"delegatedSubnetResourceId\":\"zxuutkncwscwsvl\",\"privateDnsZoneArmResourceId\":\"togt\"}") - .toObject(Network.class); - Assertions.assertEquals("zxuutkncwscwsvl", model.delegatedSubnetResourceId()); - Assertions.assertEquals("togt", model.privateDnsZoneArmResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Network model = - new Network().withDelegatedSubnetResourceId("zxuutkncwscwsvl").withPrivateDnsZoneArmResourceId("togt"); - model = BinaryData.fromObject(model).toObject(Network.class); - Assertions.assertEquals("zxuutkncwscwsvl", model.delegatedSubnetResourceId()); - Assertions.assertEquals("togt", model.privateDnsZoneArmResourceId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NodeTypeCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NodeTypeCapabilityTests.java deleted file mode 100644 index 16a71de5f8944..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NodeTypeCapabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NodeTypeCapability; - -public final class NodeTypeCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NodeTypeCapability model = - BinaryData - .fromString("{\"name\":\"uigdtopbobjog\",\"nodeType\":\"e\",\"status\":\"a\"}") - .toObject(NodeTypeCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NodeTypeCapability model = new NodeTypeCapability(); - model = BinaryData.fromObject(model).toObject(NodeTypeCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationDisplayTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationDisplayTests.java deleted file mode 100644 index 8336bbe6b195c..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"rvxdjzlmw\",\"resource\":\"kvugfhzovawjvzun\",\"operation\":\"thnnpr\",\"description\":\"i\"}") - .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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationListResultInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationListResultInnerTests.java deleted file mode 100644 index 15153af72b6ec..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationListResultInnerTests.java +++ /dev/null @@ -1,40 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Operation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"rxsbkyvp\",\"display\":{\"provider\":\"n\",\"resource\":\"bpzkafkuwbc\",\"operation\":\"wbme\",\"description\":\"seyvj\"},\"isDataAction\":false,\"origin\":\"system\",\"properties\":{\"aofmxagkvtme\":\"dataspkdee\",\"c\":\"datamqkrhahvljuahaqu\",\"aex\":\"datahmdua\"}},{\"name\":\"vfadmws\",\"display\":{\"provider\":\"gvxp\",\"resource\":\"omzlfmi\",\"operation\":\"wbnb\",\"description\":\"ldawkzbaliourqha\"},\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"gicjooxdjeb\":\"datasfwxosowzxc\",\"ecivyh\":\"datapucwwfvovbvme\",\"ojgjrwjueiotwmc\":\"datace\",\"nrjawgqwg\":\"dataytdxwit\"}},{\"name\":\"ni\",\"display\":{\"provider\":\"fbkp\",\"resource\":\"gklwn\",\"operation\":\"hjdauwhvylwz\",\"description\":\"dhxujznbmpo\"},\"isDataAction\":false,\"origin\":\"system\",\"properties\":{\"alupjm\":\"datalve\",\"iplrbpbewtghfgb\":\"datahfxobbcswsrtj\",\"wxzvlvqhjkb\":\"datac\",\"iebwwaloayqcgwrt\":\"datagibtnm\"}}],\"nextLink\":\"uzgwyzmhtx\"}") - .toObject(OperationListResultInner.class); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("uzgwyzmhtx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResultInner model = - new OperationListResultInner() - .withValue( - Arrays - .asList( - new Operation().withIsDataAction(false), - new Operation().withIsDataAction(true), - new Operation().withIsDataAction(false))) - .withNextLink("uzgwyzmhtx"); - model = BinaryData.fromObject(model).toObject(OperationListResultInner.class); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("uzgwyzmhtx", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationTests.java deleted file mode 100644 index 0d3893d56c42f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Operation; -import org.junit.jupiter.api.Assertions; - -public final class OperationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Operation model = - BinaryData - .fromString( - "{\"name\":\"gmtsavjcbpwxqpsr\",\"display\":{\"provider\":\"tguvriuhp\",\"resource\":\"mdyvxqtayriw\",\"operation\":\"oyq\",\"description\":\"xrmcqibycnojvk\"},\"isDataAction\":false,\"origin\":\"NotSpecified\",\"properties\":{\"hpvgqz\":\"datazvahapjy\"}}") - .toObject(Operation.class); - Assertions.assertEquals(false, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Operation model = new Operation().withIsDataAction(false); - model = BinaryData.fromObject(model).toObject(Operation.class); - Assertions.assertEquals(false, model.isDataAction()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListWithResponseMockTests.java deleted file mode 100644 index 07401133b9a78..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListWithResponseMockTests.java +++ /dev/null @@ -1,68 +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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationListResult; -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 OperationsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"altol\",\"isDataAction\":true,\"origin\":\"system\",\"properties\":{\"pfuvglsbjjca\":\"datawcsdbnwdcfhucq\",\"t\":\"datavxb\",\"mr\":\"dataudutnco\",\"f\":\"dataxqtvcofu\"}},{\"name\":\"kgjubgdknnqvsazn\",\"isDataAction\":false,\"origin\":\"NotSpecified\",\"properties\":{\"uetae\":\"datagsahmkycgrauw\",\"movsmzlxwabmqoe\":\"datauruv\",\"vtpuqujmqlgk\":\"datakif\"}},{\"name\":\"tndoaongbjc\",\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"twwaezkojvdcpzf\":\"dataed\"}}],\"nextLink\":\"ouicybxarzgszu\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationListResult response = - manager.operations().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(true, response.value().get(0).isDataAction()); - Assertions.assertEquals("ouicybxarzgszu", response.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.java deleted file mode 100644 index 826b921f66879..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter; -import org.junit.jupiter.api.Assertions; - -public final class RestartParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RestartParameter model = - BinaryData - .fromString("{\"restartWithFailover\":true,\"failoverMode\":\"PlannedFailover\"}") - .toObject(RestartParameter.class); - Assertions.assertEquals(true, model.restartWithFailover()); - Assertions.assertEquals(FailoverMode.PLANNED_FAILOVER, model.failoverMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RestartParameter model = - new RestartParameter().withRestartWithFailover(true).withFailoverMode(FailoverMode.PLANNED_FAILOVER); - model = BinaryData.fromObject(model).toObject(RestartParameter.class); - Assertions.assertEquals(true, model.restartWithFailover()); - Assertions.assertEquals(FailoverMode.PLANNED_FAILOVER, model.failoverMode()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.java deleted file mode 100644 index 13c031372dd17..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupInner model = - BinaryData - .fromString( - "{\"properties\":{\"backupType\":\"Full\",\"completedTime\":\"2021-02-10T03:30:23Z\",\"source\":\"x\"},\"id\":\"ivyqniwbybrkxvd\",\"name\":\"mjgr\",\"type\":\"fwvuk\"}") - .toObject(ServerBackupInner.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T03:30:23Z"), model.completedTime()); - Assertions.assertEquals("x", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupInner model = - new ServerBackupInner() - .withBackupType(Origin.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-02-10T03:30:23Z")) - .withSource("x"); - model = BinaryData.fromObject(model).toObject(ServerBackupInner.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T03:30:23Z"), model.completedTime()); - Assertions.assertEquals("x", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.java deleted file mode 100644 index bf6bad745cbbe..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackupListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"backupType\":\"Full\",\"completedTime\":\"2021-08-18T11:52:54Z\",\"source\":\"hkryhtn\"},\"id\":\"czwlokjyem\",\"name\":\"kvnipjoxz\",\"type\":\"nchgej\"}],\"nextLink\":\"odmailzyd\"}") - .toObject(ServerBackupListResult.class); - Assertions.assertEquals(Origin.FULL, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T11:52:54Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hkryhtn", model.value().get(0).source()); - Assertions.assertEquals("odmailzyd", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupListResult model = - new ServerBackupListResult() - .withValue( - Arrays - .asList( - new ServerBackupInner() - .withBackupType(Origin.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-08-18T11:52:54Z")) - .withSource("hkryhtn"))) - .withNextLink("odmailzyd"); - model = BinaryData.fromObject(model).toObject(ServerBackupListResult.class); - Assertions.assertEquals(Origin.FULL, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T11:52:54Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hkryhtn", model.value().get(0).source()); - Assertions.assertEquals("odmailzyd", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java deleted file mode 100644 index 7072c8edb8453..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupProperties model = - BinaryData - .fromString("{\"backupType\":\"Full\",\"completedTime\":\"2021-02-24T15:23:22Z\",\"source\":\"cs\"}") - .toObject(ServerBackupProperties.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T15:23:22Z"), model.completedTime()); - Assertions.assertEquals("cs", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupProperties model = - new ServerBackupProperties() - .withBackupType(Origin.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-02-24T15:23:22Z")) - .withSource("cs"); - model = BinaryData.fromObject(model).toObject(ServerBackupProperties.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T15:23:22Z"), model.completedTime()); - Assertions.assertEquals("cs", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerVersionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerVersionCapabilityTests.java deleted file mode 100644 index 74f5805bf4d75..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerVersionCapabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersionCapability; - -public final class ServerVersionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVersionCapability model = - BinaryData - .fromString( - "{\"name\":\"ufizuckyf\",\"supportedVersionsToUpgrade\":[\"fidfvzw\",\"zuhtymwisdkfthwx\",\"nteiwaopv\"],\"supportedVcores\":[{\"name\":\"c\",\"vCores\":4465069614160015486,\"supportedIops\":7874706781697000309,\"supportedMemoryPerVcoreMB\":4484717766489487799,\"status\":\"pymzidnsezcxtbzs\"},{\"name\":\"yc\",\"vCores\":7851183931824744763,\"supportedIops\":4763393061757508617,\"supportedMemoryPerVcoreMB\":190971854068748515,\"status\":\"iachbo\"}],\"status\":\"flnrosfqpteehzz\"}") - .toObject(ServerVersionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVersionCapability model = new ServerVersionCapability(); - model = BinaryData.fromObject(model).toObject(ServerVersionCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteMockTests.java deleted file mode 100644 index 23390304baaea..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -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 ServersDeleteMockTests { - @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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().delete("judpfrxt", "thzvaytdwkqbrqu", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.java deleted file mode 100644 index 36354dbcb7a1f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter; -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 ServersRestartMockTests { - @Test - public void testRestart() 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .servers() - .restart( - "lyls", - "xkqjnsjervt", - new RestartParameter().withRestartWithFailover(false).withFailoverMode(FailoverMode.FORCED_FAILOVER), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java deleted file mode 100644 index edd0a88c33e6d..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -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 ServersStartMockTests { - @Test - public void testStart() 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().start("dszue", "psbzkfzbeyvpn", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.java deleted file mode 100644 index d6dd24d858ab0..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -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 ServersStopMockTests { - @Test - public void testStop() 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().stop("icvi", "v", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/SkuTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/SkuTests.java deleted file mode 100644 index 05493332916cf..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/SkuTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; -import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = - BinaryData.fromString("{\"name\":\"zxbzpfzabglc\",\"tier\":\"GeneralPurpose\"}").toObject(Sku.class); - Assertions.assertEquals("zxbzpfzabglc", model.name()); - Assertions.assertEquals(SkuTier.GENERAL_PURPOSE, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("zxbzpfzabglc").withTier(SkuTier.GENERAL_PURPOSE); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("zxbzpfzabglc", model.name()); - Assertions.assertEquals(SkuTier.GENERAL_PURPOSE, model.tier()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageEditionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageEditionCapabilityTests.java deleted file mode 100644 index a86f1ac7a89d0..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageEditionCapabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageEditionCapability; - -public final class StorageEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageEditionCapability model = - BinaryData - .fromString( - "{\"name\":\"qktapspwgcuert\",\"supportedStorageMB\":[{\"name\":\"o\",\"supportedIops\":1712101311057870325,\"storageSizeMB\":4117897998779209947,\"supportedUpgradableTierList\":[],\"status\":\"bjf\"},{\"name\":\"gmbmbexppbh\",\"supportedIops\":7863810899973495328,\"storageSizeMB\":3040729179005507255,\"supportedUpgradableTierList\":[],\"status\":\"s\"}],\"status\":\"gbquxigj\"}") - .toObject(StorageEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageEditionCapability model = new StorageEditionCapability(); - model = BinaryData.fromObject(model).toObject(StorageEditionCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageMBCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageMBCapabilityTests.java deleted file mode 100644 index d10577f552b57..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageMBCapabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageMBCapability; - -public final class StorageMBCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageMBCapability model = - BinaryData - .fromString( - "{\"name\":\"gzjaoyfhrtxilne\",\"supportedIops\":7928784198213019505,\"storageSizeMB\":186603150154642680,\"supportedUpgradableTierList\":[{\"name\":\"uvfqawrlyxwj\",\"tierName\":\"prbnwbxgjvtbv\",\"iops\":7661305214436261701,\"isBaseline\":true,\"status\":\"rujqg\"}],\"status\":\"muouqfp\"}") - .toObject(StorageMBCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageMBCapability model = new StorageMBCapability(); - model = BinaryData.fromObject(model).toObject(StorageMBCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTests.java deleted file mode 100644 index d9f37e5d3f25e..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; -import org.junit.jupiter.api.Assertions; - -public final class StorageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Storage model = BinaryData.fromString("{\"storageSizeGB\":1146165631}").toObject(Storage.class); - Assertions.assertEquals(1146165631, model.storageSizeGB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Storage model = new Storage().withStorageSizeGB(1146165631); - model = BinaryData.fromObject(model).toObject(Storage.class); - Assertions.assertEquals(1146165631, model.storageSizeGB()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTierCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTierCapabilityTests.java deleted file mode 100644 index 9d13d55b6405f..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTierCapabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageTierCapability; - -public final class StorageTierCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTierCapability model = - BinaryData - .fromString( - "{\"name\":\"zw\",\"tierName\":\"g\",\"iops\":4520848990140400139,\"isBaseline\":false,\"status\":\"zga\"}") - .toObject(StorageTierCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTierCapability model = new StorageTierCapability(); - model = BinaryData.fromObject(model).toObject(StorageTierCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserAssignedIdentityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserAssignedIdentityTests.java deleted file mode 100644 index c7a2dd4287af5..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserAssignedIdentityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType; -import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; -import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = - BinaryData - .fromString( - "{\"userAssignedIdentities\":{\"zbhvgyuguosv\":{\"principalId\":\"ctyqik\",\"clientId\":\"bovpl\"},\"wiyighxpkdw\":{\"principalId\":\"fssxqukkfplg\",\"clientId\":\"sxnkjzkdeslpvlo\"}},\"type\":\"UserAssigned\"}") - .toObject(UserAssignedIdentity.class); - Assertions.assertEquals("ctyqik", model.userAssignedIdentities().get("zbhvgyuguosv").principalId()); - Assertions.assertEquals("bovpl", model.userAssignedIdentities().get("zbhvgyuguosv").clientId()); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = - new UserAssignedIdentity() - .withUserAssignedIdentities( - mapOf( - "zbhvgyuguosv", - new UserIdentity().withPrincipalId("ctyqik").withClientId("bovpl"), - "wiyighxpkdw", - new UserIdentity().withPrincipalId("fssxqukkfplg").withClientId("sxnkjzkdeslpvlo"))) - .withType(IdentityType.USER_ASSIGNED); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - Assertions.assertEquals("ctyqik", model.userAssignedIdentities().get("zbhvgyuguosv").principalId()); - Assertions.assertEquals("bovpl", model.userAssignedIdentities().get("zbhvgyuguosv").clientId()); - Assertions.assertEquals(IdentityType.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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java deleted file mode 100644 index 9f68b711f5131..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; -import org.junit.jupiter.api.Assertions; - -public final class UserIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserIdentity model = - BinaryData.fromString("{\"principalId\":\"iuebbaumny\",\"clientId\":\"ped\"}").toObject(UserIdentity.class); - Assertions.assertEquals("iuebbaumny", model.principalId()); - Assertions.assertEquals("ped", model.clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentity model = new UserIdentity().withPrincipalId("iuebbaumny").withClientId("ped"); - model = BinaryData.fromObject(model).toObject(UserIdentity.class); - Assertions.assertEquals("iuebbaumny", model.principalId()); - Assertions.assertEquals("ped", model.clientId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VcoreCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VcoreCapabilityTests.java deleted file mode 100644 index b26dd3c9084e8..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VcoreCapabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VcoreCapability; - -public final class VcoreCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VcoreCapability model = - BinaryData - .fromString( - "{\"name\":\"pyqr\",\"vCores\":298200283575892890,\"supportedIops\":2996229806276970298,\"supportedMemoryPerVcoreMB\":4254467677090741872,\"status\":\"kirsoodqxhc\"}") - .toObject(VcoreCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VcoreCapability model = new VcoreCapability(); - model = BinaryData.fromObject(model).toObject(VcoreCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java deleted file mode 100644 index de0210a1eac67..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import org.junit.jupiter.api.Assertions; - -public final class VirtualNetworkSubnetUsageParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = - BinaryData - .fromString("{\"virtualNetworkArmResourceId\":\"zuaejxd\"}") - .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("zuaejxd", model.virtualNetworkArmResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId("zuaejxd"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("zuaejxd", model.virtualNetworkArmResourceId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java deleted file mode 100644 index 720554747d1f2..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner; - -public final class VirtualNetworkSubnetUsageResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = - BinaryData - .fromString( - "{\"delegatedSubnetsUsage\":[{\"subnetName\":\"kzbbtd\",\"usage\":1585824709452414573},{\"subnetName\":\"ekg\",\"usage\":7805655437752275233},{\"subnetName\":\"hkfpbs\",\"usage\":2825814840016940868},{\"subnetName\":\"xl\",\"usage\":2245300278286998069}],\"location\":\"touwaboekqv\",\"subscriptionId\":\"lns\"}") - .toObject(VirtualNetworkSubnetUsageResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = new VirtualNetworkSubnetUsageResultInner(); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageResultInner.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java deleted file mode 100644 index 01e414a379a31..0000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.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.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageResult; -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 VirtualNetworkSubnetUsagesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"delegatedSubnetsUsage\":[{\"subnetName\":\"kby\",\"usage\":813821040915840759},{\"subnetName\":\"fhpagmhrskdsnf\",\"usage\":8961529268746334450},{\"subnetName\":\"kgtdlmkkze\",\"usage\":1057392076331487418},{\"subnetName\":\"wpusdsttwvogv\",\"usage\":6615521098570079164}],\"location\":\"cngqqmoakufgmjz\",\"subscriptionId\":\"rdgrtw\"}"; - - 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); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualNetworkSubnetUsageResult response = - manager - .virtualNetworkSubnetUsages() - .executeWithResponse( - "lmnguxaw", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId("ldsyuuximerqfob"), - com.azure.core.util.Context.NONE) - .getValue(); - } -}