mirror of
https://github.com/ethauvin/rife2-hello.git
synced 2025-04-25 23:37:12 -07:00
Updated for better alignment across hello templates
This commit is contained in:
parent
e0e07a3d27
commit
8751306d0f
5 changed files with 12 additions and 12 deletions
|
@ -13,8 +13,8 @@ version = 1.0
|
|||
group = "com.example"
|
||||
|
||||
rife2 {
|
||||
version.set("1.4.0")
|
||||
uberMainClass.set("hello.AppUber")
|
||||
version.set("1.5.1")
|
||||
uberMainClass.set("hello.AppSiteUber")
|
||||
useAgent.set(true)
|
||||
precompiledTemplateTypes.add(HTML)
|
||||
}
|
||||
|
@ -36,12 +36,12 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation("org.jsoup:jsoup:1.15.3")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.1")
|
||||
testImplementation("org.jsoup:jsoup:1.15.4")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("hello.App")
|
||||
mainClass.set("hello.AppSite")
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
|
|
@ -2,7 +2,7 @@ package hello;
|
|||
|
||||
import rife.engine.*;
|
||||
|
||||
public class App extends Site {
|
||||
public class AppSite extends Site {
|
||||
public void setup() {
|
||||
var hello = get("/hello", c -> c.print(c.template("hello")));
|
||||
get("/", c -> c.redirect(hello));
|
||||
|
@ -11,6 +11,6 @@ public class App extends Site {
|
|||
public static void main(String[] args) {
|
||||
new Server()
|
||||
.staticResourceBase("src/main/webapp")
|
||||
.start(new App());
|
||||
.start(new AppSite());
|
||||
}
|
||||
}
|
|
@ -2,10 +2,10 @@ package hello;
|
|||
|
||||
import rife.engine.Server;
|
||||
|
||||
public class AppUber extends App {
|
||||
public class AppSiteUber extends AppSite {
|
||||
public static void main(String[] args) {
|
||||
new Server()
|
||||
.staticUberJarResourceBase("webapp")
|
||||
.start(new AppUber());
|
||||
.start(new AppSiteUber());
|
||||
}
|
||||
}
|
|
@ -11,13 +11,13 @@ import static org.junit.jupiter.api.Assertions.*;
|
|||
public class AppTest {
|
||||
@Test
|
||||
void verifyRoot() {
|
||||
var m = new MockConversation(new App());
|
||||
var m = new MockConversation(new AppSite());
|
||||
assertEquals(m.doRequest("/").getStatus(), 302);
|
||||
}
|
||||
|
||||
@Test
|
||||
void verifyHello() {
|
||||
var m = new MockConversation(new App());
|
||||
var m = new MockConversation(new AppSite());
|
||||
assertEquals("Hello", m.doRequest("/hello")
|
||||
.getTemplate().getValue("title"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue