@Test void canBuildApplicationWithOptionals() { final Application.Builder builder = new Application.Builder(NAME, USER, VERSION, ApplicationStatus.ACTIVE); final Set<String> dependencies = Sets.newHashSet(UUID.randomUUID().toString(), UUID.randomUUID().toString()); builder.withDependencies(dependencies); final String type = UUID.randomUUID().toString(); builder.withType(type); final String setupFile = UUID.randomUUID().toString(); builder.withSetupFile(setupFile); final Set<String> configs = Sets.newHashSet(UUID.randomUUID().toString(), UUID.randomUUID().toString()); builder.withConfigs(configs); final Instant created = Instant.now(); builder.withCreated(created); final String description = UUID.randomUUID().toString(); builder.withDescription(description); final String id = UUID.randomUUID().toString(); builder.withId(id); final Set<String> tags = Sets.newHashSet(UUID.randomUUID().toString(), UUID.randomUUID().toString()); builder.withTags(tags); final Instant updated = Instant.now(); builder.withUpdated(updated); final Application application = builder.build(); Assertions.assertThat(application.getName()).isEqualTo(NAME); Assertions.assertThat(application.getUser()).isEqualTo(USER); Assertions.assertThat(application.getVersion()).isEqualTo(VERSION); Assertions.assertThat(application.getStatus()).isEqualTo(ApplicationStatus.ACTIVE); Assertions.assertThat(application.getDependencies()).isEqualTo(dependencies); Assertions.assertThat(application.getType().orElseGet(RandomSuppliers.STRING)).isEqualTo(type); Assertions.assertThat(application.getSetupFile().orElseGet(RandomSuppliers.STRING)).isEqualTo(setupFile); Assertions.assertThat(application.getConfigs()).isEqualTo(configs); Assertions.assertThat(application.getCreated().orElseGet(RandomSuppliers.INSTANT)).isEqualTo(created); Assertions .assertThat(application.getDescription().orElseThrow(IllegalArgumentException::new)) .isEqualTo(description); Assertions .assertThat(application.getId().orElseThrow(IllegalArgumentException::new)) .isEqualTo(id); Assertions .assertThat(application.getTags()) .isEqualTo(tags); Assertions .assertThat(application.getUpdated().orElseThrow(IllegalArgumentException::new)) .isEqualTo(updated); }
public Optional<String> getType() { return Optional.ofNullable(this.type); }
Application extends ExecutionEnvironmentDTO { public Optional<String> getType() { return Optional.ofNullable(this.type); } }
Application extends ExecutionEnvironmentDTO { public Optional<String> getType() { return Optional.ofNullable(this.type); } protected  Application(final Builder builder); }
Application extends ExecutionEnvironmentDTO { public Optional<String> getType() { return Optional.ofNullable(this.type); } protected  Application(final Builder builder); Optional<String> getType(); }
Application extends ExecutionEnvironmentDTO { public Optional<String> getType() { return Optional.ofNullable(this.type); } protected  Application(final Builder builder); Optional<String> getType();  }