Search in sources :

Example 1 with RegistryListCredentials

use of com.microsoft.azure.management.containerregistry.implementation.RegistryListCredentials in project azure-sdk-for-java by Azure.

the class TestContainerRegistry method createResource.

@Override
public Registry createResource(Registries registries) throws Exception {
    final String newName = "registry" + this.testId;
    Registry registry = registries.define(newName).withRegion(Region.US_WEST).withNewResourceGroup().withNewStorageAccount("crsa" + this.testId).withRegistryNameAsAdminUser().create();
    Assert.assertTrue(registry.adminUserEnabled());
    Assert.assertEquals(registry.storageAccountName(), "crsa" + this.testId);
    RegistryListCredentials registryCredentials = registry.listCredentials();
    Assert.assertNotNull(registryCredentials);
    Assert.assertEquals(newName, registryCredentials.username());
    Assert.assertEquals(2, registryCredentials.passwords().size());
    return registry;
}
Also used : RegistryListCredentials(com.microsoft.azure.management.containerregistry.implementation.RegistryListCredentials) Registry(com.microsoft.azure.management.containerregistry.Registry)

Aggregations

Registry (com.microsoft.azure.management.containerregistry.Registry)1 RegistryListCredentials (com.microsoft.azure.management.containerregistry.implementation.RegistryListCredentials)1