diff --git a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/SubscriptionsTests.java b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/SubscriptionsTests.java new file mode 100644 index 000000000000..bc8b8cc28896 --- /dev/null +++ b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/SubscriptionsTests.java @@ -0,0 +1,33 @@ +package com.microsoft.azure.management.resources; + +import com.microsoft.azure.PagedList; +import com.microsoft.azure.credentials.ApplicationTokenCredentials; +import com.microsoft.azure.management.resources.implementation.ResourceManager; +import okhttp3.logging.HttpLoggingInterceptor; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class SubscriptionsTests { + protected static ResourceManager.Authenticated resourceManager; + + @BeforeClass + public static void setup() throws Exception { + resourceManager = ResourceManager + .configure() + .withLogLevel(HttpLoggingInterceptor.Level.BODY) + .authenticate( + new ApplicationTokenCredentials( + System.getenv("client-id"), + System.getenv("domain"), + System.getenv("secret"), + null) + ); + } + + @Test + public void canListSubscriptions() throws Exception { + PagedList subscriptions = resourceManager.subscriptions().list(); + Assert.assertTrue(subscriptions.size() > 0); + } +} diff --git a/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/TenantsTests.java b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/TenantsTests.java new file mode 100644 index 000000000000..bb99c81a636c --- /dev/null +++ b/azure-mgmt-resources/src/test/java/com/microsoft/azure/management/resources/TenantsTests.java @@ -0,0 +1,33 @@ +package com.microsoft.azure.management.resources; + +import com.microsoft.azure.PagedList; +import com.microsoft.azure.credentials.ApplicationTokenCredentials; +import com.microsoft.azure.management.resources.implementation.ResourceManager; +import okhttp3.logging.HttpLoggingInterceptor; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class TenantsTests { + protected static ResourceManager.Authenticated resourceManager; + + @BeforeClass + public static void setup() throws Exception { + resourceManager = ResourceManager + .configure() + .withLogLevel(HttpLoggingInterceptor.Level.BODY) + .authenticate( + new ApplicationTokenCredentials( + System.getenv("client-id"), + System.getenv("domain"), + System.getenv("secret"), + null) + ); + } + + @Test + public void canListTenants() throws Exception { + PagedList tenants = resourceManager.tenants().list(); + Assert.assertTrue(tenants.size() > 0); + } +}