This repository was archived by the owner on Mar 3, 2026. It is now read-only.
forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue987.java
More file actions
47 lines (42 loc) · 1.31 KB
/
Issue987.java
File metadata and controls
47 lines (42 loc) · 1.31 KB
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
43
44
45
46
47
package issues;
import org.jooby.apitool.ApiParser;
import org.jooby.apitool.RouteMethodAssert;
import org.jooby.apitool.RouteParameter;
import org.junit.Test;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Issue987 {
@Test
public void shouldNotLostBodyParameterType() throws Exception {
new RouteMethodAssert(new ApiParser(dir()).parseFully(new App987()))
.next(r -> {
r.returnType(String.class);
r.pattern("/api/login");
r.description("Authenticates a user, generating an Authorization token.");
r.summary(null);
r.param(p -> {
p.name("body")
.type(LoginRequest.class)
.kind(RouteParameter.Kind.BODY);
});
})
.next(r -> {
r.returnType(String.class);
r.pattern("/use/config");
r.description(null);
r.summary(null);
r.param(p -> {
p.name("body")
.type(LoginRequest.class)
.kind(RouteParameter.Kind.BODY);
});
}).done();
}
private Path dir() {
Path userdir = Paths.get(System.getProperty("user.dir"));
if (!userdir.toString().endsWith("jooby-apitool")) {
userdir = userdir.resolve("modules").resolve("jooby-apitool");
}
return userdir;
}
}