Add support for pom.xml generation as well as test in starter project

This commit is contained in:
Dave Syer
2013-11-01 14:39:56 +00:00
parent 786219a548
commit a71d4182d8
5 changed files with 44 additions and 10 deletions

View File

@@ -0,0 +1,17 @@
package ${packageName};
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationContextLoader;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = Application.class, loader=SpringApplicationContextLoader.class)
public class ApplicationTests {
@Test
public void contextLoads() {
}
}

View File

@@ -34,7 +34,7 @@
</div>
<h1>Spring Initializr</h1>
<div>
<form action="/starter.zip" method="get">
<form id="form" action="/starter.zip" method="get">
<label for="groupId">Group:</label> <input id="groupId" type="text" value="org.demo" name="groupId"/>
<label for="artifactId">Artifact:</label> <input id="artifactId" type="text" value="demo" name="artifactId"/>
<label for="name">Name:</label> <input id="name" type="text" value="demo" name="name"/>
@@ -49,7 +49,7 @@
<label>Type:</label>
<% types.each { %>
<label class="radio">
<input type="radio" name="type" value="${it.value}"${it.selected ? ' checked="true"' : ''}/>
<input type="radio" name="type" value="${it.value}"${it.selected ? ' checked="true"' : ''} onclick="javascript:this.form.action='/${it.value}'"/>
${it.name}
</label><% } %>
<button type="submit" class="btn">Generate</button>

View File

@@ -21,6 +21,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter${it}</artifactId>
</dependency><% } %>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<properties>