This commit is contained in:
Stephane Nicoll
2020-06-18 12:10:01 +02:00
parent 81dd169b2a
commit 9e1d99810a
2 changed files with 3 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -59,7 +59,6 @@ import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/** /**
* Base {@link Controller} that provides endpoints for project generation. * Base {@link Controller} that provides endpoints for project generation.
@@ -110,7 +109,6 @@ public abstract class ProjectGenerationController<R extends ProjectRequest> {
} }
@RequestMapping(path = { "/pom", "/pom.xml" }) @RequestMapping(path = { "/pom", "/pom.xml" })
@ResponseBody
public ResponseEntity<byte[]> pom(R request) { public ResponseEntity<byte[]> pom(R request) {
request.setType("maven-build"); request.setType("maven-build");
byte[] mavenPom = this.projectGenerationInvoker.invokeBuildGeneration(request); byte[] mavenPom = this.projectGenerationInvoker.invokeBuildGeneration(request);
@@ -118,7 +116,6 @@ public abstract class ProjectGenerationController<R extends ProjectRequest> {
} }
@RequestMapping(path = { "/build", "/build.gradle" }) @RequestMapping(path = { "/build", "/build.gradle" })
@ResponseBody
public ResponseEntity<byte[]> gradle(R request) { public ResponseEntity<byte[]> gradle(R request) {
request.setType("gradle-build"); request.setType("gradle-build");
byte[] gradleBuild = this.projectGenerationInvoker.invokeBuildGeneration(request); byte[] gradleBuild = this.projectGenerationInvoker.invokeBuildGeneration(request);
@@ -126,7 +123,6 @@ public abstract class ProjectGenerationController<R extends ProjectRequest> {
} }
@RequestMapping("/starter.zip") @RequestMapping("/starter.zip")
@ResponseBody
public ResponseEntity<byte[]> springZip(R request) throws IOException { public ResponseEntity<byte[]> springZip(R request) throws IOException {
ProjectGenerationResult result = this.projectGenerationInvoker.invokeProjectStructureGeneration(request); ProjectGenerationResult result = this.projectGenerationInvoker.invokeProjectStructureGeneration(request);
Path archive = createArchive(result, "zip", ZipArchiveOutputStream::new, ZipArchiveEntry::new, Path archive = createArchive(result, "zip", ZipArchiveOutputStream::new, ZipArchiveEntry::new,
@@ -135,7 +131,6 @@ public abstract class ProjectGenerationController<R extends ProjectRequest> {
} }
@RequestMapping(path = "/starter.tgz", produces = "application/x-compress") @RequestMapping(path = "/starter.tgz", produces = "application/x-compress")
@ResponseBody
public ResponseEntity<byte[]> springTgz(R request) throws IOException { public ResponseEntity<byte[]> springTgz(R request) throws IOException {
ProjectGenerationResult result = this.projectGenerationInvoker.invokeProjectStructureGeneration(request); ProjectGenerationResult result = this.projectGenerationInvoker.invokeProjectStructureGeneration(request);
Path archive = createArchive(result, "tar.gz", this::createTarArchiveOutputStream, TarArchiveEntry::new, Path archive = createArchive(result, "tar.gz", this::createTarArchiveOutputStream, TarArchiveEntry::new,

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ public class SpringCliDistributionControllerIntegrationTests extends AbstractIni
} }
private void assertSpringCliRedirect(String context, String extension) throws URISyntaxException { private void assertSpringCliRedirect(String context, String extension) throws URISyntaxException {
ResponseEntity<?> entity = getRestTemplate().getForEntity(createUrl(context), ResponseEntity.class); ResponseEntity<?> entity = getRestTemplate().getForEntity(createUrl(context), Object.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.FOUND); 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.1.4.RELEASE/spring-boot-cli-2.1.4.RELEASE-bin."
+ extension; + extension;