diff options
| author | Kostya <mail@sartin.in> | 2026-10-12 11:50:31 +0300 |
|---|---|---|
| committer | Kostya <mail@sartin.in> | 2026-10-12 11:51:00 +0300 |
| commit | da1683eccff72b5d4745fe7f5eaac42d700e7989 (patch) | |
| tree | 7377659eb33f10782bf74a15189c5985ec8ad0ee /server/src/test/java/market/guess | |
| parent | 3a734b84705ccb8174e9cf24b74d7a3c3b2c1beb (diff) | |
| download | guess-market-da1683eccff72b5d4745fe7f5eaac42d700e7989.tar.gz guess-market-da1683eccff72b5d4745fe7f5eaac42d700e7989.tar.xz guess-market-da1683eccff72b5d4745fe7f5eaac42d700e7989.zip | |
api: share the user directory row with clients
The row GET /api/users and /api/sync send for each user was a record
private to UsersServlet, so a client had nothing to deserialize it
into. Move it to the api module as UserSummaryDTO.
Make TestServer public as well, so client modules can test against a
real embedded server.
Diffstat (limited to 'server/src/test/java/market/guess')
| -rw-r--r-- | server/src/test/java/market/guess/server/TestServer.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/src/test/java/market/guess/server/TestServer.java b/server/src/test/java/market/guess/server/TestServer.java index 1ab87ae..c6e3f71 100644 --- a/server/src/test/java/market/guess/server/TestServer.java +++ b/server/src/test/java/market/guess/server/TestServer.java | |||
| @@ -15,12 +15,12 @@ import org.apache.catalina.webresources.DirResourceSet; | |||
| 15 | import org.apache.catalina.webresources.StandardRoot; | 15 | import org.apache.catalina.webresources.StandardRoot; |
| 16 | import org.apache.tomcat.util.scan.StandardJarScanner; | 16 | import org.apache.tomcat.util.scan.StandardJarScanner; |
| 17 | 17 | ||
| 18 | final class TestServer implements AutoCloseable { | 18 | public final class TestServer implements AutoCloseable { |
| 19 | private final Tomcat tomcat; | 19 | private final Tomcat tomcat; |
| 20 | private final StandardContext ctx; | 20 | private final StandardContext ctx; |
| 21 | final String api; | 21 | public final String api; |
| 22 | 22 | ||
| 23 | TestServer(Path base) throws Exception { | 23 | public TestServer(Path base) throws Exception { |
| 24 | tomcat = new Tomcat(); | 24 | tomcat = new Tomcat(); |
| 25 | tomcat.setBaseDir(base.toString()); | 25 | tomcat.setBaseDir(base.toString()); |
| 26 | tomcat.setPort(0); | 26 | tomcat.setPort(0); |
| @@ -47,7 +47,7 @@ final class TestServer implements AutoCloseable { | |||
| 47 | return Path.of(ctx.getWorkPath()); | 47 | return Path.of(ctx.getWorkPath()); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | static HttpClient client() { | 50 | public static HttpClient client() { |
| 51 | return HttpClient.newBuilder().cookieHandler(new CookieManager()).build(); | 51 | return HttpClient.newBuilder().cookieHandler(new CookieManager()).build(); |
| 52 | } | 52 | } |
| 53 | 53 | ||