diff --git a/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md b/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md index db7567eac8ac1..0eb03f0db5b50 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md +++ b/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2023-07-27) + +- Azure Resource Manager AzureSphere client library for Java. This package contains Microsoft Azure SDK for AzureSphere Management SDK. Azure Sphere resource management API. Package tag package-2022-09-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/sphere/azure-resourcemanager-sphere/README.md b/sdk/sphere/azure-resourcemanager-sphere/README.md index 2c270ea9f71a9..50618ff45da29 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/README.md +++ b/sdk/sphere/azure-resourcemanager-sphere/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-sphere - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.java deleted file mode 100644 index 6962083bbbef2..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CatalogInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CatalogInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CatalogInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\"},\"location\":\"lokjyemkk\",\"tags\":{\"ejspodmail\":\"pjoxzjnch\",\"yahux\":\"ydehoj\",\"vcputegj\":\"npmqnjaqwixjspro\",\"uuvmkjozkrwfnd\":\"wmfdatscmdvpjhul\"},\"id\":\"odjpslwejd\",\"name\":\"vwryoqpso\",\"type\":\"cctazakljlahbc\"}") - .toObject(CatalogInner.class); - Assertions.assertEquals("lokjyemkk", model.location()); - Assertions.assertEquals("pjoxzjnch", model.tags().get("ejspodmail")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CatalogInner model = - new CatalogInner() - .withLocation("lokjyemkk") - .withTags( - mapOf( - "ejspodmail", - "pjoxzjnch", - "yahux", - "ydehoj", - "vcputegj", - "npmqnjaqwixjspro", - "uuvmkjozkrwfnd", - "wmfdatscmdvpjhul")); - model = BinaryData.fromObject(model).toObject(CatalogInner.class); - Assertions.assertEquals("lokjyemkk", model.location()); - Assertions.assertEquals("pjoxzjnch", model.tags().get("ejspodmail")); - } - - @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/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.java deleted file mode 100644 index a8865709acb79..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CatalogInner; -import com.azure.resourcemanager.sphere.models.CatalogListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CatalogListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CatalogListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\"},\"location\":\"hxqh\",\"tags\":{\"scnpqxuhivy\":\"fpikxwczb\",\"wby\":\"n\",\"grtfwvu\":\"rkxvdum\"},\"id\":\"xgaudccs\",\"name\":\"h\",\"type\":\"jcny\"}],\"nextLink\":\"hkryhtn\"}") - .toObject(CatalogListResult.class); - Assertions.assertEquals("hxqh", model.value().get(0).location()); - Assertions.assertEquals("fpikxwczb", model.value().get(0).tags().get("scnpqxuhivy")); - Assertions.assertEquals("hkryhtn", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CatalogListResult model = - new CatalogListResult() - .withValue( - Arrays - .asList( - new CatalogInner() - .withLocation("hxqh") - .withTags(mapOf("scnpqxuhivy", "fpikxwczb", "wby", "n", "grtfwvu", "rkxvdum")))) - .withNextLink("hkryhtn"); - model = BinaryData.fromObject(model).toObject(CatalogListResult.class); - Assertions.assertEquals("hxqh", model.value().get(0).location()); - Assertions.assertEquals("fpikxwczb", model.value().get(0).tags().get("scnpqxuhivy")); - Assertions.assertEquals("hkryhtn", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java deleted file mode 100644 index 92506c4b6bb33..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CatalogProperties; - -public final class CatalogPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CatalogProperties model = - BinaryData.fromString("{\"provisioningState\":\"Provisioning\"}").toObject(CatalogProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CatalogProperties model = new CatalogProperties(); - model = BinaryData.fromObject(model).toObject(CatalogProperties.class); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.java deleted file mode 100644 index a1076b1954073..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.CatalogUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CatalogUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CatalogUpdate model = - BinaryData - .fromString( - "{\"tags\":{\"xpaojakhmsbz\":\"fdosyg\",\"hlxaolthqtr\":\"hcrzevd\",\"gvfcj\":\"qjbpfzfsin\"}}") - .toObject(CatalogUpdate.class); - Assertions.assertEquals("fdosyg", model.tags().get("xpaojakhmsbz")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CatalogUpdate model = - new CatalogUpdate() - .withTags(mapOf("xpaojakhmsbz", "fdosyg", "hlxaolthqtr", "hcrzevd", "gvfcj", "qjbpfzfsin")); - model = BinaryData.fromObject(model).toObject(CatalogUpdate.class); - Assertions.assertEquals("fdosyg", model.tags().get("xpaojakhmsbz")); - } - - @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/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java deleted file mode 100644 index b65131b0794fd..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java +++ /dev/null @@ -1,66 +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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; -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 CatalogsCountDevicesWithResponseMockTests { - @Test - public void testCountDevicesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":427278595}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CountDeviceResponse response = - manager.catalogs().countDevicesWithResponse("bkyvp", "ca", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(427278595, response.value()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java deleted file mode 100644 index 8b2d78d783367..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,87 +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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Catalog; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CatalogsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\"},\"location\":\"lmpewwwfbkr\",\"tags\":{\"rsbfovasrruvw\":\"svshqjohx\"},\"id\":\"hsqfsubcgjbirxbp\",\"name\":\"bsrfbj\",\"type\":\"dtws\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Catalog response = - manager - .catalogs() - .define("mjh") - .withRegion("gudivkrtswbxqz") - .withExistingResourceGroup("rmfqjhhkxbpvj") - .withTags(mapOf("e", "jfauvjfdxxi")) - .create(); - - Assertions.assertEquals("lmpewwwfbkr", response.location()); - Assertions.assertEquals("svshqjohx", response.tags().get("rsbfovasrruvw")); - } - - @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/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.java deleted file mode 100644 index a43539e369588..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.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.sphere.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.sphere.AzureSphereManager; -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 CatalogsDeleteMockTests { - @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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.catalogs().delete("hdzhlrqj", "hckfrlhrx", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index be9d6977414b4..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Catalog; -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 CatalogsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Accepted\"},\"location\":\"gxywpmue\",\"tags\":{\"bglaocqxtccm\":\"zwfqkqujidsuyon\"},\"id\":\"yudxytlmoy\",\"name\":\"xv\",\"type\":\"fudwpznt\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Catalog response = - manager.catalogs().getByResourceGroupWithResponse("ye", "sbj", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("gxywpmue", response.location()); - Assertions.assertEquals("zwfqkqujidsuyon", response.tags().get("bglaocqxtccm")); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.java deleted file mode 100644 index 4c933ee635d93..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Catalog; -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 CatalogsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\"},\"location\":\"bkc\",\"tags\":{\"nv\":\"hbttkphyw\"},\"id\":\"t\",\"name\":\"qnermclfplphoxu\",\"type\":\"crpab\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.catalogs().listByResourceGroup("kvceoveilovnotyf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bkc", response.iterator().next().location()); - Assertions.assertEquals("hbttkphyw", response.iterator().next().tags().get("nv")); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.java deleted file mode 100644 index cb6c4fbc61b39..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Deployment; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -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 CatalogsListDeploymentsMockTests { - @Test - public void testListDeployments() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"deploymentId\":\"v\",\"deployedImages\":[{\"properties\":{\"image\":\"slhs\",\"imageId\":\"deemao\",\"imageName\":\"xagkvtmelmqkrh\",\"regionalDataBoundary\":\"None\",\"uri\":\"juahaquhcdhmdual\",\"description\":\"xqpvfadmw\",\"componentId\":\"crgvxpvgom\",\"imageType\":\"WifiFirmware\",\"provisioningState\":\"Canceled\"},\"id\":\"sgwbnbbeld\",\"name\":\"wkz\",\"type\":\"ali\"},{\"properties\":{\"image\":\"qhakauhashsf\",\"imageId\":\"osow\",\"imageName\":\"cugicjoox\",\"regionalDataBoundary\":\"EU\",\"uri\":\"wpucwwfvovbv\",\"description\":\"uecivyhz\",\"componentId\":\"uojgj\",\"imageType\":\"SecurityMonitor\",\"provisioningState\":\"Succeeded\"},\"id\":\"iotwmcdytdxwit\",\"name\":\"nrjawgqwg\",\"type\":\"hniskxfbkpyc\"},{\"properties\":{\"image\":\"wndnhj\",\"imageId\":\"uwhvylwzbtdhxujz\",\"imageName\":\"mpowuwpr\",\"regionalDataBoundary\":\"None\",\"uri\":\"eualupjmkhf\",\"description\":\"bbcswsrtjri\",\"componentId\":\"rbpbewtghfgblcg\",\"imageType\":\"OneBl\",\"provisioningState\":\"Canceled\"},\"id\":\"v\",\"name\":\"hjkbegibtnmxieb\",\"type\":\"waloayqcgwr\"},{\"properties\":{\"image\":\"uzgwyzmhtx\",\"imageId\":\"gmtsavjcbpwxqpsr\",\"imageName\":\"ftguv\",\"regionalDataBoundary\":\"EU\",\"uri\":\"prwmdyvxqt\",\"description\":\"riwwroy\",\"componentId\":\"exrmcqibycnojvk\",\"imageType\":\"PlutonRuntime\",\"provisioningState\":\"Updating\"},\"id\":\"sgzvahapjyzhpv\",\"name\":\"qzcjrvxdj\",\"type\":\"lmwlxkvugfhzo\"}],\"deploymentDateUtc\":\"2021-09-30T03:16:16Z\",\"provisioningState\":\"Canceled\"},\"id\":\"zunlu\",\"name\":\"hnnpr\",\"type\":\"xipeilpjzuaejx\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .catalogs() - .listDeployments( - "z", "p", "kafkuwbcrnwbm", 1542253292, 1688496747, 1198251199, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("v", response.iterator().next().deploymentId()); - Assertions.assertEquals("slhs", response.iterator().next().deployedImages().get(0).image()); - Assertions.assertEquals("deemao", response.iterator().next().deployedImages().get(0).imageId()); - Assertions - .assertEquals( - RegionalDataBoundary.NONE, response.iterator().next().deployedImages().get(0).regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java deleted file mode 100644 index 5d57cacf9ab98..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.DeviceGroup; -import com.azure.resourcemanager.sphere.models.ListDeviceGroupsRequest; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; -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 CatalogsListDeviceGroupsMockTests { - @Test - public void testListDeviceGroups() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"luu\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":false,\"provisioningState\":\"Updating\"},\"id\":\"v\",\"name\":\"elnsmvbxw\",\"type\":\"jsflhhcaalnjix\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .catalogs() - .listDeviceGroups( - "ultskzbbtdz", - "mv", - new ListDeviceGroupsRequest().withDeviceGroupName("kgpwoz"), - "hkfpbs", - 820009390, - 657936288, - 205303620, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("luu", response.iterator().next().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.iterator().next().osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.iterator().next().updatePolicy()); - Assertions - .assertEquals(AllowCrashDumpCollection.ENABLED, response.iterator().next().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, response.iterator().next().regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java deleted file mode 100644 index 924deb5c4dad5..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java +++ /dev/null @@ -1,86 +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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.DeviceInsight; -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 CatalogsListDeviceInsightsMockTests { - @Test - public void testListDeviceInsights() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"deviceId\":\"ztfolhbnxk\",\"description\":\"alaulppggdtpnapn\",\"startTimestampUtc\":\"2021-01-27T00:10:34Z\",\"endTimestampUtc\":\"2021-04-06T21:45:28Z\",\"eventCategory\":\"opuhpig\",\"eventClass\":\"pgylg\",\"eventType\":\"git\",\"eventCount\":1973221194}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .catalogs() - .listDeviceInsights( - "sxyawjoyaqcs", - "yjpkiidzyexz", - "eli", - 1911330715, - 462425094, - 705550222, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ztfolhbnxk", response.iterator().next().deviceId()); - Assertions.assertEquals("alaulppggdtpnapn", response.iterator().next().description()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-27T00:10:34Z"), response.iterator().next().startTimestampUtc()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-04-06T21:45:28Z"), response.iterator().next().endTimestampUtc()); - Assertions.assertEquals("opuhpig", response.iterator().next().eventCategory()); - Assertions.assertEquals("pgylg", response.iterator().next().eventClass()); - Assertions.assertEquals("git", response.iterator().next().eventType()); - Assertions.assertEquals(1973221194, response.iterator().next().eventCount()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.java deleted file mode 100644 index cbd33be295984..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Device; -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 CatalogsListDevicesMockTests { - @Test - public void testListDevices() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"deviceId\":\"ellwptfdy\",\"chipSku\":\"fqbuaceopzf\",\"lastAvailableOsVersion\":\"hhuao\",\"lastInstalledOsVersion\":\"pcqeqx\",\"lastOsUpdateUtc\":\"2021-02-19T08:33:13Z\",\"lastUpdateRequestUtc\":\"2021-12-05T23:59:55Z\",\"provisioningState\":\"Failed\"},\"id\":\"xcto\",\"name\":\"gbkdmoizpos\",\"type\":\"mgrcfbu\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .catalogs() - .listDevices( - "edjvcslynqw", - "ncw", - "zhxgktrmgucn", - 1295716293, - 994320059, - 47772472, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ellwptfdy", response.iterator().next().deviceId()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.java deleted file mode 100644 index ed17d3f62a22c..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Catalog; -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 CatalogsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\"},\"location\":\"kde\",\"tags\":{\"kdwzbaiuebbaumny\":\"vlopwiyighx\",\"txp\":\"upedeojnabckhs\",\"tfhvpesapskrdqmh\":\"ie\",\"tkncwsc\":\"jdhtldwkyzxu\"},\"id\":\"svlxotogtwrup\",\"name\":\"sx\",\"type\":\"nmic\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.catalogs().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kde", response.iterator().next().location()); - Assertions.assertEquals("vlopwiyighx", response.iterator().next().tags().get("kdwzbaiuebbaumny")); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.java deleted file mode 100644 index 20eb83b8c343b..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CertificateChainResponseInner; - -public final class CertificateChainResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CertificateChainResponseInner model = - BinaryData - .fromString("{\"certificateChain\":\"uskcqvkocrcj\"}") - .toObject(CertificateChainResponseInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CertificateChainResponseInner model = new CertificateChainResponseInner(); - model = BinaryData.fromObject(model).toObject(CertificateChainResponseInner.class); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.java deleted file mode 100644 index 6754027061f50..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CertificateInner; - -public final class CertificateInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CertificateInner model = - BinaryData - .fromString( - "{\"properties\":{\"certificate\":\"eotusivyevc\",\"status\":\"Active\",\"subject\":\"hn\",\"thumbprint\":\"ngbwjz\",\"expiryUtc\":\"2020-12-28T13:19:57Z\",\"notBeforeUtc\":\"2021-11-04T09:44:48Z\",\"provisioningState\":\"Failed\"},\"id\":\"spemvtzfk\",\"name\":\"fublj\",\"type\":\"fxqeof\"}") - .toObject(CertificateInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CertificateInner model = new CertificateInner(); - model = BinaryData.fromObject(model).toObject(CertificateInner.class); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.java deleted file mode 100644 index 7446a0f2cf621..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CertificateInner; -import com.azure.resourcemanager.sphere.models.CertificateListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CertificateListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CertificateListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"certificate\":\"xxjtfe\",\"status\":\"Expired\",\"subject\":\"fziton\",\"thumbprint\":\"qfpjk\",\"expiryUtc\":\"2021-05-09T13:58:23Z\",\"notBeforeUtc\":\"2021-11-24T18:52:18Z\",\"provisioningState\":\"Failed\"},\"id\":\"hpf\",\"name\":\"xypininmayhuybbk\",\"type\":\"odepoogin\"}],\"nextLink\":\"amiheognarxz\"}") - .toObject(CertificateListResult.class); - Assertions.assertEquals("amiheognarxz", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CertificateListResult model = - new CertificateListResult().withValue(Arrays.asList(new CertificateInner())).withNextLink("amiheognarxz"); - model = BinaryData.fromObject(model).toObject(CertificateListResult.class); - Assertions.assertEquals("amiheognarxz", model.nextLink()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.java deleted file mode 100644 index 466e9b7ffa5b1..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CertificateProperties; - -public final class CertificatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CertificateProperties model = - BinaryData - .fromString( - "{\"certificate\":\"e\",\"status\":\"Expired\",\"subject\":\"jbasvmsmjqulngs\",\"thumbprint\":\"nbybkzgcwrwcl\",\"expiryUtc\":\"2021-06-21T13:48:53Z\",\"notBeforeUtc\":\"2021-01-30T10:40:21Z\",\"provisioningState\":\"Canceled\"}") - .toObject(CertificateProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CertificateProperties model = new CertificateProperties(); - model = BinaryData.fromObject(model).toObject(CertificateProperties.class); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java deleted file mode 100644 index c4b74f5c71434..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Certificate; -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 CertificatesGetWithResponseMockTests { - @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\":{\"certificate\":\"d\",\"status\":\"Inactive\",\"subject\":\"hzdxssadbzm\",\"thumbprint\":\"dfznudaodv\",\"expiryUtc\":\"2021-05-29T13:49:41Z\",\"notBeforeUtc\":\"2021-08-27T15:54:03Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"lpstdbhhxsrzdz\",\"name\":\"cers\",\"type\":\"dntnevf\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Certificate response = - manager - .certificates() - .getWithResponse("aolps", "lqlfm", "dnbbglzps", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.java deleted file mode 100644 index 046b9f5afd56d..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Certificate; -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 CertificatesListByCatalogMockTests { - @Test - public void testListByCatalog() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"certificate\":\"n\",\"status\":\"Expired\",\"subject\":\"gdrjervnaenqpe\",\"thumbprint\":\"ndoygmifthnzdnd\",\"expiryUtc\":\"2021-07-04T07:51:31Z\",\"notBeforeUtc\":\"2021-07-27T07:40:17Z\",\"provisioningState\":\"Canceled\"},\"id\":\"gynduha\",\"name\":\"hqlkthumaqo\",\"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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .certificates() - .listByCatalog( - "otftpvjzbexilz", - "nfqqnvwp", - "qtaruoujmkcjhwq", - 1209878928, - 1656357002, - 75465955, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java deleted file mode 100644 index 29c0fee1fc770..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java +++ /dev/null @@ -1,66 +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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.CertificateChainResponse; -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 CertificatesRetrieveCertChainWithResponseMockTests { - @Test - public void testRetrieveCertChainWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"certificateChain\":\"mweriofzpy\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CertificateChainResponse response = - manager - .certificates() - .retrieveCertChainWithResponse("wjmy", "tdss", "s", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.java deleted file mode 100644 index 012c89bb50ee5..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest; -import com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceResponse; -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 CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests { - @Test - public void testRetrieveProofOfPossessionNonceWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"certificate\":\"k\",\"status\":\"Inactive\",\"subject\":\"pjflcxogao\",\"thumbprint\":\"nzmnsikvm\",\"expiryUtc\":\"2021-05-13T18:51:38Z\",\"notBeforeUtc\":\"2021-02-18T23:34:18Z\",\"provisioningState\":\"Failed\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ProofOfPossessionNonceResponse response = - manager - .certificates() - .retrieveProofOfPossessionNonceWithResponse( - "semwabnet", - "hhszh", - "d", - new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("lvwiwubmwmbesl"), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.java deleted file mode 100644 index 987e77431a939..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.ClaimDevicesRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClaimDevicesRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClaimDevicesRequest model = - BinaryData - .fromString("{\"deviceIdentifiers\":[\"ckzywbiexzfeyue\",\"xibxujwbhqwalm\",\"zyoxaepdkzjan\"]}") - .toObject(ClaimDevicesRequest.class); - Assertions.assertEquals("ckzywbiexzfeyue", model.deviceIdentifiers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClaimDevicesRequest model = - new ClaimDevicesRequest() - .withDeviceIdentifiers(Arrays.asList("ckzywbiexzfeyue", "xibxujwbhqwalm", "zyoxaepdkzjan")); - model = BinaryData.fromObject(model).toObject(ClaimDevicesRequest.class); - Assertions.assertEquals("ckzywbiexzfeyue", model.deviceIdentifiers().get(0)); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseInnerTests.java deleted file mode 100644 index 2ffe088cd6d62..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseInnerTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class CountDeviceResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CountDeviceResponseInner model = - BinaryData.fromString("{\"value\":1762114496}").toObject(CountDeviceResponseInner.class); - Assertions.assertEquals(1762114496, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CountDeviceResponseInner model = new CountDeviceResponseInner().withValue(1762114496); - model = BinaryData.fromObject(model).toObject(CountDeviceResponseInner.class); - Assertions.assertEquals(1762114496, model.value()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.java deleted file mode 100644 index 41e3672f50df1..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.CountElementsResponse; -import org.junit.jupiter.api.Assertions; - -public final class CountElementsResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CountElementsResponse model = - BinaryData.fromString("{\"value\":1742159588}").toObject(CountElementsResponse.class); - Assertions.assertEquals(1742159588, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CountElementsResponse model = new CountElementsResponse().withValue(1742159588); - model = BinaryData.fromObject(model).toObject(CountElementsResponse.class); - Assertions.assertEquals(1742159588, model.value()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java deleted file mode 100644 index 08bb9bfd280b6..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java +++ /dev/null @@ -1,58 +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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; -import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentInner model = - BinaryData - .fromString( - "{\"properties\":{\"deploymentId\":\"jrmvdjwzrlo\",\"deployedImages\":[{\"properties\":{\"image\":\"hijco\",\"imageId\":\"ctbzaq\",\"imageName\":\"sycbkbfk\",\"regionalDataBoundary\":\"None\",\"uri\":\"kexxppof\",\"description\":\"axcfjpgddtocjjx\",\"componentId\":\"pmouexhdz\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Accepted\"},\"id\":\"ojnxqbzvdd\",\"name\":\"t\",\"type\":\"ndei\"},{\"properties\":{\"image\":\"w\",\"imageId\":\"zao\",\"imageName\":\"uhrhcffcyddgl\",\"regionalDataBoundary\":\"None\",\"uri\":\"jqkwpyeicx\",\"description\":\"ciwqvhk\",\"componentId\":\"xuigdtopbobj\",\"imageType\":\"ManifestSet\",\"provisioningState\":\"Deleting\"},\"id\":\"w\",\"name\":\"a\",\"type\":\"a\"},{\"properties\":{\"image\":\"z\",\"imageId\":\"vvtpgvdfgio\",\"imageName\":\"ftutqxlngxlefgu\",\"regionalDataBoundary\":\"None\",\"uri\":\"rxdq\",\"description\":\"dt\",\"componentId\":\"zrvqdr\",\"imageType\":\"NormalWorldKernel\",\"provisioningState\":\"Provisioning\"},\"id\":\"big\",\"name\":\"h\",\"type\":\"qfbow\"},{\"properties\":{\"image\":\"nyktzlcuiy\",\"imageId\":\"qyw\",\"imageName\":\"drvyn\",\"regionalDataBoundary\":\"EU\",\"uri\":\"phrcgyncoc\",\"description\":\"cfvmmco\",\"componentId\":\"sxlzevgbmqj\",\"imageType\":\"PlutonRuntime\",\"provisioningState\":\"Deleting\"},\"id\":\"pmivkwlzu\",\"name\":\"ccfwnfnbacfion\",\"type\":\"ebxetqgtzxdp\"}],\"deploymentDateUtc\":\"2021-04-08T18:16:48Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"wxrjfeallnwsub\",\"name\":\"snjampmng\",\"type\":\"zscxaqwo\"}") - .toObject(DeploymentInner.class); - Assertions.assertEquals("jrmvdjwzrlo", model.deploymentId()); - Assertions.assertEquals("hijco", model.deployedImages().get(0).image()); - Assertions.assertEquals("ctbzaq", model.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.deployedImages().get(0).regionalDataBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentInner model = - new DeploymentInner() - .withDeploymentId("jrmvdjwzrlo") - .withDeployedImages( - Arrays - .asList( - new ImageInner() - .withImage("hijco") - .withImageId("ctbzaq") - .withRegionalDataBoundary(RegionalDataBoundary.NONE), - new ImageInner() - .withImage("w") - .withImageId("zao") - .withRegionalDataBoundary(RegionalDataBoundary.NONE), - new ImageInner() - .withImage("z") - .withImageId("vvtpgvdfgio") - .withRegionalDataBoundary(RegionalDataBoundary.NONE), - new ImageInner() - .withImage("nyktzlcuiy") - .withImageId("qyw") - .withRegionalDataBoundary(RegionalDataBoundary.EU))); - model = BinaryData.fromObject(model).toObject(DeploymentInner.class); - Assertions.assertEquals("jrmvdjwzrlo", model.deploymentId()); - Assertions.assertEquals("hijco", model.deployedImages().get(0).image()); - Assertions.assertEquals("ctbzaq", model.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.deployedImages().get(0).regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.java deleted file mode 100644 index 6fee8c609012e..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; -import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import com.azure.resourcemanager.sphere.models.DeploymentListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"deploymentId\":\"idnsezcxtb\",\"deployedImages\":[{\"properties\":{},\"id\":\"yc\",\"name\":\"sne\",\"type\":\"mdwzjeiachboo\"},{\"properties\":{},\"id\":\"lnrosfqp\",\"name\":\"eeh\",\"type\":\"zvypyqrimzinp\"}],\"deploymentDateUtc\":\"2021-01-25T11:13:44Z\",\"provisioningState\":\"Deleting\"},\"id\":\"kirsoodqxhc\",\"name\":\"mnoh\",\"type\":\"t\"},{\"properties\":{\"deploymentId\":\"h\",\"deployedImages\":[{\"properties\":{},\"id\":\"fiyipjxsqwpgrj\",\"name\":\"znorcj\",\"type\":\"vsnb\"},{\"properties\":{},\"id\":\"qabnmoc\",\"name\":\"cyshurzafbljjgp\",\"type\":\"toqcjmklja\"},{\"properties\":{},\"id\":\"qidtqajzyu\",\"name\":\"pku\",\"type\":\"jkrlkhbzhfepg\"},{\"properties\":{},\"id\":\"qex\",\"name\":\"locx\",\"type\":\"c\"}],\"deploymentDateUtc\":\"2021-01-04T21:09:36Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"hhbcsglummajtjao\",\"name\":\"xobnbdxkqpxok\",\"type\":\"jionpimexgstxgc\"}],\"nextLink\":\"dg\"}") - .toObject(DeploymentListResult.class); - Assertions.assertEquals("idnsezcxtb", model.value().get(0).deploymentId()); - Assertions.assertEquals("dg", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentListResult model = - new DeploymentListResult() - .withValue( - Arrays - .asList( - new DeploymentInner() - .withDeploymentId("idnsezcxtb") - .withDeployedImages(Arrays.asList(new ImageInner(), new ImageInner())), - new DeploymentInner() - .withDeploymentId("h") - .withDeployedImages( - Arrays - .asList( - new ImageInner(), new ImageInner(), new ImageInner(), new ImageInner())))) - .withNextLink("dg"); - model = BinaryData.fromObject(model).toObject(DeploymentListResult.class); - Assertions.assertEquals("idnsezcxtb", model.value().get(0).deploymentId()); - Assertions.assertEquals("dg", model.nextLink()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java deleted file mode 100644 index 7073c470e6569..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeploymentProperties; -import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentProperties model = - BinaryData - .fromString( - "{\"deploymentId\":\"hcbonqvpkvlr\",\"deployedImages\":[{\"properties\":{\"image\":\"seiphe\",\"imageId\":\"lokeyy\",\"imageName\":\"nj\",\"regionalDataBoundary\":\"EU\",\"uri\":\"tgrhpdjpjumas\",\"description\":\"zj\",\"componentId\":\"yegu\",\"imageType\":\"FirmwareUpdateManifest\",\"provisioningState\":\"Provisioning\"},\"id\":\"xhejjzzvdud\",\"name\":\"wdslfhotwmcy\",\"type\":\"pwlbjnpg\"},{\"properties\":{\"image\":\"tadehxnltyfsopp\",\"imageId\":\"uesnzwdejbavo\",\"imageName\":\"zdmohctbqvu\",\"regionalDataBoundary\":\"None\",\"uri\":\"ndnvo\",\"description\":\"ujjugwdkcglh\",\"componentId\":\"azjdyggd\",\"imageType\":\"WifiFirmware\",\"provisioningState\":\"Provisioning\"},\"id\":\"b\",\"name\":\"uofqwe\",\"type\":\"kh\"}],\"deploymentDateUtc\":\"2021-06-19T17:30:56Z\",\"provisioningState\":\"Succeeded\"}") - .toObject(DeploymentProperties.class); - Assertions.assertEquals("hcbonqvpkvlr", model.deploymentId()); - Assertions.assertEquals("seiphe", model.deployedImages().get(0).image()); - Assertions.assertEquals("lokeyy", model.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.deployedImages().get(0).regionalDataBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentProperties model = - new DeploymentProperties() - .withDeploymentId("hcbonqvpkvlr") - .withDeployedImages( - Arrays - .asList( - new ImageInner() - .withImage("seiphe") - .withImageId("lokeyy") - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new ImageInner() - .withImage("tadehxnltyfsopp") - .withImageId("uesnzwdejbavo") - .withRegionalDataBoundary(RegionalDataBoundary.NONE))); - model = BinaryData.fromObject(model).toObject(DeploymentProperties.class); - Assertions.assertEquals("hcbonqvpkvlr", model.deploymentId()); - Assertions.assertEquals("seiphe", model.deployedImages().get(0).image()); - Assertions.assertEquals("lokeyy", model.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.deployedImages().get(0).regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java deleted file mode 100644 index 3341621f04508..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import com.azure.resourcemanager.sphere.models.Deployment; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeploymentsCreateOrUpdateMockTests { - @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\":{\"deploymentId\":\"dsrezpdrhneuyow\",\"deployedImages\":[{\"properties\":{\"image\":\"t\",\"imageId\":\"ib\",\"imageName\":\"cgpik\",\"regionalDataBoundary\":\"None\",\"uri\":\"ejzanlfz\",\"description\":\"av\",\"componentId\":\"bzonok\",\"imageType\":\"FirmwareUpdateManifest\",\"provisioningState\":\"Deleting\"},\"id\":\"cirgzp\",\"name\":\"rlazszrnw\",\"type\":\"iin\"}],\"deploymentDateUtc\":\"2021-01-06T22:30:17Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"jylwbtlhflsj\",\"name\":\"dhszfjv\",\"type\":\"bgofeljag\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Deployment response = - manager - .deployments() - .define("nmdyodnwzxl") - .withExistingDeviceGroup("dl", "h", "hfwpracstwit", "khevxccedc") - .withDeploymentId("vnhltiugcx") - .withDeployedImages( - Arrays - .asList( - new ImageInner() - .withImage("xqi") - .withImageId("qunyowxwlmdjr") - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new ImageInner() - .withImage("jivfxzsjabib") - .withImageId("stawfsdjpvkv") - .withRegionalDataBoundary(RegionalDataBoundary.NONE))) - .create(); - - Assertions.assertEquals("dsrezpdrhneuyow", response.deploymentId()); - Assertions.assertEquals("t", response.deployedImages().get(0).image()); - Assertions.assertEquals("ib", response.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.deployedImages().get(0).regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.java deleted file mode 100644 index 4ce227f68739a..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.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.sphere.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.sphere.AzureSphereManager; -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 DeploymentsDeleteMockTests { - @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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.deployments().delete("lolp", "vk", "r", "qvujzraehtwdwrf", "swibyr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java deleted file mode 100644 index 068679d45e304..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Deployment; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -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 DeploymentsGetWithResponseMockTests { - @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\":{\"deploymentId\":\"doamciodhkha\",\"deployedImages\":[{\"properties\":{\"image\":\"zbonlwnt\",\"imageId\":\"gokdwbwhks\",\"imageName\":\"cmrvexzt\",\"regionalDataBoundary\":\"None\",\"uri\":\"gsfraoyzkoow\",\"description\":\"mnguxawqaldsyu\",\"componentId\":\"imerqfobwyznk\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Updating\"},\"id\":\"wpfhpagmhrskd\",\"name\":\"nfd\",\"type\":\"doakgtdlmkkzevdl\"},{\"properties\":{\"image\":\"pusdstt\",\"imageId\":\"ogvbbejdcngq\",\"imageName\":\"oakufgm\",\"regionalDataBoundary\":\"None\",\"uri\":\"rdgrtw\",\"description\":\"nuuzkopbm\",\"componentId\":\"rfdwoyu\",\"imageType\":\"Nwfs\",\"provisioningState\":\"Failed\"},\"id\":\"iefozbhdmsml\",\"name\":\"zqhof\",\"type\":\"rmaequ\"},{\"properties\":{\"image\":\"xicslfao\",\"imageId\":\"piyylhalnswhccsp\",\"imageName\":\"aivwitqscywu\",\"regionalDataBoundary\":\"EU\",\"uri\":\"luhczbw\",\"description\":\"hairsbrgzdwms\",\"componentId\":\"ypqwdxggiccc\",\"imageType\":\"RecoveryManifest\",\"provisioningState\":\"Succeeded\"},\"id\":\"exmk\",\"name\":\"tlstvlzywem\",\"type\":\"zrncsdt\"}],\"deploymentDateUtc\":\"2021-07-01T02:09:13Z\",\"provisioningState\":\"Deleting\"},\"id\":\"ypbsfgytguslfead\",\"name\":\"ygqukyhejh\",\"type\":\"isxgfp\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Deployment response = - manager - .deployments() - .getWithResponse( - "bjcntujitc", "ed", "twwaezkojvdcpzf", "qouicybxarzgsz", "foxciq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("doamciodhkha", response.deploymentId()); - Assertions.assertEquals("zbonlwnt", response.deployedImages().get(0).image()); - Assertions.assertEquals("gokdwbwhks", response.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.deployedImages().get(0).regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java deleted file mode 100644 index 861f00dbdfdfa..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java +++ /dev/null @@ -1,85 +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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Deployment; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -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 DeploymentsListByDeviceGroupMockTests { - @Test - public void testListByDeviceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"deploymentId\":\"rx\",\"deployedImages\":[{\"properties\":{\"image\":\"vaytdwkqbrq\",\"imageId\":\"paxh\",\"imageName\":\"iilivpdtiirqtd\",\"regionalDataBoundary\":\"EU\",\"uri\":\"oruzfgsquyfxrxx\",\"description\":\"ptramxj\",\"componentId\":\"wlwnwxuqlcv\",\"imageType\":\"UpdateCertStore\",\"provisioningState\":\"Failed\"},\"id\":\"tdooaoj\",\"name\":\"niodkooeb\",\"type\":\"nuj\"},{\"properties\":{\"image\":\"msbvdkcrodtjinf\",\"imageId\":\"lfltka\",\"imageName\":\"vefkdlfoakggk\",\"regionalDataBoundary\":\"EU\",\"uri\":\"ao\",\"description\":\"ulpqblylsyxkqjn\",\"componentId\":\"ervtiagxs\",\"imageType\":\"SecurityMonitor\",\"provisioningState\":\"Accepted\"},\"id\":\"mpsbzkfzbeyv\",\"name\":\"nqicvinvkjjxdxrb\",\"type\":\"ukzclewyhmlwpaz\"},{\"properties\":{\"image\":\"ofncckwyfzqwhxxb\",\"imageId\":\"qa\",\"imageName\":\"feqztppriol\",\"regionalDataBoundary\":\"EU\",\"uri\":\"altol\",\"description\":\"cwsobqwcs\",\"componentId\":\"nwdcfhu\",\"imageType\":\"PlutonRuntime\",\"provisioningState\":\"Updating\"},\"id\":\"uvglsbjjcanvx\",\"name\":\"vtvudutncormr\",\"type\":\"xqtvcofu\"},{\"properties\":{\"image\":\"vkg\",\"imageId\":\"bgdknnqv\",\"imageName\":\"znqntoru\",\"regionalDataBoundary\":\"EU\",\"uri\":\"a\",\"description\":\"kycgrauwj\",\"componentId\":\"taeburuvdm\",\"imageType\":\"NormalWorldKernel\",\"provisioningState\":\"Provisioning\"},\"id\":\"l\",\"name\":\"wabm\",\"type\":\"oefki\"}],\"deploymentDateUtc\":\"2021-07-14T12:33:43Z\",\"provisioningState\":\"Canceled\"},\"id\":\"u\",\"name\":\"ujmqlgkfbtndoa\",\"type\":\"n\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .deployments() - .listByDeviceGroup( - "nbyxbaaabjyv", - "yffimrzrtuzqogs", - "xnevfdnwn", - "mewzsyyc", - "uzsoi", - 2025880638, - 414197490, - 2135802257, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("rx", response.iterator().next().deploymentId()); - Assertions.assertEquals("vaytdwkqbrq", response.iterator().next().deployedImages().get(0).image()); - Assertions.assertEquals("paxh", response.iterator().next().deployedImages().get(0).imageId()); - Assertions - .assertEquals( - RegionalDataBoundary.EU, response.iterator().next().deployedImages().get(0).regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java deleted file mode 100644 index 3c7b0effbe192..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java +++ /dev/null @@ -1,46 +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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; -import org.junit.jupiter.api.Assertions; - -public final class DeviceGroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceGroupInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"hqyudxorrqnbpoc\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Succeeded\"},\"id\":\"llr\",\"name\":\"vvdfwatkpnpul\",\"type\":\"xxbczwtr\"}") - .toObject(DeviceGroupInner.class); - Assertions.assertEquals("hqyudxorrqnbpoc", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceGroupInner model = - new DeviceGroupInner() - .withDescription("hqyudxorrqnbpoc") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.NONE); - model = BinaryData.fromObject(model).toObject(DeviceGroupInner.class); - Assertions.assertEquals("hqyudxorrqnbpoc", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.java deleted file mode 100644 index 3f11315981974..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.DeviceGroupListResult; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeviceGroupListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceGroupListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"bvyvdcsity\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Provisioning\"},\"id\":\"qsc\",\"name\":\"eypvhezrkg\",\"type\":\"hcjrefovgmk\"},{\"properties\":{\"description\":\"eyyvxyqjpkcat\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Succeeded\"},\"id\":\"jh\",\"name\":\"mdajv\",\"type\":\"ysou\"},{\"properties\":{\"description\":\"canoaeupf\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Updating\"},\"id\":\"matuok\",\"name\":\"hfuiuaodsfc\",\"type\":\"kvxod\"},{\"properties\":{\"description\":\"zmyzydagf\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Deleting\"},\"id\":\"whrdxwzywqsmbsu\",\"name\":\"exim\",\"type\":\"ryocfsfksymdd\"}],\"nextLink\":\"tki\"}") - .toObject(DeviceGroupListResult.class); - Assertions.assertEquals("bvyvdcsity", model.value().get(0).description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.value().get(0).osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.value().get(0).updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.value().get(0).allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.value().get(0).regionalDataBoundary()); - Assertions.assertEquals("tki", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceGroupListResult model = - new DeviceGroupListResult() - .withValue( - Arrays - .asList( - new DeviceGroupInner() - .withDescription("bvyvdcsity") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new DeviceGroupInner() - .withDescription("eyyvxyqjpkcat") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new DeviceGroupInner() - .withDescription("canoaeupf") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new DeviceGroupInner() - .withDescription("zmyzydagf") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU))) - .withNextLink("tki"); - model = BinaryData.fromObject(model).toObject(DeviceGroupListResult.class); - Assertions.assertEquals("bvyvdcsity", model.value().get(0).description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.value().get(0).osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.value().get(0).updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.value().get(0).allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.value().get(0).regionalDataBoundary()); - Assertions.assertEquals("tki", model.nextLink()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java deleted file mode 100644 index 445027d88fdb7..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java +++ /dev/null @@ -1,46 +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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupProperties; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; -import org.junit.jupiter.api.Assertions; - -public final class DeviceGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceGroupProperties model = - BinaryData - .fromString( - "{\"description\":\"iqzbq\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Deleting\"}") - .toObject(DeviceGroupProperties.class); - Assertions.assertEquals("iqzbq", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceGroupProperties model = - new DeviceGroupProperties() - .withDescription("iqzbq") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.NONE); - model = BinaryData.fromObject(model).toObject(DeviceGroupProperties.class); - Assertions.assertEquals("iqzbq", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java deleted file mode 100644 index b0e15ed3d3827..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java +++ /dev/null @@ -1,46 +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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupUpdateProperties; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; -import org.junit.jupiter.api.Assertions; - -public final class DeviceGroupUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceGroupUpdateProperties model = - BinaryData - .fromString( - "{\"description\":\"cocmnyyaztt\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\"}") - .toObject(DeviceGroupUpdateProperties.class); - Assertions.assertEquals("cocmnyyaztt", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceGroupUpdateProperties model = - new DeviceGroupUpdateProperties() - .withDescription("cocmnyyaztt") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU); - model = BinaryData.fromObject(model).toObject(DeviceGroupUpdateProperties.class); - Assertions.assertEquals("cocmnyyaztt", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java deleted file mode 100644 index 2fef5ffd910aa..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java +++ /dev/null @@ -1,46 +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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.DeviceGroupUpdate; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; -import org.junit.jupiter.api.Assertions; - -public final class DeviceGroupUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceGroupUpdate model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"xdbabphlwr\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\"}}") - .toObject(DeviceGroupUpdate.class); - Assertions.assertEquals("xdbabphlwr", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceGroupUpdate model = - new DeviceGroupUpdate() - .withDescription("xdbabphlwr") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU); - model = BinaryData.fromObject(model).toObject(DeviceGroupUpdate.class); - Assertions.assertEquals("xdbabphlwr", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.java deleted file mode 100644 index cf62cf1fa5eb8..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; -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 DeviceGroupsCountDevicesWithResponseMockTests { - @Test - public void testCountDevicesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":802895356}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CountDeviceResponse response = - manager - .deviceGroups() - .countDevicesWithResponse("sphyoulpjrvxa", "l", "vimjwos", "tx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(802895356, response.value()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java deleted file mode 100644 index cb460507b2e43..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,84 +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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.DeviceGroup; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; -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 DeviceGroupsCreateOrUpdateMockTests { - @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\":{\"description\":\"oduhp\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":false,\"provisioningState\":\"Succeeded\"},\"id\":\"xqugjhkycubedd\",\"name\":\"ssofwqmzqa\",\"type\":\"krmnjijpxacqqud\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeviceGroup response = - manager - .deviceGroups() - .define("dunyg") - .withExistingProduct("cskfcktqumiekk", "zzikhlyfjhdg", "gge") - .withDescription("idb") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU) - .create(); - - Assertions.assertEquals("oduhp", response.description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, response.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, response.regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java deleted file mode 100644 index ad74f2a3ce680..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.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.sphere.AzureSphereManager; -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 DeviceGroupsDeleteMockTests { - @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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .deviceGroups() - .delete("wczelpci", "elsfeaen", "abfatkl", "dxbjhwuaanozj", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.java deleted file mode 100644 index c15479bbbd942..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.DeviceGroup; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; -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 DeviceGroupsGetWithResponseMockTests { - @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\":{\"description\":\"npkukghimdblx\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":false,\"provisioningState\":\"Accepted\"},\"id\":\"szkkfoqre\",\"name\":\"fkzikfj\",\"type\":\"wneaiv\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeviceGroup response = - manager - .deviceGroups() - .getWithResponse("mtdaa", "gdv", "vgpiohgwxrt", "udxepxgyqagv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("npkukghimdblx", response.description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, response.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java deleted file mode 100644 index a5388dfb9b504..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java +++ /dev/null @@ -1,87 +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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.DeviceGroup; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; -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 DeviceGroupsListByProductMockTests { - @Test - public void testListByProduct() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"ggxkallatmelwuip\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":false,\"provisioningState\":\"Accepted\"},\"id\":\"nayrhyrnxxmueedn\",\"name\":\"rdvstkwqqtch\",\"type\":\"alm\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .deviceGroups() - .listByProduct( - "tdtbnnhadooc", - "kvci", - "hnvpamqgxq", - "u", - 1862318440, - 443622503, - 1817330156, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ggxkallatmelwuip", response.iterator().next().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.iterator().next().osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.iterator().next().updatePolicy()); - Assertions - .assertEquals(AllowCrashDumpCollection.ENABLED, response.iterator().next().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.iterator().next().regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.java deleted file mode 100644 index e7cd923a440ba..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; -import org.junit.jupiter.api.Assertions; - -public final class DeviceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceInner model = - BinaryData - .fromString( - "{\"properties\":{\"deviceId\":\"wutttxfvjrbi\",\"chipSku\":\"hxepcyvahfnlj\",\"lastAvailableOsVersion\":\"qxj\",\"lastInstalledOsVersion\":\"ujqgidok\",\"lastOsUpdateUtc\":\"2021-09-28T11:40:31Z\",\"lastUpdateRequestUtc\":\"2021-11-13T00:56:49Z\",\"provisioningState\":\"Accepted\"},\"id\":\"gvcl\",\"name\":\"bgsncghkjeszzhb\",\"type\":\"jhtxfvgxbfsmxne\"}") - .toObject(DeviceInner.class); - Assertions.assertEquals("wutttxfvjrbi", model.deviceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceInner model = new DeviceInner().withDeviceId("wutttxfvjrbi"); - model = BinaryData.fromObject(model).toObject(DeviceInner.class); - Assertions.assertEquals("wutttxfvjrbi", model.deviceId()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java deleted file mode 100644 index 3241802fb0647..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class DeviceInsightInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceInsightInner model = - BinaryData - .fromString( - "{\"deviceId\":\"eggzfb\",\"description\":\"hfmvfaxkffe\",\"startTimestampUtc\":\"2021-04-21T05:15:54Z\",\"endTimestampUtc\":\"2021-05-15T04:16:32Z\",\"eventCategory\":\"hl\",\"eventClass\":\"m\",\"eventType\":\"zy\",\"eventCount\":2122365511}") - .toObject(DeviceInsightInner.class); - Assertions.assertEquals("eggzfb", model.deviceId()); - Assertions.assertEquals("hfmvfaxkffe", model.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-21T05:15:54Z"), model.startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T04:16:32Z"), model.endTimestampUtc()); - Assertions.assertEquals("hl", model.eventCategory()); - Assertions.assertEquals("m", model.eventClass()); - Assertions.assertEquals("zy", model.eventType()); - Assertions.assertEquals(2122365511, model.eventCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceInsightInner model = - new DeviceInsightInner() - .withDeviceId("eggzfb") - .withDescription("hfmvfaxkffe") - .withStartTimestampUtc(OffsetDateTime.parse("2021-04-21T05:15:54Z")) - .withEndTimestampUtc(OffsetDateTime.parse("2021-05-15T04:16:32Z")) - .withEventCategory("hl") - .withEventClass("m") - .withEventType("zy") - .withEventCount(2122365511); - model = BinaryData.fromObject(model).toObject(DeviceInsightInner.class); - Assertions.assertEquals("eggzfb", model.deviceId()); - Assertions.assertEquals("hfmvfaxkffe", model.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-21T05:15:54Z"), model.startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T04:16:32Z"), model.endTimestampUtc()); - Assertions.assertEquals("hl", model.eventCategory()); - Assertions.assertEquals("m", model.eventClass()); - Assertions.assertEquals("zy", model.eventType()); - Assertions.assertEquals(2122365511, model.eventCount()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java deleted file mode 100644 index 0fb84591ce8b2..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; -import com.azure.resourcemanager.sphere.models.DeviceListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeviceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"deviceId\":\"zsbbzoggigrxwb\",\"chipSku\":\"vjxxjnsp\",\"lastAvailableOsVersion\":\"ptkoenkoukn\",\"lastInstalledOsVersion\":\"dwtiukbldngkp\",\"lastOsUpdateUtc\":\"2021-05-04T07:17:38Z\",\"lastUpdateRequestUtc\":\"2021-05-19T00:57:25Z\",\"provisioningState\":\"Canceled\"},\"id\":\"xoegukgjnpiucgy\",\"name\":\"evqzntypmrbp\",\"type\":\"zcdrqjsdpydnfyhx\"},{\"properties\":{\"deviceId\":\"ejzicwifsjtt\",\"chipSku\":\"fbishcbkha\",\"lastAvailableOsVersion\":\"eyeam\",\"lastInstalledOsVersion\":\"hagalpbuxwgipwh\",\"lastOsUpdateUtc\":\"2021-04-24T13:32:45Z\",\"lastUpdateRequestUtc\":\"2021-08-18T16:08:42Z\",\"provisioningState\":\"Deleting\"},\"id\":\"hwankixzbinjepu\",\"name\":\"tmryw\",\"type\":\"uzoqft\"},{\"properties\":{\"deviceId\":\"zrnkcqvyxlwh\",\"chipSku\":\"sicohoqqnwvlry\",\"lastAvailableOsVersion\":\"w\",\"lastInstalledOsVersion\":\"eun\",\"lastOsUpdateUtc\":\"2021-02-20T01:45:10Z\",\"lastUpdateRequestUtc\":\"2021-10-16T07:10:15Z\",\"provisioningState\":\"Canceled\"},\"id\":\"zko\",\"name\":\"ocukoklyax\",\"type\":\"conuqszfkbeype\"},{\"properties\":{\"deviceId\":\"jmwvvj\",\"chipSku\":\"tcxsenhwlrs\",\"lastAvailableOsVersion\":\"rzpwvlqdqgbiq\",\"lastInstalledOsVersion\":\"ihkaetcktvfc\",\"lastOsUpdateUtc\":\"2021-07-13T01:18:13Z\",\"lastUpdateRequestUtc\":\"2021-09-20T06:05:50Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"m\",\"name\":\"ctq\",\"type\":\"jf\"}],\"nextLink\":\"brjcxe\"}") - .toObject(DeviceListResult.class); - Assertions.assertEquals("zsbbzoggigrxwb", model.value().get(0).deviceId()); - Assertions.assertEquals("brjcxe", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceListResult model = - new DeviceListResult() - .withValue( - Arrays - .asList( - new DeviceInner().withDeviceId("zsbbzoggigrxwb"), - new DeviceInner().withDeviceId("ejzicwifsjtt"), - new DeviceInner().withDeviceId("zrnkcqvyxlwh"), - new DeviceInner().withDeviceId("jmwvvj"))) - .withNextLink("brjcxe"); - model = BinaryData.fromObject(model).toObject(DeviceListResult.class); - Assertions.assertEquals("zsbbzoggigrxwb", model.value().get(0).deviceId()); - Assertions.assertEquals("brjcxe", model.nextLink()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.java deleted file mode 100644 index 20be7d4c930e1..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceProperties; -import org.junit.jupiter.api.Assertions; - -public final class DevicePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceProperties model = - BinaryData - .fromString( - "{\"deviceId\":\"pvecxgodeb\",\"chipSku\":\"kk\",\"lastAvailableOsVersion\":\"mpukgriw\",\"lastInstalledOsVersion\":\"zlfbxzpuzycispnq\",\"lastOsUpdateUtc\":\"2021-11-25T03:44:38Z\",\"lastUpdateRequestUtc\":\"2021-01-22T12:22:34Z\",\"provisioningState\":\"Succeeded\"}") - .toObject(DeviceProperties.class); - Assertions.assertEquals("pvecxgodeb", model.deviceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceProperties model = new DeviceProperties().withDeviceId("pvecxgodeb"); - model = BinaryData.fromObject(model).toObject(DeviceProperties.class); - Assertions.assertEquals("pvecxgodeb", model.deviceId()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.java deleted file mode 100644 index 3422ec72cc78d..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class DeviceUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceUpdateProperties model = - BinaryData.fromString("{\"deviceGroupId\":\"swzts\"}").toObject(DeviceUpdateProperties.class); - Assertions.assertEquals("swzts", model.deviceGroupId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceUpdateProperties model = new DeviceUpdateProperties().withDeviceGroupId("swzts"); - model = BinaryData.fromObject(model).toObject(DeviceUpdateProperties.class); - Assertions.assertEquals("swzts", model.deviceGroupId()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.java deleted file mode 100644 index c79fa66c09ae7..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.DeviceUpdate; -import org.junit.jupiter.api.Assertions; - -public final class DeviceUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceUpdate model = - BinaryData.fromString("{\"properties\":{\"deviceGroupId\":\"rhdwbavxbniw\"}}").toObject(DeviceUpdate.class); - Assertions.assertEquals("rhdwbavxbniw", model.deviceGroupId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceUpdate model = new DeviceUpdate().withDeviceGroupId("rhdwbavxbniw"); - model = BinaryData.fromObject(model).toObject(DeviceUpdate.class); - Assertions.assertEquals("rhdwbavxbniw", model.deviceGroupId()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.java deleted file mode 100644 index 520346241d37c..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Device; -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 DevicesCreateOrUpdateMockTests { - @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\":{\"deviceId\":\"wijnh\",\"chipSku\":\"svfycxzbfv\",\"lastAvailableOsVersion\":\"wvrvmtg\",\"lastInstalledOsVersion\":\"ppyostronzmyhgf\",\"lastOsUpdateUtc\":\"2021-12-09T16:00:11Z\",\"lastUpdateRequestUtc\":\"2021-05-13T00:47:52Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"cwaekrrjre\",\"name\":\"fxtsgum\",\"type\":\"jglikkxwslolb\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Device response = - manager - .devices() - .define("vblm") - .withExistingDeviceGroup("mfiibfggj", "ool", "rwxkvtkkgl", "qwjygvja") - .withDeviceId("zuhbxvvyhgsopb") - .create(); - - Assertions.assertEquals("wijnh", response.deviceId()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java deleted file mode 100644 index b8d82fa33e5b1..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.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.sphere.AzureSphereManager; -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 DevicesDeleteMockTests { - @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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .devices() - .delete("ob", "pg", "edkowepbqpcrfk", "wccsnjvcdwxlpqek", "tn", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java deleted file mode 100644 index a860a2190fcb6..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.CapabilityType; -import com.azure.resourcemanager.sphere.models.GenerateCapabilityImageRequest; -import com.azure.resourcemanager.sphere.models.SignedCapabilityImageResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -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 DevicesGenerateCapabilityImageMockTests { - @Test - public void testGenerateCapabilityImage() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"image\":\"qqaatjinrvgou\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SignedCapabilityImageResponse response = - manager - .devices() - .generateCapabilityImage( - "htjsying", - "fq", - "tmtdhtmdvypgik", - "gszywk", - "irryuzhlh", - new GenerateCapabilityImageRequest() - .withCapabilities( - Arrays - .asList( - CapabilityType.FIELD_SERVICING, - CapabilityType.APPLICATION_DEVELOPMENT, - CapabilityType.APPLICATION_DEVELOPMENT)), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.java deleted file mode 100644 index bbe62979f7baf..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Device; -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 DevicesGetWithResponseMockTests { - @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\":{\"deviceId\":\"ygz\",\"chipSku\":\"dnkfx\",\"lastAvailableOsVersion\":\"emdwzrmuhapfc\",\"lastInstalledOsVersion\":\"psqxq\",\"lastOsUpdateUtc\":\"2021-08-14T15:35:59Z\",\"lastUpdateRequestUtc\":\"2021-05-20T12:44:27Z\",\"provisioningState\":\"Canceled\"},\"id\":\"mgccelvezrypq\",\"name\":\"mfe\",\"type\":\"kerqwkyh\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Device response = - manager - .devices() - .getWithResponse( - "amvdkfwynwcvtbv", - "ayhmtnvyqiatkz", - "pcnp", - "zcjaesgvvsccy", - "jguq", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ygz", response.deviceId()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.java deleted file mode 100644 index 4d4bb7c5ec89d..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Device; -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 DevicesListByDeviceGroupMockTests { - @Test - public void testListByDeviceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"deviceId\":\"spughftqsxhq\",\"chipSku\":\"j\",\"lastAvailableOsVersion\":\"kndxdigrjgu\",\"lastInstalledOsVersion\":\"zdmsyqtfi\",\"lastOsUpdateUtc\":\"2020-12-25T23:20:44Z\",\"lastUpdateRequestUtc\":\"2021-09-23T10:33:57Z\",\"provisioningState\":\"Updating\"},\"id\":\"ingamvp\",\"name\":\"ho\",\"type\":\"zqzudph\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .devices() - .listByDeviceGroup( - "qmqhldvriii", "jnalghf", "vtvsexsowueluq", "hahhxvrhmzkwpj", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("spughftqsxhq", response.iterator().next().deviceId()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.java deleted file mode 100644 index 94189e9c6adc7..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.CapabilityType; -import com.azure.resourcemanager.sphere.models.GenerateCapabilityImageRequest; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GenerateCapabilityImageRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GenerateCapabilityImageRequest model = - BinaryData - .fromString("{\"capabilities\":[\"ApplicationDevelopment\"]}") - .toObject(GenerateCapabilityImageRequest.class); - Assertions.assertEquals(CapabilityType.APPLICATION_DEVELOPMENT, model.capabilities().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GenerateCapabilityImageRequest model = - new GenerateCapabilityImageRequest() - .withCapabilities(Arrays.asList(CapabilityType.APPLICATION_DEVELOPMENT)); - model = BinaryData.fromObject(model).toObject(GenerateCapabilityImageRequest.class); - Assertions.assertEquals(CapabilityType.APPLICATION_DEVELOPMENT, model.capabilities().get(0)); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.java deleted file mode 100644 index f234938a021bc..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import org.junit.jupiter.api.Assertions; - -public final class ImageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageInner model = - BinaryData - .fromString( - "{\"properties\":{\"image\":\"mbe\",\"imageId\":\"pbhtqqrolfpfpsa\",\"imageName\":\"bquxigjy\",\"regionalDataBoundary\":\"EU\",\"uri\":\"aoyfhrtxilnerkuj\",\"description\":\"vlejuvfqa\",\"componentId\":\"lyxwjkcprbnwbx\",\"imageType\":\"OneBl\",\"provisioningState\":\"Provisioning\"},\"id\":\"vpys\",\"name\":\"zdn\",\"type\":\"uj\"}") - .toObject(ImageInner.class); - Assertions.assertEquals("mbe", model.image()); - Assertions.assertEquals("pbhtqqrolfpfpsa", model.imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageInner model = - new ImageInner() - .withImage("mbe") - .withImageId("pbhtqqrolfpfpsa") - .withRegionalDataBoundary(RegionalDataBoundary.EU); - model = BinaryData.fromObject(model).toObject(ImageInner.class); - Assertions.assertEquals("mbe", model.image()); - Assertions.assertEquals("pbhtqqrolfpfpsa", model.imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java deleted file mode 100644 index 1178f1b98e760..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import com.azure.resourcemanager.sphere.models.ImageListResult; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"image\":\"duuji\",\"imageId\":\"jczdzevndh\",\"imageName\":\"wpdappdsbdkv\",\"regionalDataBoundary\":\"EU\",\"uri\":\"feusnhut\",\"description\":\"ltmrldh\",\"componentId\":\"jzzd\",\"imageType\":\"Services\",\"provisioningState\":\"Provisioning\"},\"id\":\"oc\",\"name\":\"geablgphuticndvk\",\"type\":\"ozwyiftyhxhuro\"},{\"properties\":{\"image\":\"yxolniwp\",\"imageId\":\"ukjfkgiawxklr\",\"imageName\":\"lwckbasyypnddhs\",\"regionalDataBoundary\":\"EU\",\"uri\":\"cph\",\"description\":\"koty\",\"componentId\":\"gou\",\"imageType\":\"UpdateCertStore\",\"provisioningState\":\"Accepted\"},\"id\":\"i\",\"name\":\"wyqkgfgibm\",\"type\":\"dgak\"},{\"properties\":{\"image\":\"rxybz\",\"imageId\":\"e\",\"imageName\":\"ytb\",\"regionalDataBoundary\":\"None\",\"uri\":\"ouf\",\"description\":\"mnkzsmod\",\"componentId\":\"lougpbkw\",\"imageType\":\"ManifestSet\",\"provisioningState\":\"Failed\"},\"id\":\"uqktap\",\"name\":\"pwgcuertu\",\"type\":\"kdosvqw\"}],\"nextLink\":\"mdgbbjfdd\"}") - .toObject(ImageListResult.class); - Assertions.assertEquals("duuji", model.value().get(0).image()); - Assertions.assertEquals("jczdzevndh", model.value().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.value().get(0).regionalDataBoundary()); - Assertions.assertEquals("mdgbbjfdd", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageListResult model = - new ImageListResult() - .withValue( - Arrays - .asList( - new ImageInner() - .withImage("duuji") - .withImageId("jczdzevndh") - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new ImageInner() - .withImage("yxolniwp") - .withImageId("ukjfkgiawxklr") - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new ImageInner() - .withImage("rxybz") - .withImageId("e") - .withRegionalDataBoundary(RegionalDataBoundary.NONE))) - .withNextLink("mdgbbjfdd"); - model = BinaryData.fromObject(model).toObject(ImageListResult.class); - Assertions.assertEquals("duuji", model.value().get(0).image()); - Assertions.assertEquals("jczdzevndh", model.value().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.value().get(0).regionalDataBoundary()); - Assertions.assertEquals("mdgbbjfdd", model.nextLink()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.java deleted file mode 100644 index 2ccbbac3225ad..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ImageProperties; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import org.junit.jupiter.api.Assertions; - -public final class ImagePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageProperties model = - BinaryData - .fromString( - "{\"image\":\"uhmuouqfprwzwbn\",\"imageId\":\"itnwuizgazxufi\",\"imageName\":\"ckyfih\",\"regionalDataBoundary\":\"None\",\"uri\":\"fvzwdzuhty\",\"description\":\"isdkfthwxmnteiw\",\"componentId\":\"pvkmijcmmxdcuf\",\"imageType\":\"FwConfig\",\"provisioningState\":\"Accepted\"}") - .toObject(ImageProperties.class); - Assertions.assertEquals("uhmuouqfprwzwbn", model.image()); - Assertions.assertEquals("itnwuizgazxufi", model.imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageProperties model = - new ImageProperties() - .withImage("uhmuouqfprwzwbn") - .withImageId("itnwuizgazxufi") - .withRegionalDataBoundary(RegionalDataBoundary.NONE); - model = BinaryData.fromObject(model).toObject(ImageProperties.class); - Assertions.assertEquals("uhmuouqfprwzwbn", model.image()); - Assertions.assertEquals("itnwuizgazxufi", model.imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.java deleted file mode 100644 index f4ae052642594..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Image; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -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 ImagesCreateOrUpdateMockTests { - @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\":{\"image\":\"smond\",\"imageId\":\"quxvypomgkop\",\"imageName\":\"hojvpajqgxysmocm\",\"regionalDataBoundary\":\"None\",\"uri\":\"vmkcx\",\"description\":\"apvhelxprgly\",\"componentId\":\"dd\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Succeeded\"},\"id\":\"uejrjxgc\",\"name\":\"qibrhosxsdqrhzoy\",\"type\":\"i\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Image response = - manager - .images() - .define("ld") - .withExistingCatalog("sotbob", "dopcjwvnh") - .withImage("xcxrsl") - .withImageId("utwu") - .withRegionalDataBoundary(RegionalDataBoundary.NONE) - .create(); - - Assertions.assertEquals("smond", response.image()); - Assertions.assertEquals("quxvypomgkop", response.imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.java deleted file mode 100644 index f240ed4fe1e8c..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.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.sphere.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.sphere.AzureSphereManager; -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 ImagesDeleteMockTests { - @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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.images().delete("apnedgfbcvkc", "q", "pkeqdcvdrhvoo", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.java deleted file mode 100644 index 42ed4f7bc3cee..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Image; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -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 ImagesGetWithResponseMockTests { - @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\":{\"image\":\"clvit\",\"imageId\":\"qzonosggbhcohf\",\"imageName\":\"sjnkal\",\"regionalDataBoundary\":\"EU\",\"uri\":\"iswac\",\"description\":\"gdkz\",\"componentId\":\"wkfvhqcrailvp\",\"imageType\":\"UpdateCertStore\",\"provisioningState\":\"Succeeded\"},\"id\":\"flrwd\",\"name\":\"hdlxyjrxsagafcn\",\"type\":\"hgw\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Image response = - manager - .images() - .getWithResponse("fgohdneuelfphs", "yhtozfikdowwqu", "v", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("clvit", response.image()); - Assertions.assertEquals("qzonosggbhcohf", response.imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, response.regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java deleted file mode 100644 index 7ca2213eed516..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Image; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -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 ImagesListByCatalogMockTests { - @Test - public void testListByCatalog() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"image\":\"xbxwa\",\"imageId\":\"ogqxndlkzgxhuri\",\"imageName\":\"bpodxunkbebxm\",\"regionalDataBoundary\":\"None\",\"uri\":\"ntwlrbqtkoie\",\"description\":\"eotg\",\"componentId\":\"l\",\"imageType\":\"RecoveryManifest\",\"provisioningState\":\"Canceled\"},\"id\":\"lauwzizxbmpgcjef\",\"name\":\"zmuvpbttdumorppx\",\"type\":\"bmnzbtbhjpgl\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .images() - .listByCatalog( - "dltfz", - "mhhv", - "gureodkwobdag", - 933543231, - 1861593827, - 1583051460, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xbxwa", response.iterator().next().image()); - Assertions.assertEquals("ogqxndlkzgxhuri", response.iterator().next().imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.iterator().next().regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.java deleted file mode 100644 index 388386523a1c7..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.ListDeviceGroupsRequest; -import org.junit.jupiter.api.Assertions; - -public final class ListDeviceGroupsRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListDeviceGroupsRequest model = - BinaryData.fromString("{\"deviceGroupName\":\"yexfwh\"}").toObject(ListDeviceGroupsRequest.class); - Assertions.assertEquals("yexfwh", model.deviceGroupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListDeviceGroupsRequest model = new ListDeviceGroupsRequest().withDeviceGroupName("yexfwh"); - model = BinaryData.fromObject(model).toObject(ListDeviceGroupsRequest.class); - Assertions.assertEquals("yexfwh", model.deviceGroupName()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationDisplayTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationDisplayTests.java deleted file mode 100644 index 7b49a47063ce6..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java deleted file mode 100644 index 2440972f8cc6f..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.OperationInner; -import com.azure.resourcemanager.sphere.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java deleted file mode 100644 index 1e4a38ab5f2e8..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java deleted file mode 100644 index b2433e37aaf2f..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"xbzpfzab\",\"isDataAction\":false,\"display\":{\"provider\":\"xwtctyqiklbbovpl\",\"resource\":\"bhvgy\",\"operation\":\"uosvmkfssxqukk\",\"description\":\"l\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java deleted file mode 100644 index dbef79838d8f0..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java +++ /dev/null @@ -1,70 +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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner; -import com.azure.resourcemanager.sphere.models.PagedDeviceInsight; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PagedDeviceInsightTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PagedDeviceInsight model = - BinaryData - .fromString( - "{\"value\":[{\"deviceId\":\"w\",\"description\":\"hzdobpxjmflbvvnc\",\"startTimestampUtc\":\"2021-11-01T14:14:41Z\",\"endTimestampUtc\":\"2021-05-23T11:48:05Z\",\"eventCategory\":\"cciw\",\"eventClass\":\"zjuqkhrsaj\",\"eventType\":\"wkuofoskghsauu\",\"eventCount\":2118838793},{\"deviceId\":\"jmvxie\",\"description\":\"uugidyjrrfby\",\"startTimestampUtc\":\"2021-09-15T05:38:02Z\",\"endTimestampUtc\":\"2021-05-02T14:53:40Z\",\"eventCategory\":\"v\",\"eventClass\":\"xc\",\"eventType\":\"onpc\",\"eventCount\":316608134}],\"nextLink\":\"cohslkev\"}") - .toObject(PagedDeviceInsight.class); - Assertions.assertEquals("w", model.value().get(0).deviceId()); - Assertions.assertEquals("hzdobpxjmflbvvnc", model.value().get(0).description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T14:14:41Z"), model.value().get(0).startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T11:48:05Z"), model.value().get(0).endTimestampUtc()); - Assertions.assertEquals("cciw", model.value().get(0).eventCategory()); - Assertions.assertEquals("zjuqkhrsaj", model.value().get(0).eventClass()); - Assertions.assertEquals("wkuofoskghsauu", model.value().get(0).eventType()); - Assertions.assertEquals(2118838793, model.value().get(0).eventCount()); - Assertions.assertEquals("cohslkev", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PagedDeviceInsight model = - new PagedDeviceInsight() - .withValue( - Arrays - .asList( - new DeviceInsightInner() - .withDeviceId("w") - .withDescription("hzdobpxjmflbvvnc") - .withStartTimestampUtc(OffsetDateTime.parse("2021-11-01T14:14:41Z")) - .withEndTimestampUtc(OffsetDateTime.parse("2021-05-23T11:48:05Z")) - .withEventCategory("cciw") - .withEventClass("zjuqkhrsaj") - .withEventType("wkuofoskghsauu") - .withEventCount(2118838793), - new DeviceInsightInner() - .withDeviceId("jmvxie") - .withDescription("uugidyjrrfby") - .withStartTimestampUtc(OffsetDateTime.parse("2021-09-15T05:38:02Z")) - .withEndTimestampUtc(OffsetDateTime.parse("2021-05-02T14:53:40Z")) - .withEventCategory("v") - .withEventClass("xc") - .withEventType("onpc") - .withEventCount(316608134))) - .withNextLink("cohslkev"); - model = BinaryData.fromObject(model).toObject(PagedDeviceInsight.class); - Assertions.assertEquals("w", model.value().get(0).deviceId()); - Assertions.assertEquals("hzdobpxjmflbvvnc", model.value().get(0).description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T14:14:41Z"), model.value().get(0).startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T11:48:05Z"), model.value().get(0).endTimestampUtc()); - Assertions.assertEquals("cciw", model.value().get(0).eventCategory()); - Assertions.assertEquals("zjuqkhrsaj", model.value().get(0).eventClass()); - Assertions.assertEquals("wkuofoskghsauu", model.value().get(0).eventType()); - Assertions.assertEquals(2118838793, model.value().get(0).eventCount()); - Assertions.assertEquals("cohslkev", model.nextLink()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.java deleted file mode 100644 index 7080cd4500841..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ProductInner; -import org.junit.jupiter.api.Assertions; - -public final class ProductInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"pnazzm\",\"provisioningState\":\"Updating\"},\"id\":\"unmpxttd\",\"name\":\"hrbnlankxmyskpbh\",\"type\":\"nbtkcxywnytnr\"}") - .toObject(ProductInner.class); - Assertions.assertEquals("pnazzm", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductInner model = new ProductInner().withDescription("pnazzm"); - model = BinaryData.fromObject(model).toObject(ProductInner.class); - Assertions.assertEquals("pnazzm", model.description()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java deleted file mode 100644 index d3e581055b777..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java +++ /dev/null @@ -1,35 +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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ProductInner; -import com.azure.resourcemanager.sphere.models.ProductListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProductListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"yydhibnuqqk\",\"provisioningState\":\"Accepted\"},\"id\":\"a\",\"name\":\"rgvtqag\",\"type\":\"buynhijggm\"}],\"nextLink\":\"fsiarbutr\"}") - .toObject(ProductListResult.class); - Assertions.assertEquals("yydhibnuqqk", model.value().get(0).description()); - Assertions.assertEquals("fsiarbutr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductListResult model = - new ProductListResult() - .withValue(Arrays.asList(new ProductInner().withDescription("yydhibnuqqk"))) - .withNextLink("fsiarbutr"); - model = BinaryData.fromObject(model).toObject(ProductListResult.class); - Assertions.assertEquals("yydhibnuqqk", model.value().get(0).description()); - Assertions.assertEquals("fsiarbutr", model.nextLink()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.java deleted file mode 100644 index f87b202e7bc39..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ProductProperties; -import org.junit.jupiter.api.Assertions; - -public final class ProductPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductProperties model = - BinaryData - .fromString("{\"description\":\"yn\",\"provisioningState\":\"Provisioning\"}") - .toObject(ProductProperties.class); - Assertions.assertEquals("yn", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductProperties model = new ProductProperties().withDescription("yn"); - model = BinaryData.fromObject(model).toObject(ProductProperties.class); - Assertions.assertEquals("yn", model.description()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.java deleted file mode 100644 index 5343929ecb72f..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ProductUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class ProductUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductUpdateProperties model = - BinaryData.fromString("{\"description\":\"zfcl\"}").toObject(ProductUpdateProperties.class); - Assertions.assertEquals("zfcl", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductUpdateProperties model = new ProductUpdateProperties().withDescription("zfcl"); - model = BinaryData.fromObject(model).toObject(ProductUpdateProperties.class); - Assertions.assertEquals("zfcl", model.description()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.java deleted file mode 100644 index 0334345eb6613..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.ProductUpdate; -import org.junit.jupiter.api.Assertions; - -public final class ProductUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductUpdate model = - BinaryData.fromString("{\"properties\":{\"description\":\"by\"}}").toObject(ProductUpdate.class); - Assertions.assertEquals("by", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductUpdate model = new ProductUpdate().withDescription("by"); - model = BinaryData.fromObject(model).toObject(ProductUpdate.class); - Assertions.assertEquals("by", model.description()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.java deleted file mode 100644 index cd4aee8357873..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; -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 ProductsCountDevicesWithResponseMockTests { - @Test - public void testCountDevicesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":1309534736}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CountDeviceResponse response = - manager - .products() - .countDevicesWithResponse("syrsndsytgadgvra", "aeneqnzarrwl", "uu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(1309534736, response.value()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.java deleted file mode 100644 index a8a1ec3e7089c..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Product; -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 ProductsCreateOrUpdateMockTests { - @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\":{\"description\":\"orgjhxbldt\",\"provisioningState\":\"Succeeded\"},\"id\":\"rlkdmtncvokotl\",\"name\":\"xdy\",\"type\":\"gsyocogj\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .define("ox") - .withExistingCatalog("swsrms", "yzrpzbchckqqzq") - .withDescription("suiizynkedyat") - .create(); - - Assertions.assertEquals("orgjhxbldt", response.description()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.java deleted file mode 100644 index 4348987e39942..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.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.sphere.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.sphere.AzureSphereManager; -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 ProductsDeleteMockTests { - @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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.products().delete("dlpichkoymkcdyhb", "kkpwdreqnovvq", "ovljxywsu", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.java deleted file mode 100644 index 837c76e3e7b04..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.DeviceGroup; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; -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 ProductsGenerateDefaultDeviceGroupsMockTests { - @Test - public void testGenerateDefaultDeviceGroups() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"wifto\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Failed\"},\"id\":\"aknynfsynljphuop\",\"name\":\"odlqiyntor\",\"type\":\"ihleos\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().generateDefaultDeviceGroups("fqka", "e", "iipfpubj", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wifto", response.iterator().next().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.iterator().next().osFeedType()); - Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, response.iterator().next().updatePolicy()); - Assertions - .assertEquals(AllowCrashDumpCollection.DISABLED, response.iterator().next().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.iterator().next().regionalDataBoundary()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java deleted file mode 100644 index f8137c9e85dca..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Product; -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 ProductsGetWithResponseMockTests { - @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\":{\"description\":\"asipqiio\",\"provisioningState\":\"Accepted\"},\"id\":\"qerpqlpqwcc\",\"name\":\"uqgbdbutauvfbt\",\"type\":\"uwhhmhykojoxafn\"}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .getWithResponse("nwashrtd", "kcnqxwbpo", "ulpiuj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("asipqiio", response.description()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.java deleted file mode 100644 index 7484fb588ac43..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.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.sphere.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.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.Product; -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 ProductsListByCatalogMockTests { - @Test - public void testListByCatalog() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"wfluszdt\",\"provisioningState\":\"Succeeded\"},\"id\":\"kwofyyvoq\",\"name\":\"cpi\",\"type\":\"xpbtgiwbwo\"}]}"; - - 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); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().listByCatalog("m", "qyib", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wfluszdt", response.iterator().next().description()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.java deleted file mode 100644 index 6858ae6e401c7..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest; -import org.junit.jupiter.api.Assertions; - -public final class ProofOfPossessionNonceRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProofOfPossessionNonceRequest model = - BinaryData.fromString("{\"proofOfPossessionNonce\":\"kwt\"}").toObject(ProofOfPossessionNonceRequest.class); - Assertions.assertEquals("kwt", model.proofOfPossessionNonce()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProofOfPossessionNonceRequest model = new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("kwt"); - model = BinaryData.fromObject(model).toObject(ProofOfPossessionNonceRequest.class); - Assertions.assertEquals("kwt", model.proofOfPossessionNonce()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.java deleted file mode 100644 index 4295b284bcd1d..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ProofOfPossessionNonceResponseInner; - -public final class ProofOfPossessionNonceResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProofOfPossessionNonceResponseInner model = - BinaryData - .fromString( - "{\"certificate\":\"xbnjbiksq\",\"status\":\"Inactive\",\"subject\":\"sainqpjwnzl\",\"thumbprint\":\"fmppe\",\"expiryUtc\":\"2021-03-28T22:28:31Z\",\"notBeforeUtc\":\"2021-11-23T16:03:48Z\",\"provisioningState\":\"Provisioning\"}") - .toObject(ProofOfPossessionNonceResponseInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProofOfPossessionNonceResponseInner model = new ProofOfPossessionNonceResponseInner(); - model = BinaryData.fromObject(model).toObject(ProofOfPossessionNonceResponseInner.class); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java deleted file mode 100644 index 54c09a9375131..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.SignedCapabilityImageResponseInner; - -public final class SignedCapabilityImageResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SignedCapabilityImageResponseInner model = - BinaryData.fromString("{\"image\":\"nxytxh\"}").toObject(SignedCapabilityImageResponseInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SignedCapabilityImageResponseInner model = new SignedCapabilityImageResponseInner(); - model = BinaryData.fromObject(model).toObject(SignedCapabilityImageResponseInner.class); - } -}