minor cleanup, docs, and integration tests for username API

This commit is contained in:
Sergey Skrobotov
2023-05-31 23:39:02 -07:00
parent 47cc7fd615
commit e6917d8427
7 changed files with 306 additions and 183 deletions

View File

@@ -269,6 +269,15 @@ public final class Operations {
return requireNonNull(execute.getRight());
}
public void executeExpectStatusCode(final int expectedStatusCode) {
final Pair<Integer, Void> execute = execute(Void.class);
Validate.isTrue(
execute.getLeft() == expectedStatusCode,
"Unexpected response code: %d",
execute.getLeft()
);
}
public <T> Pair<Integer, T> execute(final Class<T> expectedType) {
builder.uri(serverUri(endpoint, queryParams))
.header(HttpHeaders.USER_AGENT, USER_AGENT);