CreateAgentParameters { @Nonnull public PullStrategy getPullStrategy() { return pullStrategy; } private  CreateAgentParameters(Node agentHolderSpec); @Nonnull Node getAgentHolderSpec(); @Nonnull Map<String, String> getLabels(); @Nonnull Map<String, String> getEnv(); @Nonnull Optional<String> getImageName(); @Nonnull PullStrategy getPullStrategy(); @Nonnull DockerRegistryCredentials getRegistryCredentials(); @Nonnull PullStatusListener getPullStatusListener(); CreateAgentParameters label(@Nonnull String key, @Nonnull String value); CreateAgentParameters env(@Nonnull String var, @Nonnull String value); CreateAgentParameters imageName(@Nonnull String imageName); CreateAgentParameters pullStrategy(@Nonnull PullStrategy pullStrategy); CreateAgentParameters registryCredentials(@Nonnull DockerRegistryCredentials registryCredentials); CreateAgentParameters pullStatusListener(@Nonnull PullStatusListener pullStatusListener); static CreateAgentParameters from(@Nonnull Node agentHolderSpec); static CreateAgentParameters fromImageConfig(@Nonnull DockerImageConfig imageConfig,
                                                        @Nonnull DockerImageNameResolver resolver,
                                                        boolean  ignorePullFailure);  }
@Test public void getPullStrategy() { CreateAgentParameters params = CreateAgentParameters.from(Node.EMPTY_OBJECT); assertThat(params.getPullStrategy()).isSameAs(PullStrategy.NO_PULL); assertThat(params.pullStrategy(PullStrategy.PULL).getPullStrategy()).isEqualTo(PullStrategy.PULL); assertThatExceptionOfType(NullPointerException.class).isThrownBy(() -> params.pullStrategy(null)); }