Commit 20950a67 authored by Komal Makkar's avatar Komal Makkar
Browse files

Changed version in core and removed the Azure implementation for PubsubEndpointHMACDescriptor.java

parent 9f649d56
Pipeline #7417 failed with stages
in 3 minutes and 37 seconds
// Copyright © Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.notification.api;
import org.opengroup.osdu.notification.util.Config;
import org.opengroup.osdu.notification.util.RestDescriptor;
import org.opengroup.osdu.notification.util.TestUtils;
import java.util.HashMap;
import java.util.Map;
public class PubsubEndpointHMACDescriptor extends RestDescriptor {
@Override
public String getPath() {
return "push-handlers/records-changed";
}
@Override
public String getHttpMethod() {
return "POST";
}
@Override
public String getValidBody() {
return "[{\n" +
" \"id\": \"2425\",\n" +
" \"eventType\": \"recordInserted\",\n" +
" \"subject\": \"myapp/vehicles/motorcycles\",\n" +
" \"data\": {\n" +
" \"attributes\": {\n" +
" \"correlation-id\": \"39137f49-67d6-4001-a6aa-15521ef4f49e\",\n" +
" \"data-partition-id\": \"" + TestUtils.getOsduTenant() + "\"\n" +
" },\n" +
" \"data\": \"W3sia2luZCI6InRlc3RraW5kIiwiaWQiOiJ0ZXN0aWQiLCJvcGVyYXRpb250eXBlIjoiY3JlYXRlIn0seyJraW5kIjoidGVzdGtpbmQyIiwiaWQiOiJ0ZXN0aWQyIiwib3BlcmF0aW9udHlwZSI6InVwZGF0ZSJ9XQ\",\n" +
" \"messageId\": \"136969346945\"\n" +
" },\n" +
" \"dataVersion\": \"1.0\",\n" +
" \"metadataVersion\": \"1\",\n" +
" \"eventTime\": \"2020-08-14T18:04:12+00:00\",\n" +
" \"topic\": \"/subscriptions/c99e2bf3-1777-412b-baba-d823676589c2/resourceGroups/komakkar-OSDU-RG/providers/Microsoft.EventGrid/topics/recordChanged\"\n" +
" }]";
}
@Override
public Map<String,String> getOsduTenantHeaders() {
Map<String, String> headers = new HashMap<>();
headers.put("Aeg-Subscription-Name", arg());
headers.put("data-partition-id", Config.Instance().OsduTenant);
return headers;
}
@Override
public Map<String,String> getCustomerTenantHeaders(){
Map<String, String> headers = new HashMap<>();
headers.put("Aeg-Subscription-Name", arg());
headers.put("data-partition-id", Config.Instance().ClientTenant);
return headers;
}
}
......@@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.opengroup.osdu.notification</groupId>
<artifactId>notification-test-core</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.1-SNAPSHOT</version>
<name>notification-test-core</name>
<description>Integration tests core for notification</description>
<packaging>jar</packaging>
......
......@@ -51,7 +51,7 @@ public class PubsubEndpointGSADescriptor extends RestDescriptor {
@Override
public Map<String,String> getOsduTenantHeaders(){
Map<String, String> headers = new HashMap<>();
headers.put("data-partition-id", Config.Instance().ClientTenant);
headers.put("data-partition-id", Config.Instance().OsduTenant);
return headers;
}
......
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