Location location = new LocationBuilder().id("https://1.1.1.1/api/v1.0/vdc/1").description("description")
.scope(LocationScope.PROVIDER).build();
Injector injector = createInjectorWithLocation(location);
InputStream is = getClass().getResourceAsStream("/vapp-pool.xml");
Factory factory = injector.getInstance(ParseSax.Factory.class);
VApp result = factory.create(injector.getInstance(VAppHandler.class)).parse(is);
VAppToNodeMetadata converter = injector.getInstance(VAppToNodeMetadata.class);
ImmutableMap<String, String> metadata = ImmutableMap.<String, String>of("foo", "bar");
ImmutableSet<String> tags = ImmutableSet.<String>of("tag1", "tag2");
String description = Joiner
.on('\n')
.withKeyValueSeparator("=")
.join(ImmutableMap.<String, String> builder().putAll(metadata)
.put("jclouds_tags", Joiner.on(',').join(tags)).build());
result = new VAppImpl(result.getName(), result.getType(), result.getHref(), result.getStatus(), result.getVDC(),
description, result.getTasks(), result.isOvfDescriptorUploaded(), result.getChildren(),
result.getNetworkSection());
NodeMetadata node = converter.apply(result);
assertNotNull(node);
assertEquals(node.getUserMetadata(), metadata);
assertEquals(node.getTags(), tags);