use of com.ibm.watson.developer_cloud.discovery.v1.model.DeleteEnvironmentOptions in project java-sdk by watson-developer-cloud.
the class DiscoveryServiceTest method deleteEnvironmentIsSuccessful.
// Deleted test for createEnvironment with null name as this does not fail in the current SDK
@Test
public void deleteEnvironmentIsSuccessful() throws InterruptedException {
server.enqueue(jsonResponse(deleteEnvResp));
DeleteEnvironmentOptions deleteRequest = new DeleteEnvironmentOptions.Builder(environmentId).build();
discoveryService.deleteEnvironment(deleteRequest).execute();
RecordedRequest request = server.takeRequest();
assertEquals(ENV1_PATH, request.getPath());
assertEquals(DELETE, request.getMethod());
}
use of com.ibm.watson.developer_cloud.discovery.v1.model.DeleteEnvironmentOptions in project java-sdk by watson-developer-cloud.
the class DiscoveryServiceIT method deleteEnvironmentIsSuccessful.
@Test
@Ignore("Only 1 BYOD environment allowed per service instance, so do not delete it")
public void deleteEnvironmentIsSuccessful() {
String environmentName = uniqueName + "-environment";
CreateEnvironmentOptions createOptions = new CreateEnvironmentOptions.Builder().name(environmentName).size(FREE).build();
Environment createResponse = createEnvironment(createOptions);
DeleteEnvironmentOptions deleteOptions = new DeleteEnvironmentOptions.Builder(createResponse.getEnvironmentId()).build();
deleteEnvironment(deleteOptions);
}
Aggregations