GiteaClientTest
|
100%
successful |
Tests
| Test | Duration | Result |
|---|---|---|
| a blank build status context falls back to the repository-wide one | 0.020s | passed |
| a build's own status context replaces the repository-wide one | 0.031s | passed |
| is false when any required value is missing | 0.004s | passed |
| is true when baseUrl, owner, repo, and token are configured | 0.003s | passed |
| maps every build status to the documented Gitea state | 0.092s | passed |
| omits target_url when none is given | 0.014s | passed |
| only needs baseUrl and token, not owner/repo | 0.008s | passed |
| posts state, context, description, and target_url with token auth | 0.118s | passed |
| requests statuses sorted by recentupdate with token auth | 0.026s | passed |
| returns Disabled when unconfigured, without a request | 0.005s | passed |
| returns Error for an unknown state value | 0.019s | passed |
| returns Error for malformed JSON instead of throwing | 0.012s | passed |
| returns Error on HTTP 4xx/5xx instead of throwing | 0.019s | passed |
| returns Error when Gitea is unreachable instead of throwing | 0.006s | passed |
| returns None for an empty status list | 0.012s | passed |
| returns None when no status matches the context | 0.011s | passed |
| returns false on HTTP errors instead of throwing | 0.028s | passed |
| returns false when Gitea is unreachable instead of throwing | 0.049s | passed |
| returns false without a request when disabled | 0.006s | passed |
| returns null on HTTP errors, missing login, or malformed JSON instead of throwing | 0.024s | passed |
| returns null when baseUrl or token is missing | 0.002s | passed |
| returns the login of the token's user | 0.011s | passed |
| returns the newest status matching the configured context | 0.016s | passed |
Standard output
Creating nstance of class de.hoennig.werkator.gitea.GiteaClientTest
2026-09-03T12:29:19.381Z WARN 144 --- [r @coroutine#37] o.e.jetty.server.AbstractConnector : Acceptors should be <= availableProcessors: oejs.NetworkTrafficServerConnector@128d0580{HTTP/1.1, (http/1.1, h2c)}{0.0.0.0:0}
2026-09-03T12:29:19.403Z WARN 144 --- [pe-780619746#37] o.eclipse.jetty.util.DeprecationWarning : Using @Deprecated Class org.eclipse.jetty.ee10.servlets.CrossOriginFilter
2026-09-03T12:29:19.747Z WARN 144 --- [e-780619746#330] de.hoennig.werkator.gitea.GiteaClient : Could not publish Gitea status for abc123: 500 Internal Server Error: [no body]
2026-09-03T12:29:19.798Z WARN 144 --- [e-780619746#330] de.hoennig.werkator.gitea.GiteaClient : Could not publish Gitea status for abc123: I/O error on POST request for "http://localhost:1/api/v1/repos/the-owner/the-repo/statuses/abc123": null
2026-09-03T12:29:19.883Z WARN 144 --- [e-780619746#331] de.hoennig.werkator.gitea.GiteaClient : Could not parse Gitea status response for abc123: Cannot deserialize value of type `java.util.ArrayList<de.hoennig.werkator.gitea.GiteaClient$GiteaCommitStatus>` from Object value (token `JsonToken.START_OBJECT`)
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 1]
2026-09-03T12:29:19.921Z WARN 144 --- [e-780619746#331] de.hoennig.werkator.gitea.GiteaClient : Could not read Gitea status for abc123: 404 Not Found: [no body]
2026-09-03T12:29:19.927Z WARN 144 --- [e-780619746#331] de.hoennig.werkator.gitea.GiteaClient : Could not read Gitea status for abc123: 500 Internal Server Error: [no body]
2026-09-03T12:29:19.935Z WARN 144 --- [e-780619746#331] de.hoennig.werkator.gitea.GiteaClient : Could not read Gitea status for abc123: I/O error on GET request for "http://localhost:1/api/v1/repos/the-owner/the-repo/commits/abc123/statuses": null
2026-09-03T12:29:19.978Z WARN 144 --- [e-780619746#332] de.hoennig.werkator.gitea.GiteaClient : Could not resolve Gitea username: 401 Unauthorized: [no body]
2026-09-03T12:29:19.993Z WARN 144 --- [e-780619746#332] de.hoennig.werkator.gitea.GiteaClient : Could not parse Gitea user response: Unrecognized token 'not': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 1]