use of co.cask.cdap.proto.security.SecureKeyCreateRequest in project cdap by caskdata.
the class SecureStoreTest method testGet.
@Test
public void testGet() throws Exception {
SecureKeyCreateRequest secureKeyCreateRequest = new SecureKeyCreateRequest(DESCRIPTION, DATA, PROPERTIES);
HttpResponse response = doPut("/v3/namespaces/default/securekeys/" + KEY, GSON.toJson(secureKeyCreateRequest));
Assert.assertEquals(200, response.getStatusLine().getStatusCode());
response = doGet("/v3/namespaces/default/securekeys/" + KEY);
Assert.assertEquals(DATA, readResponse(response));
// Get again
response = doGet("/v3/namespaces/default/securekeys/" + KEY);
Assert.assertEquals(DATA, readResponse(response));
response = delete(KEY);
Assert.assertEquals(200, response.getStatusLine().getStatusCode());
}
Aggregations