Skip to content

Commit

Permalink
mgmt, migrate test-proxy (#36051)
Browse files Browse the repository at this point in the history
monitor
msi
private dns
search
servicebus
traffic monitor
  • Loading branch information
weidongxu-microsoft authored Jul 25, 2023
1 parent 153f274 commit 6952625
Show file tree
Hide file tree
Showing 51 changed files with 75 additions and 11,411 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.test.models.TestProxySanitizer;
import com.azure.core.test.models.TestProxySanitizerType;
import com.azure.resourcemanager.eventhubs.models.AccessRights;
import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationKey;
import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationRule;
Expand Down Expand Up @@ -55,15 +53,6 @@ public class EventHubTests extends ResourceManagerTestProxyTestBase {
private String rgName = "";
private final Region region = Region.US_EAST;

public EventHubTests() {
addSanitizers(
new TestProxySanitizer(String.format("$..%s", "aliasPrimaryConnectionString"), null, REDACTED_VALUE, TestProxySanitizerType.BODY_KEY),
new TestProxySanitizer(String.format("$..%s", "aliasSecondaryConnectionString"), null, REDACTED_VALUE, TestProxySanitizerType.BODY_KEY),
new TestProxySanitizer(String.format("$..%s", "primaryKey"), null, REDACTED_VALUE, TestProxySanitizerType.BODY_KEY),
new TestProxySanitizer(String.format("$..%s", "secondaryKey"), null, REDACTED_VALUE, TestProxySanitizerType.BODY_KEY)
);
}

@Override
protected HttpPipeline buildHttpPipeline(
TokenCredential credential,
Expand Down
6 changes: 6 additions & 0 deletions sdk/resourcemanager/azure-resourcemanager-monitor/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/resourcemanager/azure-resourcemanager-monitor",
"Tag": "java/resourcemanager/azure-resourcemanager-monitor_886d7d8599"
}
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,9 @@ public void canCRUDActivityLogAlerts() {

Assertions.assertNotNull(ala);
Assertions.assertEquals(1, ala.scopes().size());
Assertions
.assertEquals("/subscriptions/" + monitorManager.subscriptionId(), ala.scopes().iterator().next());
if (!isPlaybackMode()) {
Assertions.assertEquals("/subscriptions/" + monitorManager.subscriptionId(), ala.scopes().iterator().next());
}
Assertions.assertEquals("AutoScale-VM-Creation-Failed", ala.description());
Assertions.assertEquals(true, ala.enabled());
Assertions.assertEquals(1, ala.actionGroupIds().size());
Expand Down Expand Up @@ -516,8 +517,9 @@ public void canCRUDActivityLogAlerts() {
.apply();

Assertions.assertEquals(1, ala.scopes().size());
Assertions
.assertEquals("/subscriptions/" + monitorManager.subscriptionId(), ala.scopes().iterator().next());
if (!isPlaybackMode()) {
Assertions.assertEquals("/subscriptions/" + monitorManager.subscriptionId(), ala.scopes().iterator().next());
}
Assertions.assertEquals("AutoScale-VM-Creation-Failed", ala.description());
Assertions.assertEquals(false, ala.enabled());
Assertions.assertEquals(1, ala.actionGroupIds().size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ public void canCRUDDiagnosticSettingsForSubscription() {
.create();

try {
Assertions.assertTrue(resourceId.equalsIgnoreCase(setting.resourceId()));
if (!isPlaybackMode()) {
Assertions.assertTrue(resourceId.equalsIgnoreCase(setting.resourceId()));
}
Assertions.assertTrue(sa.id().equalsIgnoreCase(setting.storageAccountId()));

Assertions.assertFalse(setting.logs().isEmpty());
Expand Down Expand Up @@ -328,11 +330,12 @@ public void canCRUDDiagnosticSettingsLogsCategoryGroup() {
.define(dsName)
.withResource(wpsResource.id())
.withStorageAccount(sa.id())
.withLog("Security", 7)
.withLog("MessagingLogs", 7)
.create();

// add category group "audit" to log settings
DiagnosticSettingsResourceInner inner = setting.innerModel();
inner.logs().clear(); // Remove category "MessagingLogs". Diagnostic setting does not support mix of log category and log category group.
inner.logs().add(new LogSettings().withCategoryGroup("audit").withEnabled(true).withRetentionPolicy(new RetentionPolicy().withEnabled(false)));
monitorManager.serviceClient().getDiagnosticSettingsOperations().createOrUpdate(wpsResource.id(), dsName, inner);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
import com.azure.resourcemanager.sql.models.SqlElasticPool;
import com.azure.resourcemanager.sql.models.SqlServer;
import com.azure.resourcemanager.storage.StorageManager;
import com.azure.resourcemanager.test.ResourceManagerTestBase;
import com.azure.resourcemanager.test.ResourceManagerTestProxyTestBase;
import com.azure.resourcemanager.test.utils.TestDelayProvider;
import com.azure.resourcemanager.test.utils.TestIdentifierProvider;

import java.time.temporal.ChronoUnit;
import java.util.List;

/** The base for Monitor manager tests. */
public class MonitorManagementTest extends ResourceManagerTestBase {
public class MonitorManagementTest extends ResourceManagerTestProxyTestBase {
protected ResourceManager resourceManager;
protected MonitorManager monitorManager;
protected ComputeManager computeManager;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6952625

Please sign in to comment.