mirror of
https://gitee.com/dcren/initializr.git
synced 2025-10-21 11:07:37 +08:00
Add support for pom.xml generation as well as test in starter project
This commit is contained in:
17
templates/ApplicationTests.java
Normal file
17
templates/ApplicationTests.java
Normal 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() {
|
||||
}
|
||||
|
||||
}
|
@@ -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>
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user