mirror of
https://gitee.com/dcren/initializr.git
synced 2026-02-25 21:22:58 +08:00
Remove JUnit 4 support
This commit also upgrades the test suite to use a more recent version as removing support for JUnit4 effectively removes support for those as well. Closes gh-1219
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -85,7 +85,7 @@ class ProjectGenerationControllerIntegrationTests extends AbstractInitializrCont
|
||||
@Test
|
||||
void dependencyInRange() {
|
||||
Dependency biz = Dependency.create("org.acme", "biz", "1.3.5", "runtime");
|
||||
ProjectStructure project = downloadTgz("/starter.tgz?dependencies=org.acme:biz&bootVersion=2.5.1");
|
||||
ProjectStructure project = downloadTgz("/starter.tgz?dependencies=org.acme:biz&bootVersion=2.6.1");
|
||||
assertDefaultProject(project);
|
||||
assertDoesNotHaveWebResources(project);
|
||||
assertThat(project).mavenBuild().hasDependenciesSize(3).hasDependency(biz);
|
||||
@@ -136,12 +136,11 @@ class ProjectGenerationControllerIntegrationTests extends AbstractInitializrCont
|
||||
|
||||
@Test
|
||||
void kotlinRange() {
|
||||
ProjectStructure project = downloadZip(
|
||||
"/starter.zip?dependencies=web&language=kotlin&bootVersion=2.0.1.RELEASE");
|
||||
ProjectStructure project = downloadZip("/starter.zip?dependencies=web&language=kotlin&bootVersion=2.4.0");
|
||||
assertThat(project).containsFiles("src/main/kotlin/com/example/demo/DemoApplication.kt",
|
||||
"src/test/kotlin/com/example/demo/DemoApplicationTests.kt",
|
||||
"src/main/resources/application.properties");
|
||||
assertThat(project).mavenBuild().hasDependenciesSize(4).hasProperty("kotlin.version", "1.1");
|
||||
assertThat(project).mavenBuild().hasDependenciesSize(4).hasProperty("kotlin.version", "1.4.31");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -106,16 +106,16 @@ class ProjectMetadataControllerCustomDefaultsIntegrationTests extends AbstractFu
|
||||
ResponseEntity<String> response = execute("/dependencies", String.class, null, acceptHeader);
|
||||
assertThat(response.getHeaders().getFirst(HttpHeaders.ETAG)).isNotNull();
|
||||
validateContentType(response, expectedMediaType);
|
||||
validateDependenciesOutput("2.1.4", response.getBody());
|
||||
validateDependenciesOutput("2.4.4", response.getBody());
|
||||
}
|
||||
|
||||
@Test
|
||||
void filteredDependencies() throws JSONException {
|
||||
ResponseEntity<String> response = execute("/dependencies?bootVersion=2.5.1", String.class, null,
|
||||
ResponseEntity<String> response = execute("/dependencies?bootVersion=2.6.1", String.class, null,
|
||||
"application/json");
|
||||
assertThat(response.getHeaders().getFirst(HttpHeaders.ETAG)).isNotNull();
|
||||
validateContentType(response, DEFAULT_METADATA_MEDIA_TYPE);
|
||||
validateDependenciesOutput("2.5.1", response.getBody());
|
||||
validateDependenciesOutput("2.6.1", response.getBody());
|
||||
}
|
||||
|
||||
protected void validateDependenciesOutput(String version, String actual) throws JSONException {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,7 +40,7 @@ public class SpringCliDistributionControllerCustomEnvsIntegrationTests
|
||||
void downloadCliWithCustomRepository() throws Exception {
|
||||
ResponseEntity<?> entity = getRestTemplate().getForEntity(createUrl("/spring"), String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.FOUND);
|
||||
String expected = "https://repo.spring.io/lib-release/org/springframework/boot/spring-boot-cli/2.1.4.RELEASE/spring-boot-cli-2.1.4.RELEASE-bin.zip";
|
||||
String expected = "https://repo.spring.io/lib-release/org/springframework/boot/spring-boot-cli/2.4.4/spring-boot-cli-2.4.4-bin.zip";
|
||||
assertThat(entity.getHeaders().getLocation()).isEqualTo(new URI(expected));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -66,7 +66,7 @@ public class SpringCliDistributionControllerIntegrationTests extends AbstractIni
|
||||
private void assertSpringCliRedirect(String context, String extension) throws URISyntaxException {
|
||||
ResponseEntity<?> entity = getRestTemplate().getForEntity(createUrl(context), Object.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.FOUND);
|
||||
String expected = "https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/2.1.4.RELEASE/spring-boot-cli-2.1.4.RELEASE-bin."
|
||||
String expected = "https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/2.4.4/spring-boot-cli-2.4.4-bin."
|
||||
+ extension;
|
||||
assertThat(entity.getHeaders().getLocation()).isEqualTo(new URI(expected));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
info:
|
||||
spring-boot:
|
||||
version: 2.1.4.RELEASE
|
||||
version: 2.4.4
|
||||
|
||||
initializr:
|
||||
env:
|
||||
@@ -11,10 +11,10 @@ initializr:
|
||||
versionProperty: my-api.version
|
||||
additionalBoms: ['my-api-dependencies-bom']
|
||||
mappings:
|
||||
- compatibilityRange: "[2.0.0.RELEASE,2.1.6.RELEASE)"
|
||||
- compatibilityRange: "[2.3.0.RELEASE,2.4.6)"
|
||||
version: 1.0.0.RELEASE
|
||||
repositories: my-api-repo-1
|
||||
- compatibilityRange: "2.2.1.RELEASE"
|
||||
- compatibilityRange: "2.4.6"
|
||||
version: 2.0.0.RELEASE
|
||||
repositories: my-api-repo-2
|
||||
my-api-dependencies-bom:
|
||||
@@ -23,12 +23,12 @@ initializr:
|
||||
version: 1.0.0.RELEASE
|
||||
repositories: my-api-repo-3
|
||||
kotlin:
|
||||
defaultVersion: 1.2
|
||||
defaultVersion: 1.5
|
||||
mappings:
|
||||
- compatibilityRange: "[1.5.0.RELEASE,2.0.0.M1)"
|
||||
version: 1.0
|
||||
- compatibilityRange: "[2.0.0.M1,2.1.0.M1)"
|
||||
version: 1.1
|
||||
- compatibilityRange: "[2.3.0.RELEASE,2.4.0-M1)"
|
||||
version: 1.3.72
|
||||
- compatibilityRange: "[2.4.0-M1,2.5.0-M1)"
|
||||
version: 1.4.31
|
||||
repositories:
|
||||
my-api-repo-1:
|
||||
name: repo1
|
||||
@@ -85,12 +85,12 @@ initializr:
|
||||
artifactId: biz
|
||||
scope: runtime
|
||||
version: 1.3.5
|
||||
compatibilityRange: 2.5.0-SNAPSHOT
|
||||
compatibilityRange: 2.6.0-SNAPSHOT
|
||||
- name: Bur
|
||||
id: org.acme:bur
|
||||
version: 2.1.0
|
||||
scope: test
|
||||
compatibilityRange: "[2.1.4.RELEASE,2.4.0-SNAPSHOT)"
|
||||
compatibilityRange: "[2.4.4,2.5.0-SNAPSHOT)"
|
||||
- name: My API
|
||||
id : my-api
|
||||
groupId: org.acme
|
||||
@@ -152,13 +152,13 @@ initializr:
|
||||
default: false
|
||||
bootVersions:
|
||||
- name : Latest SNAPSHOT
|
||||
id: 2.4.0-SNAPSHOT
|
||||
id: 2.5.0-SNAPSHOT
|
||||
default: false
|
||||
- name: 2.1.4
|
||||
id: 2.1.4.RELEASE
|
||||
- name: 2.4.4
|
||||
id: 2.4.4
|
||||
default: true
|
||||
- name: 1.5.17
|
||||
id: 2.2.17.RELEASE
|
||||
- name: 2.3.10
|
||||
id: 2.3.10.RELEASE
|
||||
default: false
|
||||
|
||||
server:
|
||||
|
||||
@@ -10,18 +10,18 @@
|
||||
"content": [
|
||||
{
|
||||
"default": false,
|
||||
"id": "2.4.0-SNAPSHOT",
|
||||
"id": "2.5.0-SNAPSHOT",
|
||||
"name": "Latest SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"default": true,
|
||||
"id": "2.1.4.RELEASE",
|
||||
"name": "2.1.4"
|
||||
"id": "2.4.4",
|
||||
"name": "2.4.4"
|
||||
},
|
||||
{
|
||||
"default": false,
|
||||
"id": "2.2.17.RELEASE",
|
||||
"name": "1.5.17"
|
||||
"id": "2.3.10.RELEASE",
|
||||
"name": "2.3.10"
|
||||
}
|
||||
],
|
||||
"description": "spring boot version",
|
||||
@@ -37,15 +37,15 @@
|
||||
"dependencyManagementPluginVersion": "1.0.0.RELEASE"
|
||||
},
|
||||
"kotlin": {
|
||||
"defaultVersion": "1.2",
|
||||
"defaultVersion": "1.5",
|
||||
"mappings": [
|
||||
{
|
||||
"compatibilityRange": "[1.5.0.RELEASE,2.0.0.M1)",
|
||||
"version": "1.0"
|
||||
"compatibilityRange": "[2.3.0.RELEASE,2.4.0-M1)",
|
||||
"version": "1.3.72"
|
||||
},
|
||||
{
|
||||
"compatibilityRange": "[2.0.0.M1,2.1.0.M1)",
|
||||
"version": "1.1"
|
||||
"compatibilityRange": "[2.4.0-M1,2.5.0-M1)",
|
||||
"version": "1.4.31"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -107,14 +107,14 @@
|
||||
],
|
||||
"mappings": [
|
||||
{
|
||||
"compatibilityRange": "[2.0.0.RELEASE,2.1.6.RELEASE)",
|
||||
"compatibilityRange": "[2.3.0.RELEASE,2.4.6)",
|
||||
"repositories": [
|
||||
"my-api-repo-1"
|
||||
],
|
||||
"version": "1.0.0.RELEASE"
|
||||
},
|
||||
{
|
||||
"compatibilityRange": "2.2.1.RELEASE",
|
||||
"compatibilityRange": "2.4.6",
|
||||
"repositories": [
|
||||
"my-api-repo-2"
|
||||
],
|
||||
@@ -224,7 +224,7 @@
|
||||
"name": "Biz",
|
||||
"scope": "runtime",
|
||||
"version": "1.3.5",
|
||||
"compatibilityRange": "2.5.0-SNAPSHOT"
|
||||
"compatibilityRange": "2.6.0-SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"starter": true,
|
||||
@@ -234,7 +234,7 @@
|
||||
"name": "Bur",
|
||||
"scope": "test",
|
||||
"version": "2.1.0",
|
||||
"compatibilityRange": "[2.1.4.RELEASE,2.4.0-SNAPSHOT)"
|
||||
"compatibilityRange": "[2.4.4,2.5.0-SNAPSHOT)"
|
||||
},
|
||||
{
|
||||
"starter": true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"bootVersion": "2.1.4.RELEASE",
|
||||
"bootVersion": "2.4.4",
|
||||
"repositories": {
|
||||
"my-api-repo-1": {
|
||||
"name": "repo1",
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"bootVersion": "2.5.1",
|
||||
"bootVersion": "2.6.1",
|
||||
"repositories": {
|
||||
"my-api-repo-2": {
|
||||
"name": "repo2",
|
||||
@@ -151,19 +151,19 @@
|
||||
},
|
||||
"bootVersion": {
|
||||
"type": "single-select",
|
||||
"default": "2.1.4.RELEASE",
|
||||
"default": "2.4.4.RELEASE",
|
||||
"values": [
|
||||
{
|
||||
"id": "2.4.0.BUILD-SNAPSHOT",
|
||||
"id": "2.5.0.BUILD-SNAPSHOT",
|
||||
"name": "Latest SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"id": "2.1.4.RELEASE",
|
||||
"name": "2.1.4"
|
||||
"id": "2.4.4.RELEASE",
|
||||
"name": "2.4.4"
|
||||
},
|
||||
{
|
||||
"id": "2.2.17.RELEASE",
|
||||
"name": "1.5.17"
|
||||
"id": "2.3.10.RELEASE",
|
||||
"name": "2.3.10"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -151,19 +151,19 @@
|
||||
},
|
||||
"bootVersion": {
|
||||
"type": "single-select",
|
||||
"default": "2.1.4.RELEASE",
|
||||
"default": "2.4.4.RELEASE",
|
||||
"values": [
|
||||
{
|
||||
"id": "2.4.0.BUILD-SNAPSHOT",
|
||||
"id": "2.5.0.BUILD-SNAPSHOT",
|
||||
"name": "Latest SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"id": "2.1.4.RELEASE",
|
||||
"name": "2.1.4"
|
||||
"id": "2.4.4.RELEASE",
|
||||
"name": "2.4.4"
|
||||
},
|
||||
{
|
||||
"id": "2.2.17.RELEASE",
|
||||
"name": "1.5.17"
|
||||
"id": "2.3.10.RELEASE",
|
||||
"name": "2.3.10"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -80,12 +80,12 @@
|
||||
{
|
||||
"id": "org.acme:biz",
|
||||
"name": "Biz",
|
||||
"versionRange": "2.5.0.BUILD-SNAPSHOT"
|
||||
"versionRange": "2.6.0.BUILD-SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"id": "org.acme:bur",
|
||||
"name": "Bur",
|
||||
"versionRange": "[2.1.4.RELEASE,2.4.0.BUILD-SNAPSHOT)"
|
||||
"versionRange": "[2.4.4.RELEASE,2.5.0.BUILD-SNAPSHOT)"
|
||||
},
|
||||
{
|
||||
"id": "my-api",
|
||||
@@ -189,19 +189,19 @@
|
||||
},
|
||||
"bootVersion": {
|
||||
"type": "single-select",
|
||||
"default": "2.1.4.RELEASE",
|
||||
"default": "2.4.4.RELEASE",
|
||||
"values": [
|
||||
{
|
||||
"id": "2.4.0.BUILD-SNAPSHOT",
|
||||
"id": "2.5.0.BUILD-SNAPSHOT",
|
||||
"name": "Latest SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"id": "2.1.4.RELEASE",
|
||||
"name": "2.1.4"
|
||||
"id": "2.4.4.RELEASE",
|
||||
"name": "2.4.4"
|
||||
},
|
||||
{
|
||||
"id": "2.2.17.RELEASE",
|
||||
"name": "1.5.17"
|
||||
"id": "2.3.10.RELEASE",
|
||||
"name": "2.3.10"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -80,12 +80,12 @@
|
||||
{
|
||||
"id": "org.acme:biz",
|
||||
"name": "Biz",
|
||||
"versionRange": "2.5.0.BUILD-SNAPSHOT"
|
||||
"versionRange": "2.6.0.BUILD-SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"id": "org.acme:bur",
|
||||
"name": "Bur",
|
||||
"versionRange": "[2.1.4.RELEASE,2.4.0.BUILD-SNAPSHOT)"
|
||||
"versionRange": "[2.4.4.RELEASE,2.5.0.BUILD-SNAPSHOT)"
|
||||
},
|
||||
{
|
||||
"id": "my-api",
|
||||
@@ -189,19 +189,19 @@
|
||||
},
|
||||
"bootVersion": {
|
||||
"type": "single-select",
|
||||
"default": "2.1.4.RELEASE",
|
||||
"default": "2.4.4.RELEASE",
|
||||
"values": [
|
||||
{
|
||||
"id": "2.4.0.BUILD-SNAPSHOT",
|
||||
"id": "2.5.0.BUILD-SNAPSHOT",
|
||||
"name": "Latest SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"id": "2.1.4.RELEASE",
|
||||
"name": "2.1.4"
|
||||
"id": "2.4.4.RELEASE",
|
||||
"name": "2.4.4"
|
||||
},
|
||||
{
|
||||
"id": "2.2.17.RELEASE",
|
||||
"name": "1.5.17"
|
||||
"id": "2.3.10.RELEASE",
|
||||
"name": "2.3.10"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -80,12 +80,12 @@
|
||||
{
|
||||
"id": "org.acme:biz",
|
||||
"name": "Biz",
|
||||
"versionRange": "2.5.0-SNAPSHOT"
|
||||
"versionRange": "2.6.0-SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"id": "org.acme:bur",
|
||||
"name": "Bur",
|
||||
"versionRange": "[2.1.4.RELEASE,2.4.0-SNAPSHOT)"
|
||||
"versionRange": "[2.4.4,2.5.0-SNAPSHOT)"
|
||||
},
|
||||
{
|
||||
"id": "my-api",
|
||||
@@ -189,19 +189,19 @@
|
||||
},
|
||||
"bootVersion": {
|
||||
"type": "single-select",
|
||||
"default": "2.1.4.RELEASE",
|
||||
"default": "2.4.4",
|
||||
"values": [
|
||||
{
|
||||
"id": "2.4.0-SNAPSHOT",
|
||||
"id": "2.5.0-SNAPSHOT",
|
||||
"name": "Latest SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"id": "2.1.4.RELEASE",
|
||||
"name": "2.1.4"
|
||||
"id": "2.4.4",
|
||||
"name": "2.4.4"
|
||||
},
|
||||
{
|
||||
"id": "2.2.17.RELEASE",
|
||||
"name": "1.5.17"
|
||||
"id": "2.3.10.RELEASE",
|
||||
"name": "2.3.10"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user