> + public void testCreateSecurityGroupFail() throws IOException,
> InterruptedException, URISyntaxException {
> + MockWebServer server = mockOpenStackServer();
> + server.enqueue(addCommonHeaders(new
> MockResponse().setBody(stringFromResource("/access.json"))));
> + server.enqueue(addCommonHeaders(
> + new MockResponse().setResponseCode(404)));
> +
> + try {
> + NeutronApi neutronApi = api(server.getUrl("/").toString(),
> "openstack-neutron", overrides);
> + SecurityGroupApi api =
> neutronApi.getSecurityGroupApi("RegionOne").get();
> +
> + SecurityGroup.CreateOptions createSecurityGroup =
> SecurityGroup.createOptions().name("new-webservers")
> + .description("security group for webservers")
> + .build();
> +
> + SecurityGroup securityGroup = api.create(createSecurityGroup);
> + fail("Should have failed with not found exception");
In the "success path" you should verify that the generated request is the
expected one.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/132/files#r16708626