Skip to content

Commit 86aac66

Browse files
committed
uncomment test
1 parent 9bf2c50 commit 86aac66

File tree

1 file changed

+71
-62
lines changed

1 file changed

+71
-62
lines changed

tests/test-nima-jsonb/src/main/java/org/example/HelloController.java

Lines changed: 71 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,83 @@
11
package org.example;
22

3+
import java.util.List;
4+
import java.util.Map;
5+
import java.util.Set;
6+
37
import io.avaje.http.api.Controller;
48
import io.avaje.http.api.Form;
9+
import io.avaje.http.api.Get;
510
import io.avaje.http.api.Post;
11+
import io.avaje.http.api.Produces;
12+
import io.avaje.http.api.Put;
13+
import io.helidon.nima.webserver.http.ServerRequest;
14+
import io.helidon.nima.webserver.http.ServerResponse;
615

716
@Controller
817
public class HelloController {
918

10-
// @Produces("image/png")
11-
// @Get("/get")
12-
// byte[] testBytes() {
13-
//
14-
// return "not really an image but ok".getBytes();
15-
// }
16-
//
17-
// @Get("/void")
18-
// void testVoid(Person p, ServerResponse res) {
19-
// res.send("success");
20-
// }
21-
//
22-
// @Get("/helidon")
23-
// void testHelidon(ServerRequest req, ServerResponse res) {
24-
//
25-
// res.send("success");
26-
// }
27-
//
28-
// @Get("hello")
29-
// String helloWorld() {
30-
// return "Hello world";
31-
// }
32-
//
33-
// @Get("person/{name}/{sortBy}")
34-
// Person person(String name, String sortBy) {
35-
// final var p = new Person();
36-
// p.setId(42);
37-
// p.setName(name + " hello" + " sortBy:" + sortBy);
38-
// return p;
39-
// }
40-
//
41-
// @Get("person/{sortBy}/list")
42-
// List<Person> personList(String sortBy) {
43-
// final var p = new Person();
44-
// p.setId(42);
45-
// return List.of(p, p);
46-
// }
47-
//
48-
// @Get("person/{sortBy}/set")
49-
// Set<Person> personSet(String sortBy) {
50-
// final var p = new Person();
51-
// p.setId(42);
52-
// return Set.of(p, p);
53-
// }
54-
//
55-
// @Get("person/{sortBy}/map")
56-
// Map<String, Person> personMap(String sortBy) {
57-
// final var p = new Person();
58-
// p.setId(42);
59-
// return Map.of(sortBy, p);
60-
// }
61-
//
62-
// @Post("person/update")
63-
// String add(Person newGuy) {
64-
//
65-
// return "New Guy Added";
66-
// }
67-
//
68-
// @Put("person/update")
69-
// String addMultiple(List<Person> newGuys) {
70-
// return "New Guys Added";
71-
// }
19+
@Produces("image/png")
20+
@Get("/get")
21+
byte[] testBytes() {
22+
23+
return "not really an image but ok".getBytes();
24+
}
25+
26+
@Get("/void")
27+
void testVoid(Person p, ServerResponse res) {
28+
res.send("success");
29+
}
30+
31+
@Get("/helidon")
32+
void testHelidon(ServerRequest req, ServerResponse res) {
33+
34+
res.send("success");
35+
}
36+
37+
@Get("hello")
38+
String helloWorld() {
39+
return "Hello world";
40+
}
41+
42+
@Get("person/{name}/{sortBy}")
43+
Person person(String name, String sortBy) {
44+
final var p = new Person();
45+
p.setId(42);
46+
p.setName(name + " hello" + " sortBy:" + sortBy);
47+
return p;
48+
}
49+
50+
@Get("person/{sortBy}/list")
51+
List<Person> personList(String sortBy) {
52+
final var p = new Person();
53+
p.setId(42);
54+
return List.of(p, p);
55+
}
56+
57+
@Get("person/{sortBy}/set")
58+
Set<Person> personSet(String sortBy) {
59+
final var p = new Person();
60+
p.setId(42);
61+
return Set.of(p, p);
62+
}
63+
64+
@Get("person/{sortBy}/map")
65+
Map<String, Person> personMap(String sortBy) {
66+
final var p = new Person();
67+
p.setId(42);
68+
return Map.of(sortBy, p);
69+
}
70+
71+
@Post("person/update")
72+
String add(Person newGuy) {
73+
74+
return "New Guy Added";
75+
}
76+
77+
@Put("person/update")
78+
String addMultiple(List<Person> newGuys) {
79+
return "New Guys Added";
80+
}
7281
@Form
7382
@Post("form")
7483
String form(String name, String email, String url) {

0 commit comments

Comments
 (0)