This commit is contained in:
Phillip Webb
2015-06-04 00:37:15 -07:00
parent fca192fa41
commit 412b7b9e50
47 changed files with 272 additions and 242 deletions

View File

@@ -25,6 +25,7 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import joptsimple.OptionSet;
import org.apache.http.Header;
import org.apache.http.client.methods.HttpUriRequest;
import org.junit.Before;
@@ -34,7 +35,6 @@ import org.junit.rules.TemporaryFolder;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.MockitoAnnotations;
import org.springframework.boot.cli.command.status.ExitStatus;
import static org.hamcrest.Matchers.startsWith;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2014 the original author or authors.
* Copyright 2012-2015 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.
@@ -27,7 +27,6 @@ import org.json.JSONObject;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.util.StreamUtils;
@@ -118,7 +117,7 @@ public class ProjectGenerationRequestTests {
public void customLanguage() {
this.request.setLanguage("groovy");
assertEquals(createDefaultUrl("?type=test-type&language=groovy"),
this.request.generateUrl(createDefaultMetadata()));
this.request.generateUrl(createDefaultMetadata()));
}
@Test
@@ -127,8 +126,9 @@ public class ProjectGenerationRequestTests {
this.request.setArtifactId("sample");
this.request.setVersion("1.0.1-SNAPSHOT");
this.request.setDescription("Spring Boot Test");
assertEquals(createDefaultUrl("?groupId=org.acme&artifactId=sample&version=1.0.1-SNAPSHOT" +
"&description=Spring+Boot+Test&type=test-type"),
assertEquals(
createDefaultUrl("?groupId=org.acme&artifactId=sample&version=1.0.1-SNAPSHOT"
+ "&description=Spring+Boot+Test&type=test-type"),
this.request.generateUrl(createDefaultMetadata()));
}

View File

@@ -47,7 +47,6 @@ public class CompositeDependencyManagementTests {
public void unknownSpringBootVersion() {
given(this.dependencyManagement1.getSpringBootVersion()).willReturn(null);
given(this.dependencyManagement2.getSpringBootVersion()).willReturn(null);
assertThat(new CompositeDependencyManagement(this.dependencyManagement1,
this.dependencyManagement2).getSpringBootVersion(), is(nullValue()));
}
@@ -56,7 +55,6 @@ public class CompositeDependencyManagementTests {
public void knownSpringBootVersion() {
given(this.dependencyManagement1.getSpringBootVersion()).willReturn("1.2.3");
given(this.dependencyManagement2.getSpringBootVersion()).willReturn("1.2.4");
assertThat(new CompositeDependencyManagement(this.dependencyManagement1,
this.dependencyManagement2).getSpringBootVersion(), is("1.2.3"));
}
@@ -65,7 +63,6 @@ public class CompositeDependencyManagementTests {
public void unknownDependency() {
given(this.dependencyManagement1.find("artifact")).willReturn(null);
given(this.dependencyManagement2.find("artifact")).willReturn(null);
assertThat(new CompositeDependencyManagement(this.dependencyManagement1,
this.dependencyManagement2).find("artifact"), is(nullValue()));
}
@@ -76,7 +73,6 @@ public class CompositeDependencyManagementTests {
new Dependency("test", "artifact", "1.2.3"));
given(this.dependencyManagement2.find("artifact")).willReturn(
new Dependency("test", "artifact", "1.2.4"));
assertThat(new CompositeDependencyManagement(this.dependencyManagement1,
this.dependencyManagement2).find("artifact"), is(new Dependency("test",
"artifact", "1.2.3")));
@@ -88,11 +84,11 @@ public class CompositeDependencyManagementTests {
Arrays.asList(new Dependency("test", "artifact", "1.2.3")));
given(this.dependencyManagement2.getDependencies()).willReturn(
Arrays.asList(new Dependency("test", "artifact", "1.2.4")));
assertThat(
new CompositeDependencyManagement(this.dependencyManagement1,
this.dependencyManagement2).getDependencies(),
contains(new Dependency("test", "artifact", "1.2.3"), new Dependency(
"test", "artifact", "1.2.4")));
}
}