forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRouteCollectionTest.java
More file actions
42 lines (31 loc) · 911 Bytes
/
RouteCollectionTest.java
File metadata and controls
42 lines (31 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package org.jooby;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import org.jooby.Route.Collection;
import org.jooby.Route.Definition;
import org.junit.Test;
public class RouteCollectionTest {
@Test
public void renderer() {
Collection col = new Route.Collection(new Route.Definition("*", "*", (req, rsp, chain) -> {
}))
.renderer("json");
assertEquals("json", col.renderer());
}
@Test
public void attr() {
Definition def = new Route.Definition("*", "*", (req, rsp, chain) -> {
});
new Route.Collection(def)
.attr("foo", "bar");
assertEquals("bar", def.attributes().get("foo"));
}
@Test
public void excludes() {
Definition def = new Route.Definition("*", "*", (req, rsp, chain) -> {
});
new Route.Collection(def)
.excludes("/path");
assertEquals(Arrays.asList("/path"), def.excludes());
}
}