Search in sources :

Example 6 with ListNamespacesPagedResponse

use of com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse in project java-servicedirectory by googleapis.

the class NamespacesTests method tearDown.

@After
public void tearDown() throws Exception {
    System.setOut(null);
    bout.reset();
    // Deletes any namespaces created during these tests.
    try (RegistrationServiceClient client = RegistrationServiceClient.create()) {
        // List the namespaces.
        String locationPath = LocationName.format(PROJECT_ID, LOCATION_ID);
        ListNamespacesPagedResponse response = client.listNamespaces(locationPath);
        // Delete each namespace.
        for (Namespace ns : response.iterateAll()) {
            client.deleteNamespace(ns.getName());
        }
    }
}
Also used : Namespace(com.google.cloud.servicedirectory.v1.Namespace) RegistrationServiceClient(com.google.cloud.servicedirectory.v1.RegistrationServiceClient) ListNamespacesPagedResponse(com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse) After(org.junit.After)

Example 7 with ListNamespacesPagedResponse

use of com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse in project java-servicedirectory by googleapis.

the class EndpointsTests method tearDown.

@After
public void tearDown() throws Exception {
    System.setOut(null);
    bout.reset();
    // Deletes all resources created during these tests.
    try (RegistrationServiceClient client = RegistrationServiceClient.create()) {
        // List the namespaces.
        String locationPath = LocationName.format(PROJECT_ID, LOCATION_ID);
        ListNamespacesPagedResponse response = client.listNamespaces(locationPath);
        // Delete each namespace.
        for (Namespace namespace : response.iterateAll()) {
            client.deleteNamespace(namespace.getName());
        }
    }
}
Also used : Namespace(com.google.cloud.servicedirectory.v1.Namespace) RegistrationServiceClient(com.google.cloud.servicedirectory.v1.RegistrationServiceClient) ListNamespacesPagedResponse(com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse) After(org.junit.After)

Example 8 with ListNamespacesPagedResponse

use of com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse in project java-servicedirectory by googleapis.

the class ServicesTests method tearDown.

@After
public void tearDown() throws Exception {
    System.setOut(null);
    bout.reset();
    // Deletes all resources created during these tests.
    try (RegistrationServiceClient client = RegistrationServiceClient.create()) {
        // List the namespaces.
        String locationPath = LocationName.format(PROJECT_ID, LOCATION_ID);
        ListNamespacesPagedResponse response = client.listNamespaces(locationPath);
        // Delete each namespace.
        for (Namespace namespace : response.iterateAll()) {
            client.deleteNamespace(namespace.getName());
        }
    }
}
Also used : Namespace(com.google.cloud.servicedirectory.v1.Namespace) RegistrationServiceClient(com.google.cloud.servicedirectory.v1.RegistrationServiceClient) ListNamespacesPagedResponse(com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse) After(org.junit.After)

Aggregations

ListNamespacesPagedResponse (com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse)6 Namespace (com.google.cloud.servicedirectory.v1.Namespace)4 RegistrationServiceClient (com.google.cloud.servicedirectory.v1.RegistrationServiceClient)4 AbstractMessage (com.google.protobuf.AbstractMessage)4 Test (org.junit.Test)4 After (org.junit.After)3 ListNamespacesPagedResponse (com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse)2 ByteString (com.google.protobuf.ByteString)2 LocationName (com.google.cloud.servicedirectory.v1.LocationName)1