Commit 01a33adf authored by Rucha Deshpande's avatar Rucha Deshpande
Browse files

bug fix

parent f71ef981
......@@ -24,6 +24,7 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.model.notification.HmacSecret;
import org.opengroup.osdu.core.common.model.notification.Subscription;
import org.opengroup.osdu.core.common.notification.ISubscriptionService;
import org.opengroup.osdu.core.common.notification.SubscriptionAPIConfig;
import org.opengroup.osdu.core.common.notification.SubscriptionException;
import org.opengroup.osdu.core.common.notification.SubscriptionFactory;
import org.opengroup.osdu.notification.util.*;
......@@ -37,11 +38,13 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
private String subscriptionId = null;
private String notificationId = null;
private ISubscriptionService subscriptionService;
private static SubscriptionFactory factory;
private ISubscriptionService awssubscriptionService;
private static SubscriptionFactory awsfactory;
@BeforeClass
public static void classSetup() throws Exception {
PubsubEndpointHMACTests.classSetup();
SubscriptionAPIConfig config = SubscriptionAPIConfig.builder().rootUrl(Config.Instance().RegisterServicePath).build();
awsfactory = new SubscriptionFactory(config);
}
@AfterClass
......@@ -90,7 +93,7 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
//hardcoding user here for 200 response tests. This is just initializing the subscription creation
headers.put("x-user-id", AwsConfig.getAWSCognitoUser());
DpsHeaders dpsHeaders = DpsHeaders.createFromMap(headers);
subscriptionService = factory.create(dpsHeaders);
awssubscriptionService = awsfactory.create(dpsHeaders);
System.out.println("****NOTIFICATION Created subscriptionService using following headers*******");
Map<String,String> h = dpsHeaders.getHeaders();
......@@ -110,7 +113,7 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
subscription.setSecret(secret);
try {
Subscription subscriptionCreated = subscriptionService.create(subscription);
Subscription subscriptionCreated = awssubscriptionService.create(subscription);
notificationId = subscriptionCreated.getNotificationId();
subscriptionId = subscriptionCreated.getId();
Config.Instance().NotificationId = notificationId;
......@@ -122,7 +125,7 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
@Override
protected void deleteResource() throws Exception {
subscriptionService.delete(subscriptionId);
awssubscriptionService.delete(subscriptionId);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment