This commit is contained in:
Stephane Nicoll
2017-12-12 11:57:24 +01:00
parent 97c91eee94
commit 23218add90
615 changed files with 2832 additions and 3224 deletions

View File

@@ -63,8 +63,7 @@ public class GrabCommandIntegrationTests {
}
@Test
public void duplicateDependencyManagementBomAnnotationsProducesAnError()
throws Exception {
public void duplicateDependencyManagementBomAnnotationsProducesAnError() {
try {
this.cli.grab("duplicateDependencyManagementBom.groovy");
fail();

View File

@@ -41,7 +41,7 @@ public class SpringApplicationLauncherTests {
}
@Test
public void defaultLaunch() throws Exception {
public void defaultLaunch() {
assertThat(launch()).contains("org.springframework.boot.SpringApplication");
}

View File

@@ -127,14 +127,14 @@ public class CommandRunnerTests {
}
@Test
public void handlesSuccess() throws Exception {
public void handlesSuccess() {
int status = this.commandRunner.runAndHandleErrors("command");
assertThat(status).isEqualTo(0);
assertThat(this.calls).isEmpty();
}
@Test
public void handlesNoSuchCommand() throws Exception {
public void handlesNoSuchCommand() {
int status = this.commandRunner.runAndHandleErrors("missing");
assertThat(status).isEqualTo(1);
assertThat(this.calls).containsOnly(Call.ERROR_MESSAGE);
@@ -175,7 +175,7 @@ public class CommandRunnerTests {
}
@Test
public void exceptionMessages() throws Exception {
public void exceptionMessages() {
assertThat(new NoSuchCommandException("name").getMessage())
.isEqualTo("'name' is not a valid command. See 'help'.");
}

View File

@@ -50,7 +50,7 @@ public class ResourceMatcherTests {
@SuppressWarnings("unchecked")
@Test
public void defaults() throws Exception {
public void defaults() {
ResourceMatcher resourceMatcher = new ResourceMatcher(Arrays.asList(""),
Arrays.asList(""));
Collection<String> includes = (Collection<String>) ReflectionTestUtils
@@ -79,7 +79,7 @@ public class ResourceMatcherTests {
@SuppressWarnings("unchecked")
@Test
public void includedDeltas() throws Exception {
public void includedDeltas() {
ResourceMatcher resourceMatcher = new ResourceMatcher(Arrays.asList("-static/**"),
Arrays.asList(""));
Collection<String> includes = (Collection<String>) ReflectionTestUtils
@@ -90,7 +90,7 @@ public class ResourceMatcherTests {
@SuppressWarnings("unchecked")
@Test
public void includedDeltasAndNewEntries() throws Exception {
public void includedDeltasAndNewEntries() {
ResourceMatcher resourceMatcher = new ResourceMatcher(
Arrays.asList("-static/**", "foo.jar"), Arrays.asList("-**/*.jar"));
Collection<String> includes = (Collection<String>) ReflectionTestUtils
@@ -105,7 +105,7 @@ public class ResourceMatcherTests {
@SuppressWarnings("unchecked")
@Test
public void excludedDeltas() throws Exception {
public void excludedDeltas() {
ResourceMatcher resourceMatcher = new ResourceMatcher(Arrays.asList(""),
Arrays.asList("-**/*.jar"));
Collection<String> excludes = (Collection<String>) ReflectionTestUtils

View File

@@ -205,7 +205,7 @@ public class ProjectGenerationRequestTests {
}
@Test
public void invalidType() throws Exception {
public void invalidType() {
this.request.setType("does-not-exist");
this.thrown.expect(ReportableException.class);
this.request.generateUrl(createDefaultMetadata());

View File

@@ -31,7 +31,7 @@ public class EscapeAwareWhiteSpaceArgumentDelimiterTests {
private final EscapeAwareWhiteSpaceArgumentDelimiter delimiter = new EscapeAwareWhiteSpaceArgumentDelimiter();
@Test
public void simple() throws Exception {
public void simple() {
String s = "one two";
assertThat(this.delimiter.delimit(s, 0).getArguments()).containsExactly("one",
"two");
@@ -42,7 +42,7 @@ public class EscapeAwareWhiteSpaceArgumentDelimiterTests {
}
@Test
public void escaped() throws Exception {
public void escaped() {
String s = "o\\ ne two";
assertThat(this.delimiter.delimit(s, 0).getArguments()).containsExactly("o\\ ne",
"two");
@@ -54,7 +54,7 @@ public class EscapeAwareWhiteSpaceArgumentDelimiterTests {
}
@Test
public void quoted() throws Exception {
public void quoted() {
String s = "'o ne' 't w o'";
assertThat(this.delimiter.delimit(s, 0).getArguments()).containsExactly("'o ne'",
"'t w o'");
@@ -62,7 +62,7 @@ public class EscapeAwareWhiteSpaceArgumentDelimiterTests {
}
@Test
public void doubleQuoted() throws Exception {
public void doubleQuoted() {
String s = "\"o ne\" \"t w o\"";
assertThat(this.delimiter.delimit(s, 0).getArguments())
.containsExactly("\"o ne\"", "\"t w o\"");
@@ -70,7 +70,7 @@ public class EscapeAwareWhiteSpaceArgumentDelimiterTests {
}
@Test
public void nestedQuotes() throws Exception {
public void nestedQuotes() {
String s = "\"o 'n''e\" 't \"w o'";
assertThat(this.delimiter.delimit(s, 0).getArguments())
.containsExactly("\"o 'n''e\"", "'t \"w o'");
@@ -79,7 +79,7 @@ public class EscapeAwareWhiteSpaceArgumentDelimiterTests {
}
@Test
public void escapedQuotes() throws Exception {
public void escapedQuotes() {
String s = "\\'a b";
ArgumentList argumentList = this.delimiter.delimit(s, 0);
assertThat(argumentList.getArguments()).isEqualTo(new String[] { "\\'a", "b" });
@@ -87,7 +87,7 @@ public class EscapeAwareWhiteSpaceArgumentDelimiterTests {
}
@Test
public void escapes() throws Exception {
public void escapes() {
String s = "\\ \\\\.\\\\\\t";
assertThat(this.delimiter.parseArguments(s)).containsExactly(" \\.\\\t");
}

View File

@@ -49,19 +49,19 @@ public class DependencyManagementArtifactCoordinatesResolverTests {
}
@Test
public void getGroupIdForBootArtifact() throws Exception {
public void getGroupIdForBootArtifact() {
assertThat(this.resolver.getGroupId("spring-boot-something"))
.isEqualTo("org.springframework.boot");
verify(this.dependencyManagement, never()).find(anyString());
}
@Test
public void getGroupIdFound() throws Exception {
public void getGroupIdFound() {
assertThat(this.resolver.getGroupId("a1")).isEqualTo("g1");
}
@Test
public void getGroupIdNotFound() throws Exception {
public void getGroupIdNotFound() {
assertThat(this.resolver.getGroupId("a2")).isNull();
}

View File

@@ -19,7 +19,6 @@ package org.springframework.boot.cli.compiler.grape;
import java.io.File;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.apache.maven.settings.building.SettingsBuildingException;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
@@ -56,17 +55,17 @@ public class SettingsXmlRepositorySystemSessionAutoConfigurationTests {
}
@Test
public void basicSessionCustomization() throws SettingsBuildingException {
public void basicSessionCustomization() {
assertSessionCustomization("src/test/resources/maven-settings/basic");
}
@Test
public void encryptedSettingsSessionCustomization() throws SettingsBuildingException {
public void encryptedSettingsSessionCustomization() {
assertSessionCustomization("src/test/resources/maven-settings/encrypted");
}
@Test
public void propertyInterpolation() throws SettingsBuildingException {
public void propertyInterpolation() {
final DefaultRepositorySystemSession session = MavenRepositorySystemUtils
.newSession();
given(this.repositorySystem.newLocalRepositoryManager(eq(session),