Skip to content

Commit

Permalink
Use ConcurrentHashMap
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaiyarasiganeshalingam committed Nov 18, 2024
1 parent b823b0a commit 650a6df
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import static org.wso2.ei.dataservice.integration.test.odata.ODataTestUtils.getETag;
import static org.wso2.ei.dataservice.integration.test.odata.ODataTestUtils.sendDELETE;
Expand Down Expand Up @@ -58,7 +59,7 @@ public void destroy() throws Exception {
public void validateETagRetrievalTestCase() throws Exception {
String endpoint = webAppUrl + "/odata/" + serviceName + "/" + configId + "/FILES";
String content = "{\"FILENAME\": \"WSO2PROD\" ,\"TYPE\" : \"dss\"}";
Map<String, String> headers = new HashMap<>();
ConcurrentHashMap<String, String> headers = new ConcurrentHashMap<>();
headers.put("Accept", "application/json");
Object[] response = sendPOST(endpoint, content, headers);
Assert.assertEquals(response[0], ODataTestUtils.CREATED);
Expand Down Expand Up @@ -87,7 +88,7 @@ public void validateETagRetrievalTestCase() throws Exception {
public void validateETagGenerationTestCase() throws Exception {
String endpoint = webAppUrl + "/odata/" + serviceName + "/" + configId + "/FILES";
String content = "{\"FILENAME\": \"WSO2\" ,\"TYPE\" : \"bam\"}";
Map<String, String> headers = new HashMap<>();
ConcurrentHashMap<String, String> headers = new ConcurrentHashMap<>();
headers.put("Accept", "application/json");
Object[] response = sendPOST(endpoint, content, headers);
Thread.sleep(1000);
Expand All @@ -112,7 +113,7 @@ public void validateETagGenerationTestCase() throws Exception {
@Test(groups = "wso2.dss", description = "etag concurrent handling with put method test", dependsOnMethods = "validateETagGenerationTestCase")
public void validateETagConcurrentHandlingTestCaseForPutMethod() throws Exception {
String endpoint = webAppUrl + "/odata/" + serviceName + "/" + configId + "/FILES(\'WSO2PROD\')";
Map<String, String> headers = new HashMap<>();
ConcurrentHashMap<String, String> headers = new ConcurrentHashMap<>();
headers.put("Accept", "application/json");
Object[] response = sendGET(endpoint, headers);
Thread.sleep(1000);
Expand Down Expand Up @@ -181,7 +182,7 @@ public void validateETagConcurrentHandlingTestCaseForPutMethod() throws Exceptio
@Test(groups = "wso2.dss", description = "etag concurrent handling with patch method test", dependsOnMethods = "validateETagConcurrentHandlingTestCaseForPutMethod")
public void validateETagConcurrentHandlingTestCaseForPatchMethod() throws Exception {
String endpoint = webAppUrl + "/odata/" + serviceName + "/" + configId + "/FILES(\'WSO2\')";
Map<String, String> headers = new HashMap<>();
ConcurrentHashMap<String, String> headers = new ConcurrentHashMap<>();
headers.put("Accept", "application/json");
Object[] response = sendGET(endpoint, headers);
Thread.sleep(1000);
Expand Down Expand Up @@ -252,7 +253,7 @@ public void validateETagConcurrentHandlingTestCaseForDeleteMethod() throws Excep
System.out.println("This test is temporarily skipped for this workflow");
String endpoint = webAppUrl + "/odata/" + serviceName + "/" + configId + "/FILES";
String content = "{\"FILENAME\": \"WSO2PROD\" ,\"TYPE\" : \"dss\"}";
Map<String, String> headers = new HashMap<>();
ConcurrentHashMap<String, String> headers = new ConcurrentHashMap<>();
headers.put("Accept", "application/json");
Object[] response = sendPOST(endpoint, content, headers);
Thread.sleep(1000);
Expand Down Expand Up @@ -314,7 +315,7 @@ public void validateETagConcurrentHandlingTestCaseForUpdatePropertyWithPutMethod
if (!Boolean.parseBoolean(System.getenv("CI_BUILD_SKIP"))) {
String endpoint = webAppUrl + "/odata/" + serviceName + "/" + configId + "/FILES";
String content = "{\"FILENAME\": \"WSO2PROD\" ,\"TYPE\" : \"dss\"}";
Map<String, String> headers = new HashMap<>();
ConcurrentHashMap<String, String> headers = new ConcurrentHashMap<>();
headers.put("Accept", "application/json");
Object[] response = sendPOST(endpoint, content, headers);
Thread.sleep(1000);
Expand Down Expand Up @@ -378,7 +379,7 @@ public void validateETagConcurrentHandlingTestCaseForUpdatePropertyWithPatchMeth
System.out.println("This test is temporarily skipped for this workflow");
String entityEndpoint = webAppUrl + "/odata/" + serviceName + "/" + configId + "/FILES(\'WSO2PROD\')";
String endpoint = webAppUrl + "/odata/" + serviceName + "/" + configId + "/FILES(\'WSO2PROD\')/TYPE";
Map<String, String> headers = new HashMap<>();
ConcurrentHashMap<String, String> headers = new ConcurrentHashMap<>();
headers.put("Accept", "application/json");
Object[] response = sendGET(entityEndpoint, headers);
Thread.sleep(1000);
Expand Down

0 comments on commit 650a6df

Please sign in to comment.