RunInstancesOptions extends BaseEC2RequestOptions { public RunInstancesOptions withKernelId(String kernelId) { formParameters.put("KernelId", checkNotNull(kernelId, "kernelId")); return this; }  RunInstancesOptions withKeyName(String keyName); RunInstancesOptions withSecurityGroups(String... securityGroups); RunInstancesOptions withSecurityGroups(Iterable<String> securityGroups); RunInstancesOptions withSecurityGroup(String securityGroup); RunInstancesOptions withUserData(byte[] unencodedData); RunInstancesOptions asType(String type); RunInstancesOptions withKernelId(String kernelId); RunInstancesOptions withRamdisk(String ramDiskId); RunInstancesOptions withBlockDeviceMappings(Set<? extends BlockDeviceMapping> mappings); static final RunInstancesOptions NONE; }
@Test public void testWithKernelId() { RunInstancesOptions options = new RunInstancesOptions(); options.withKernelId("test"); assertEquals(options.buildFormParameters().get("KernelId"), ImmutableList.of("test")); }
@Test public void testWithKernelIdStatic() { RunInstancesOptions options = withKernelId("test"); assertEquals(options.buildFormParameters().get("KernelId"), ImmutableList.of("test")); }
@Test(expectedExceptions = NullPointerException.class) public void testWithKernelIdNPE() { withKernelId(null); }