Skip to content

Commit 32e9879

Browse files
author
Haydon Perrin
committed
TestController: Added single definition completablefuture return type test
1 parent b4e8952 commit 32e9879

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/test/TestController.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import java.util.List;
44
import java.util.Map;
55
import java.util.Set;
6+
import java.util.concurrent.CompletableFuture;
67

78
import org.example.myapp.web.AppRoles;
9+
import org.example.myapp.web.HelloDto;
810
import org.example.myapp.web.Roles;
911

1012
import io.avaje.http.api.Controller;
@@ -122,4 +124,10 @@ void neo(
122124

123125
System.out.println("Ever have that feeling where you're not sure if you're awake or dreaming?");
124126
}
127+
128+
@Get("/async")
129+
CompletableFuture<HelloDto> getAllAsync() {
130+
return CompletableFuture.supplyAsync(() -> new HelloDto(12, "Jim", "asd"));
131+
}
132+
125133
}

0 commit comments

Comments
 (0)