Tabnine Logo
InitializrConfiguration.getEnv
Code IndexAdd Tabnine to your IDE (free)

How to use
getEnv
method
in
io.spring.initializr.metadata.InitializrConfiguration

Best Java code snippets using io.spring.initializr.metadata.InitializrConfiguration.getEnv (Showing top 20 results out of 315)

origin: spring-io/initializr

/**
 * Create an URL suitable to download Spring Boot cli for the specified version and
 * extension.
 * @param extension the required extension
 * @return the download URL
 */
public String createCliDistributionURl(String extension) {
  String bootVersion = defaultId(this.bootVersions);
  return this.configuration.getEnv().getArtifactRepository()
      + "org/springframework/boot/spring-boot-cli/" + bootVersion
      + "/spring-boot-cli-" + bootVersion + "-bin." + extension;
}
origin: spring-io/initializr

private void resolveBom(InitializrMetadata metadata, String bomId,
    Version requestedVersion) {
  if (!this.boms.containsKey(bomId)) {
    BillOfMaterials bom = metadata.getConfiguration().getEnv().getBoms()
        .get(bomId).resolve(requestedVersion);
    bom.getAdditionalBoms()
        .forEach((id) -> resolveBom(metadata, id, requestedVersion));
    this.boms.put(bomId, bom);
  }
}
origin: spring-io/initializr

public boolean isForceSsl() {
  if (this.forceSsl == null) {
    this.forceSsl = this.metadataProvider.get().getConfiguration().getEnv()
        .isForceSsl();
  }
  return this.forceSsl;
}
origin: spring-io/initializr

@Test
void validateArtifactRepository() {
  this.properties.getEnv().setArtifactRepository("http://foo/bar");
  assertThat(this.properties.getEnv().getArtifactRepository())
      .isEqualTo("http://foo/bar/");
}
origin: spring-io/initializr

@Test
void generateApplicationNameInvalidStartCharacter() {
  assertThat(this.properties.generateApplicationName("1MyDemo"))
      .isEqualTo(this.properties.getEnv().getFallbackApplicationName());
}
origin: spring-io/initializr

@Test
void generateApplicationNameInvalidPartCharacter() {
  assertThat(this.properties.generateApplicationName("MyDe|mo"))
      .isEqualTo(this.properties.getEnv().getFallbackApplicationName());
}
origin: spring-io/initializr

@Test
void generateApplicationNameNull() {
  assertThat(this.properties.generateApplicationName(null))
      .isEqualTo(this.properties.getEnv().getFallbackApplicationName());
}
origin: spring-io/initializr

@Test
void generateApplicationNameAnotherInvalidApplicationName() {
  assertThat(this.properties.generateApplicationName("Spring"))
      .isEqualTo(this.properties.getEnv().getFallbackApplicationName());
}
origin: spring-io/initializr

@Test
void generateApplicationNameInvalidApplicationName() {
  assertThat(this.properties.generateApplicationName("SpringBoot"))
      .isEqualTo(this.properties.getEnv().getFallbackApplicationName());
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder addBom(String id, BillOfMaterials bom) {
  this.builder.withCustomizer(
      (it) -> it.getConfiguration().getEnv().getBoms().put(id, bom));
  return this;
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder setKotlinEnv(String defaultKotlinVersion,
    Kotlin.Mapping... mappings) {
  this.builder.withCustomizer((it) -> {
    it.getConfiguration().getEnv().getKotlin()
        .setDefaultVersion(defaultKotlinVersion);
    for (Kotlin.Mapping mapping : mappings) {
      it.getConfiguration().getEnv().getKotlin().getMappings().add(mapping);
    }
  });
  return this;
}
origin: spring-io/initializr

@Test
void resolveKotlinVersionUsingDefault() {
  Kotlin kotlin = this.properties.getEnv().getKotlin();
  kotlin.setDefaultVersion("1.2.3");
  kotlin.getMappings()
      .add(createKotlinVersionMapping("[1.4.0.RELEASE,1.5.0.RELEASE)", "1.5"));
  kotlin.validate();
  assertThat(kotlin.resolveKotlinVersion(Version.parse("1.3.2.RELEASE")))
      .isEqualTo("1.2.3");
}
origin: spring-io/initializr

@Test
void resolveKotlinVersionMatchingMapping() {
  Kotlin kotlin = this.properties.getEnv().getKotlin();
  kotlin.setDefaultVersion("1.2.3");
  kotlin.getMappings()
      .add(createKotlinVersionMapping("[1.4.0.RELEASE,1.5.0.RELEASE)", "1.5"));
  kotlin.getMappings().add(createKotlinVersionMapping("1.5.0.RELEASE", "1.6"));
  kotlin.validate();
  assertThat(kotlin.resolveKotlinVersion(Version.parse("1.5.3.RELEASE")))
      .isEqualTo("1.6");
}
origin: spring-io/initializr

@Test
void resolveApplicationNameWithNoName() {
  ProjectRequest request = initProjectRequest();
  request.setName(null);
  request.resolve(this.metadata);
  assertThat(request.getApplicationName()).isEqualTo(
      this.metadata.getConfiguration().getEnv().getFallbackApplicationName());
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder setGradleEnv(
    String dependencyManagementPluginVersion) {
  this.builder.withCustomizer((it) -> it.getConfiguration().getEnv().getGradle()
      .setDependencyManagementPluginVersion(dependencyManagementPluginVersion));
  return this;
}
origin: spring-io/initializr

@Test
void invalidBomUnknownRepository() {
  InitializrMetadata metadata = initializeMetadata();
  BillOfMaterials bom = BillOfMaterials.create("org.acme", "foo-bom",
      "1.0.0.RELEASE");
  bom.getRepositories().add("foo-repo");
  metadata.getConfiguration().getEnv().getBoms().put("foo-bom", bom);
  assertThatExceptionOfType(InvalidInitializrMetadataException.class)
      .isThrownBy(metadata::validate)
      .withMessageContaining("invalid repository id foo-repo")
      .withMessageContaining("foo-bom");
}
origin: spring-io/initializr

@Test
void invalidRepository() throws MalformedURLException {
  InitializrMetadata metadata = initializeMetadata();
  Dependency foo = Dependency.withId("foo", "org.acme", "foo");
  foo.setRepository("foo-repo");
  addTestDependencyGroup(metadata, foo);
  metadata.getConfiguration().getEnv().getRepositories().put("my-repo",
      new Repository("repo", new URL("http://example.com/repo"), true));
  assertThatExceptionOfType(InvalidInitializrMetadataException.class)
      .isThrownBy(metadata::validate).withMessageContaining("foo-repo")
      .withMessageContaining("my-repo");
}
origin: spring-io/initializr

@Test
void invalidBomVersionRangeMapping() {
  InitializrMetadata metadata = initializeMetadata();
  BillOfMaterials bom = BillOfMaterials.create("org.acme", "foo-bom");
  bom.getMappings().add(Mapping.create("[1.2.0.RELEASE,1.3.0.M1)", "1.0.0"));
  bom.getMappings().add(Mapping.create("FOO_BAR", "1.2.0"));
  metadata.getConfiguration().getEnv().getBoms().put("foo-bom", bom);
  assertThatExceptionOfType(InvalidInitializrMetadataException.class)
      .isThrownBy(metadata::validate).withMessageContaining("FOO_BAR")
      .withMessageContaining("foo-bom");
}
origin: spring-io/initializr

@Test
void invalidBomNoVersion() {
  InitializrMetadata metadata = initializeMetadata();
  metadata.getConfiguration().getEnv().getBoms().put("foo-bom",
      BillOfMaterials.create("org.acme", "foo-bom"));
  assertThatExceptionOfType(InvalidInitializrMetadataException.class)
      .isThrownBy(metadata::validate).withMessageContaining("No version")
      .withMessageContaining("foo-bom");
}
origin: spring-io/initializr

@Test
void invalidParentMissingVersion() {
  InitializrMetadata metadata = initializeMetadata();
  ParentPom parent = metadata.getConfiguration().getEnv().getMaven().getParent();
  parent.setGroupId("org.foo");
  parent.setArtifactId("foo-parent");
  assertThatExceptionOfType(InvalidInitializrMetadataException.class)
      .isThrownBy(metadata::validate).withMessageContaining(
          "Custom maven pom requires groupId, artifactId and version");
}
io.spring.initializr.metadataInitializrConfigurationgetEnv

Popular methods of InitializrConfiguration

  • <init>
  • cleanPackageName
    Clean the specified package name if necessary. If the package name cannot be transformed to a valid
  • generateApplicationName
    Generate a suitable application name based on the specified name. If no suitable application name ca
  • hasInvalidChar
  • merge
  • splitCamelCase
  • unsplitWords
  • validate

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now