Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgmt, migrate test-proxy #36051

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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