Skip to content

Commit

Permalink
Fix // @embedmeStart and // @embedmeEnd for live test cases(#42357)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-hongli1 authored Oct 16, 2024
1 parent d7aba01 commit 38f0fdf
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ public void testCreateApiCenterService() {
Service service = null;
try {
String serviceName = "service" + randomPadding();
// @embedStart
// @embedmeStart
service = apiCenterManager.services()
.define(serviceName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.create();
// @embedEnd
// @embedmeEnd
service.refresh();
Assertions.assertEquals(serviceName, service.name());
Assertions.assertEquals(serviceName, apiCenterManager.services().getById(service.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void testCreateComponent() {
try {
String componentName = "component" + randomPadding;
String spaceName = "space" + randomPadding;
// @embedStart
// @embedmeStart
Workspace workspace = logAnalyticsManager.workspaces()
.define(spaceName)
.withRegion(REGION)
Expand All @@ -99,7 +99,7 @@ public void testCreateComponent() {
.withWorkspaceResourceId(workspace.id())
.withIngestionMode(IngestionMode.LOG_ANALYTICS)
.create();
// @embedEnd
// @embedmeEnd
component.refresh();
Assertions.assertEquals(component.name(), componentName);
Assertions.assertEquals(component.name(), applicationInsightsManager.components().getById(component.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void tesCreateChaosTarget() {
Target target = null;
String kvName = "kv" + randomPadding();
try {
// @embedStart
// @embedmeStart
keyVaultManager.vaults()
.define(kvName)
.withRegion(REGION)
Expand All @@ -102,7 +102,7 @@ public void tesCreateChaosTarget() {
.withLocation(REGION.name())
.withProperties(Collections.emptyMap())
);
// @embedEnd
// @embedmeEnd
Assertions.assertEquals(target.name(), "microsoft-keyvault");
Assertions.assertTrue(Objects.nonNull(chaosManager.targets().get(
resourceGroupName, "microsoft.keyvault",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ public void testCreateFleet() {
Fleet fleet = null;
try {
String fleetName = "fleet" + randomPadding();
// @embedStart
// @embedmeStart
fleet = containerServiceFleetManager.fleets()
.define(fleetName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.create();
// @embedEnd
// @embedmeEnd
fleet.refresh();
Assertions.assertEquals(fleet.name(), fleetName);
Assertions.assertEquals(fleet.name(), containerServiceFleetManager.fleets().getById(fleet.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ public void testCreateGrafana() {
ManagedGrafana grafana = null;
try {
String grafanaName = "grafana" + randomPadding();
// @embedStart
// @embedmeStart
grafana = dashboardManager.grafanas()
.define(grafanaName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.withIdentity(new ManagedServiceIdentity()
.withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED))
.create();
// @embedEnd
// @embedmeEnd
grafana.refresh();
Assertions.assertEquals(grafana.name(), grafanaName);
Assertions.assertEquals(grafana.name(), dashboardManager.grafanas().getById(grafana.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public void testCreateAccount() {
Account account = null;
try {
String accountName = "account" + randomPadding();
// @embedStart
// @embedmeStart
account = deviceUpdateManager.accounts()
.define(accountName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.create();
// @embedEnd
// @embedmeEnd
account.refresh();
Assertions.assertEquals(account.name(), accountName);
Assertions.assertEquals(account.name(), deviceUpdateManager.accounts().getById(account.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ public void test() {
Lab lab = null;
try {
String labName = "lab" + randomPadding();
// @embedStart
// @embedmeStart
lab = devTestLabsManager.labs()
.define(labName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.create();
// @embedEnd
// @embedmeEnd
lab.refresh();
Assertions.assertEquals(lab.name(), labName);
Assertions.assertEquals(lab.name(), devTestLabsManager.labs().getById(lab.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void testCreateElasticSan() {
ElasticSan elasticSan = null;
try {
String elasticSanName = "elasticsan" + randomPadding();
// @embedStart
// @embedmeStart
elasticSan = elasticSanManager.elasticSans()
.define(elasticSanName)
.withRegion(REGION)
Expand All @@ -83,7 +83,7 @@ public void testCreateElasticSan() {
.withBaseSizeTiB(1L)
.withExtendedCapacitySizeTiB(1L)
.create();
// @embedEnd
// @embedmeEnd
elasticSan.refresh();
Assertions.assertEquals(elasticSan.name(), elasticSanName);
Assertions.assertEquals(elasticSan.name(), elasticSanManager.elasticSans().getById(elasticSan.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ public void testCreateWebApplicationFirewallPolicy() {
WebApplicationFirewallPolicy policy = null;
try {
String policyName = "policy" + randomPadding();
// @embedStart
// @embedmeStart
policy = frontDoorManager.policies()
.define(policyName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.create();
// @embedEnd
// @embedmeEnd
policy.refresh();
Assertions.assertEquals(policyName, policy.name());
Assertions.assertEquals(policyName, frontDoorManager.policies().getById(policy.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ public void testCreateHealthcareWorkspace() {
try {
String randomPadding = randomPadding();
String workspaceName = "workspace" + randomPadding;
// @embedStart
// @embedmeStart
workspace = healthcareApisManager.workspaces()
.define(workspaceName)
.withExistingResourceGroup(resourceGroupName)
.withRegion(REGION)
.withProperties(new WorkspaceProperties().withPublicNetworkAccess(PublicNetworkAccess.DISABLED))
.create();
// @embedEnd
// @embedmeEnd
workspace.refresh();
Assertions.assertEquals(workspace.name(), workspaceName);
Assertions.assertEquals(workspace.name(), healthcareApisManager.workspaces().getById(workspace.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void testCreateImageTemplate() {
.withVersion("latest"))
.withBuildTimeoutInMinutes(0)
.create();
// @embedEnd
// @embedmeEnd
imageTemplate.refresh();
Assertions.assertEquals(imageTemplate.name(), templateName);
Assertions.assertEquals(imageTemplate.name(), imageBuilderManager.virtualMachineImageTemplates().getById(imageTemplate.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ public void testCreateWorkspace() {
Workspace workspace = null;
try {
String spaceName = "space" + randomPadding();
// @embedStart
// @embedmeStart
workspace = ioTFirmwareDefenseManager.workspaces()
.define(spaceName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.create();
// @embedEnd
// @embedmeEnd
workspace.refresh();
Assertions.assertEquals(spaceName, workspace.name());
Assertions.assertEquals(spaceName, ioTFirmwareDefenseManager.workspaces().getById(workspace.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void testCreateCluster() {
Cluster cluster = null;
try {
String clusterName = "cluster" + randomPadding();
// @embedStart
// @embedmeStart
cluster = kustoManager.clusters()
.define(clusterName)
.withRegion(REGION)
Expand All @@ -84,7 +84,7 @@ public void testCreateCluster() {
.withCapacity(1)
.withTier(AzureSkuTier.BASIC))
.create();
// @embedEnd
// @embedmeEnd
cluster.refresh();
Assertions.assertEquals(cluster.name(), clusterName);
Assertions.assertEquals(cluster.name(), kustoManager.clusters().getById(cluster.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ public void testCreateWorkspace() {
Workspace workspace = null;
try {
String spaceName = "space" + randomPadding();
// @embedStart
// @embedmeStart
workspace = logAnalyticsManager.workspaces()
.define(spaceName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.create();
// @embedEnd
// @embedmeEnd
workspace.refresh();
Assertions.assertEquals(workspace.name(), spaceName);
Assertions.assertEquals(workspace.name(), logAnalyticsManager.workspaces().getById(workspace.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ public void testCreateLocalRulestack() {
LocalRulestackResource localRulestackResource = null;
try {
String localRulestackName = "localRulestack" + randomPadding();
// @embedStart
// @embedmeStart
localRulestackResource = paloAltoNetworksNgfwManager.localRulestacks()
.define(localRulestackName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.withDefaultMode(DefaultMode.NONE)
.withScope(ScopeType.LOCAL)
.create();
// @embedEnd
// @embedmeEnd
localRulestackResource.refresh();
Assertions.assertEquals(localRulestackResource.name(), localRulestackName);
Assertions.assertEquals(localRulestackResource.name(), paloAltoNetworksNgfwManager.localRulestacks().getById(localRulestackResource.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void testCreateManagedCluster() {
String clusterName = "cluster" + randomPadding();
String adminUser = "user" + randomPadding();
String adminPassWord = UUID.randomUUID().toString().replace("-", "@").substring(0, 13);
// @embedStart
// @embedmeStart
managedCluster = serviceFabricManagedClustersManager
.managedClusters()
.define(clusterName)
Expand All @@ -89,7 +89,7 @@ public void testCreateManagedCluster() {
.withClientConnectionPort(19000)
.withHttpGatewayConnectionPort(19080)
.create();
// @embedEnd
// @embedmeEnd
managedCluster.refresh();
Assertions.assertEquals(clusterName, managedCluster.name());
Assertions.assertEquals(clusterName, serviceFabricManagedClustersManager.managedClusters().getById(managedCluster.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ public void testCreateTrafficController() {
TrafficController trafficController = null;
try {
String interfaceName = "interface" + randomPadding();
// @embedStart
// @embedmeStart
trafficController = trafficControllerManager.trafficControllerInterfaces()
.define(interfaceName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.create();
// @embedEnd
// @embedmeEnd
Assertions.assertEquals(interfaceName, trafficController.name());
Assertions.assertEquals(trafficController.name(),
trafficControllerManager.trafficControllerInterfaces().getById(trafficController.id()).name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public void testCreateCatalog() {
Catalog catalog = null;
try {
String catalogName = "catalog" + randomPadding();
// @embedStart
// @embedmeStart
catalog = azureSphereManager.catalogs()
.define(catalogName)
.withRegion(REGION_GLOBAL)
.withExistingResourceGroup(resourceGroupName)
.create();
// @embedEnd
// @embedmeEnd
catalog.refresh();
Assertions.assertEquals(catalogName, catalog.name());
Assertions.assertEquals(catalogName, azureSphereManager.catalogs().getById(catalog.id()).name());
Expand Down

0 comments on commit 38f0fdf

Please sign in to comment.