use of org.openclinica.ns.response.v31.Response in project keywhiz by square.
the class SecretResourceTest method lookup.
SecretDetailResponseV2 lookup(String name) throws IOException {
Request get = clientRequest("/automation/v2/secrets/" + name).get().build();
Response httpResponse = mutualSslClient.newCall(get).execute();
assertThat(httpResponse.code()).isEqualTo(200);
return mapper.readValue(httpResponse.body().byteStream(), SecretDetailResponseV2.class);
}
use of org.openclinica.ns.response.v31.Response in project keywhiz by square.
the class SecretResourceTest method groupsListing.
List<String> groupsListing(String name) throws IOException {
Request get = clientRequest(format("/automation/v2/secrets/%s/groups", name)).get().build();
Response httpResponse = mutualSslClient.newCall(get).execute();
assertThat(httpResponse.code()).isEqualTo(200);
return mapper.readValue(httpResponse.body().byteStream(), new TypeReference<List<String>>() {
});
}
use of org.openclinica.ns.response.v31.Response in project keywhiz by square.
the class SecretResourceTest method setCurrentVersion.
private void setCurrentVersion(SetSecretVersionRequestV2 request) throws IOException {
RequestBody body = RequestBody.create(JSON, mapper.writeValueAsString(request));
Request post = clientRequest(format("/automation/v2/secrets/%s/setversion", request.name())).post(body).build();
Response httpResponse = mutualSslClient.newCall(post).execute();
assertThat(httpResponse.code()).isEqualTo(201);
}
use of org.openclinica.ns.response.v31.Response in project keywhiz by square.
the class GroupResourceTest method createClient.
private Response createClient(String client, String... groups) throws IOException {
ClientResourceTest clientResourceTest = new ClientResourceTest();
clientResourceTest.mutualSslClient = mutualSslClient;
Response response = clientResourceTest.create(CreateClientRequestV2.builder().name(client).groups(groups).build());
assertThat(response.code()).isEqualTo(201);
return response;
}
use of org.openclinica.ns.response.v31.Response in project keywhiz by square.
the class SecretResourceTest method secretInfo_notFound.
//---------------------------------------------------------------------------------------
// secretInfo
//---------------------------------------------------------------------------------------
@Test
public void secretInfo_notFound() throws Exception {
Request get = clientRequest("/automation/v2/secrets/non-existent").get().build();
Response httpResponse = mutualSslClient.newCall(get).execute();
assertThat(httpResponse.code()).isEqualTo(404);
}
Aggregations