Skip to content

Commit 9f30e99

Browse files
committed
API Change: View.of -> Results.html("viewname") fix #64
1 parent a46c721 commit 9f30e99

File tree

30 files changed

+385
-83
lines changed

30 files changed

+385
-83
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ jdk:
77
install:
88
- mvn install -Dlogback.configurationFile=logback-travis.xml -DskipTests=true -Dmaven.javadoc.skip=true -B -V
99
script:
10-
- mvn test -Dlogback.configurationFile=logback-travis.xml -B
11-
after_success:
1210
- mvn -Dlogback.configurationFile=logback-travis.xml clean package coveralls:report -P coverage

coverage-report/src/test/java/org/jooby/ContentNegotiationFeature.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ public static class Resource {
1616
@GET
1717
public Result any() {
1818
return Results
19-
.when("text/html", () -> View.of("test", "this", "body"))
19+
.when("text/html", () -> Results.html("test").put("this", "body"))
2020
.when("*/*", () -> "body");
2121
}
2222

2323
@Path("/html")
2424
@GET
2525
@Produces("text/html")
2626
public View html() {
27-
return View.of("test", "this", "body");
27+
return Results.html("test").put("this", "body");
2828
}
2929

3030
@Path("/json")
@@ -44,7 +44,7 @@ public String json() {
4444

4545
get("/any", req ->
4646
Results
47-
.when("text/html", () -> View.of("test", "this", "body"))
47+
.when("text/html", () -> Results.html("test").put("this", "body"))
4848
.when("*/*", () -> "body"));
4949

5050
get("/status", req ->
@@ -53,10 +53,10 @@ public String json() {
5353

5454
get("/like", req ->
5555
Results
56-
.when("text/html", () -> View.of("test", "this", "body"))
56+
.when("text/html", () -> Results.html("test").put("this", "body"))
5757
.when("application/json", () -> "body"));
5858

59-
get("/html", (req, resp) -> resp.send(View.of("test", "this", "body")))
59+
get("/html", (req, resp) -> resp.send(Results.html("test").put("this", "body")))
6060
.produces(MediaType.html);
6161

6262
get("/json", (req, resp) -> resp.send("body"))

coverage-report/src/test/java/org/jooby/TemplateEngineFeature.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static class Resource {
1717
@Path("/view")
1818
@GET
1919
public View view() throws IOException {
20-
return View.of("test", "this", "model");
20+
return Results.html("test").put("this", "model");
2121
}
2222

2323
}
@@ -30,7 +30,7 @@ public View view() throws IOException {
3030
});
3131

3232
get("/view", (req, resp) -> {
33-
resp.send(View.of("test", "this", "model"));
33+
resp.send(Results.html("test").put("this", "model"));
3434
});
3535

3636
use(Resource.class);

coverage-report/src/test/java/org/jooby/ViewWithExplicitEngineFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void render(final View viewable, final Context writer) throws Exception {
3535

3636
get("/:engine", (req, rsp) -> {
3737
String engine = req.param("engine").value();
38-
rsp.send(View.of("view", "this", new Object()).engine(engine));
38+
rsp.send(Results.html("view").put("this", new Object()).engine(engine));
3939
});
4040

4141
}

coverage-report/src/test/java/org/jooby/ftl/FtlFeature.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.jooby.ftl;
22

3-
import org.jooby.View;
3+
import org.jooby.Results;
44
import org.jooby.test.ServerFeature;
55
import org.junit.Test;
66

@@ -9,7 +9,7 @@ public class FtlFeature extends ServerFeature {
99
{
1010
use(new Ftl());
1111

12-
get("/", req -> View.of("org/jooby/ftl/index", "model", req.param("model").value()));
12+
get("/", req -> Results.html("org/jooby/ftl/index").put("model", req.param("model").value()));
1313
}
1414

1515
@Test

coverage-report/src/test/java/org/jooby/ftl/FtlLocalsFeature.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.jooby.ftl;
22

3-
import org.jooby.View;
3+
import org.jooby.Results;
44
import org.jooby.test.ServerFeature;
55
import org.junit.Test;
66

@@ -20,7 +20,7 @@ public class FtlLocalsFeature extends ServerFeature {
2020
});
2121

2222
get("/", req -> {
23-
return View.of("org/jooby/ftl/locals");
23+
return Results.html("org/jooby/ftl/locals");
2424
});
2525
}
2626

coverage-report/src/test/java/org/jooby/hbs/HbsCustomFeature.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.jooby.hbs;
22

3-
import org.jooby.View;
3+
import org.jooby.Results;
44
import org.jooby.test.ServerFeature;
55
import org.junit.Test;
66

@@ -13,7 +13,7 @@ public class HbsCustomFeature extends ServerFeature {
1313
h.with(new ClassPathTemplateLoader("/org/jooby/hbs", ".html"));
1414
}));
1515

16-
get("/", req -> View.of("index", "model", req.param("model").value()));
16+
get("/", req -> Results.html("index").put("model", req.param("model").value()));
1717
}
1818

1919
@Test

coverage-report/src/test/java/org/jooby/hbs/HbsCustomValueResolverFeature.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import java.util.Map.Entry;
55
import java.util.Set;
66

7-
import org.jooby.View;
7+
import org.jooby.Results;
88
import org.jooby.test.ServerFeature;
99
import org.junit.Test;
1010

@@ -33,7 +33,7 @@ public Set<Entry<String, Object>> propertySet(final Object context) {
3333
{
3434
use(new Hbs().with(new VR()));
3535

36-
get("/", req -> View.of("org/jooby/hbs/index"));
36+
get("/", req -> Results.html("org/jooby/hbs/index"));
3737
}
3838

3939
@Test

coverage-report/src/test/java/org/jooby/hbs/HbsFeature.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.jooby.hbs;
22

3-
import org.jooby.View;
3+
import org.jooby.Results;
44
import org.jooby.test.ServerFeature;
55
import org.junit.Test;
66

@@ -9,7 +9,7 @@ public class HbsFeature extends ServerFeature {
99
{
1010
use(new Hbs());
1111

12-
get("/", req -> View.of("org/jooby/hbs/index", "model", req.param("model").value()));
12+
get("/", req -> Results.html("org/jooby/hbs/index").put("model", req.param("model").value()));
1313
}
1414

1515
@Test

coverage-report/src/test/java/org/jooby/hbs/HbsHelpersFeature.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.jooby.hbs;
22

3-
import org.jooby.View;
3+
import org.jooby.Results;
44
import org.jooby.test.ServerFeature;
55
import org.junit.Test;
66

@@ -16,7 +16,7 @@ public String itWorks() {
1616
{
1717
use(new Hbs(Helpers.class));
1818

19-
get("/", req -> View.of("org/jooby/hbs/helpers"));
19+
get("/", req -> Results.html("org/jooby/hbs/helpers"));
2020
}
2121

2222
@Test

0 commit comments

Comments
 (0)