public void testApplyInputStream1() {
InputStream is = getClass().getResourceAsStream("/describe_spot_instance.xml");
SpotInstanceRequest expected = SpotInstanceRequest
.builder()
.region("us-east-1")
.id("sir-1ede0012")
.instanceId("i-ef308e8e")
.spotPrice(0.300000f)
.type(Type.ONE_TIME)
.state(State.ACTIVE)
.rawState("active")
.launchedAvailabilityZone("us-east-1b")
.launchSpecification(
LaunchSpecification.builder().imageId("ami-8e1fece7")
.securityGroupIdToName("sg-83e1c4eb", "jclouds#adriancole-ec2unssh#us-east-1")
.instanceType("t1.micro").monitoringEnabled(false).keyName("jclouds#adriancole-ec2unssh")
.build())
.createTime(new SimpleDateFormatDateService().iso8601DateParse("2011-07-29T05:27:39.000Z"))
.productDescription("Linux/UNIX")
.tag("Name", "ec2-o")
.tag("Spot", "spot-value")
.tag("Empty", "")
.build();
SpotInstanceHandler handler = injector.getInstance(SpotInstanceHandler.class);
addDefaultRegionToHandler(handler);
SpotInstanceRequest result = factory.create(handler).parse(is);
assertEquals(result.toString(), expected.toString());
assertEquals(result.getState(), State.ACTIVE);
assertEquals(result.getRawState(), "active");
}