X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fmessagerouter%2Fmsgrtr.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Fdmaap%2Fmr%2Ftest%2Fdmaap%2FDmaapApiKeyTest.java;h=2c97a0bc05aa2e7d9be349d2488ac8b87580436e;hp=f40025ae9f84016de38df3ad64fff3e6ee808f56;hb=ff89c8072fc72e672ff9eb149ca8b2e8fe69bd7a;hpb=ab3015141a2cb42308f1d09dc3a7edc8c10cf5c7 diff --git a/src/test/java/org/onap/dmaap/mr/test/dmaap/DmaapApiKeyTest.java b/src/test/java/org/onap/dmaap/mr/test/dmaap/DmaapApiKeyTest.java index f40025a..2c97a0b 100644 --- a/src/test/java/org/onap/dmaap/mr/test/dmaap/DmaapApiKeyTest.java +++ b/src/test/java/org/onap/dmaap/mr/test/dmaap/DmaapApiKeyTest.java @@ -65,13 +65,6 @@ public class DmaapApiKeyTest { return dataObj; } - // 1. create key - public void testCreateKey() { - LOGGER.info("test case create key"); - ApiKeyBean apiKeyBean = new ApiKeyBean("nm254w@att.com", "Creating Api Key."); - returnKey(apiKeyBean); - LOGGER.info("Successfully returned after creating key"); - } public void assertStatus(Response response) { assertTrue(response.getStatus() == HttpStatus.SC_OK); @@ -92,71 +85,7 @@ public class DmaapApiKeyTest { } - // 3. get specific key - public void testSpecificKey() { - LOGGER.info("test case get specific key"); - String apiKey = ""; - ApiKeyBean apiKeyBean = new ApiKeyBean("ai039@att.com", "Creating Api Key."); - - apiKey = (String) returnKey(apiKeyBean).get("key"); - target = client.target(url); - target = target.path("/apiKeys/"); - target = target.path(apiKey); - Response response = target.request().get(); - assertStatus(response); - LOGGER.info("successfully returned after fetching specific key"); - } - - // 4. update key - public void testUpdateKey() { - LOGGER.info("test case update key"); - String apiKey = ""; - String secretKey = ""; - final String serverCalculatedSignature; - final String X_CambriaAuth; - final String X_CambriaDate; - JSONObject jsonObj; - ApiKeyBean apiKeyBean = new ApiKeyBean("ai039@att.com", "Creating Api Key for update"); - ApiKeyBean apiKeyBean1 = new ApiKeyBean("ai03911@att.com", "updating Api Key."); - jsonObj = returnKey(apiKeyBean); - apiKey = (String) jsonObj.get("key"); - secretKey = (String) jsonObj.get("secret"); - - serverCalculatedSignature = sha1HmacSigner.sign(date, secretKey); - X_CambriaAuth = apiKey + ":" + serverCalculatedSignature; - X_CambriaDate = date; - target = client.target(url); - target = target.path("/apiKeys/" + apiKey); - Response response1 = target.request().header("X-CambriaAuth", X_CambriaAuth) - .header("X-CambriaDate", X_CambriaDate).put(Entity.json(apiKeyBean1)); - assertStatus(response1); - LOGGER.info("successfully returned after updating key"); - } - - // 5. delete key - public void testDeleteKey() { - LOGGER.info("test case delete key"); - String apiKey = ""; - String secretKey = ""; - final String serverCalculatedSignature; - final String X_CambriaAuth; - final String X_CambriaDate; - JSONObject jsonObj; - ApiKeyBean apiKeyBean = new ApiKeyBean("ai039@att.com", "Creating Api Key."); - jsonObj = returnKey(apiKeyBean); - apiKey = (String) jsonObj.get("key"); - secretKey = (String) jsonObj.get("secret"); - serverCalculatedSignature = sha1HmacSigner.sign(date, secretKey); - X_CambriaAuth = apiKey + ":" + serverCalculatedSignature; - X_CambriaDate = date; - target = client.target(url); - target = target.path("/apiKeys/" + apiKey); - Response response2 = target.request().header("X-CambriaAuth", X_CambriaAuth) - .header("X-CambriaDate", X_CambriaDate).delete(); - assertStatus(response2); - LOGGER.info("successfully returned after deleting key"); - } */ } \ No newline at end of file