JCloudsSlaveTemplate implements Describable<JCloudsSlaveTemplate>, SlaveOptions.Holder { public @Nonnull SlaveOptions getRawSlaveOptions() { if (cloud == null) throw new IllegalStateException("Owner not set properly"); return slaveOptions; } @DataBoundConstructor  JCloudsSlaveTemplate(final @Nonnull String name, final @Nonnull String labels, final @CheckForNull SlaveOptions slaveOptions); @Nonnull SlaveOptions getEffectiveSlaveOptions(); @Nonnull SlaveOptions getRawSlaveOptions(); Set<LabelAtom> getLabelSet(); @Nonnull String getName(); @Restricted(NoExternalUse.class) // Jelly + tests @Nonnull String getLabels(); boolean canProvision(final Label label); @Nonnull JCloudsSlave provisionSlave(
            @Nonnull JCloudsCloud cloud, @Nonnull ProvisioningActivity.Id id
    ); @Restricted(NoExternalUse.class) @Nonnull Server provisionServer(@CheckForNull ServerScope scope, @CheckForNull ProvisioningActivity.Id id); @Override @SuppressWarnings("unchecked") Descriptor<JCloudsSlaveTemplate> getDescriptor(); static final String OPENSTACK_CLOUD_NAME_KEY; static final String OPENSTACK_TEMPLATE_NAME_KEY; }
@Test public void eraseDefaults() { SlaveOptions cloudOpts = dummySlaveOptions(); SlaveOptions templateOpts = cloudOpts.getBuilder().bootSource(new BootSource.Image("id")).availabilityZone("other").build(); assertEquals(cloudOpts.getHardwareId(), templateOpts.getHardwareId()); JCloudsSlaveTemplate template = new JCloudsSlaveTemplate( "test-templateOpts", "openstack-slave-type1 openstack-type2", templateOpts ); JCloudsCloud cloud = new JCloudsCloud( "my-openstack", "credential", false, "zone", cloudOpts, singletonList(template), j.dummyCredentials() ); assertEquals(cloudOpts, cloud.getRawSlaveOptions()); assertEquals(SlaveOptions.builder().bootSource(new BootSource.Image("id")).availabilityZone("other").build(), template.getRawSlaveOptions()); }