fix NovaComputeServiceExpectTest

This commit is contained in:
Andrea Turli 2017-08-07 22:19:52 +02:00
parent 640e04b315
commit c61fa9d02b
1 changed files with 4 additions and 3 deletions

View File

@ -318,7 +318,8 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe
public void testCreateNodeWhileUserSpecifiesKeyPairAndUserSpecifiedGroups() throws Exception { public void testCreateNodeWhileUserSpecifiesKeyPairAndUserSpecifiedGroups() throws Exception {
Builder<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder() Builder<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder()
.putAll(defaultTemplateOpenStack); .putAll(defaultTemplateOpenStack);
requestResponseMap.put(list, notFound); requestResponseMap.put(list, HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/securitygroup_list.json")).build());
requestResponseMap.put(getKeyPair, keyPairDetails); requestResponseMap.put(getKeyPair, keyPairDetails);
@ -348,7 +349,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe
.addHeader("X-Auth-Token", authToken) .addHeader("X-Auth-Token", authToken)
.payload( .payload(
payloadFromStringWithContentType( payloadFromStringWithContentType(
"{\"server\":{\"name\":\"test-0\",\"imageRef\":\"14\",\"flavorRef\":\"1\",\"key_name\":\"testkeypair\",\"security_groups\":[{\"name\":\"mygroup\"}]}}", "{\"server\":{\"name\":\"test-0\",\"imageRef\":\"14\",\"flavorRef\":\"1\",\"key_name\":\"testkeypair\",\"security_groups\":[{\"name\":\"name1\"}]}}",
"application/json")).build(); "application/json")).build();
HttpResponse createdServer = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted") HttpResponse createdServer = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
@ -378,7 +379,7 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe
}); });
NodeMetadata node = Iterables.getOnlyElement(apiThatCreatesNode.createNodesInGroup("test", 1, NodeMetadata node = Iterables.getOnlyElement(apiThatCreatesNode.createNodesInGroup("test", 1,
keyPairName("fooPair").securityGroups("mygroup").blockUntilRunning(false))); keyPairName("fooPair").securityGroups("name1").blockUntilRunning(false)));
// we don't have access to this private key // we don't have access to this private key
assertTrue(!node.getCredentials().getOptionalPrivateKey().isPresent()); assertTrue(!node.getCredentials().getOptionalPrivateKey().isPresent());
} }