Commit 55fe3b97 authored by Sanjeev-SLB's avatar Sanjeev-SLB
Browse files

hot fix to generate artifact

parent 4aa92cd8
Pipeline #36162 failed with stages
in 30 minutes and 19 seconds
......@@ -74,7 +74,6 @@ public class CloudStorageImpl implements ICloudStorage {
@Override
public void write(RecordProcessing... recordsProcessing) {
validateRecordAcls(recordsProcessing);
List<Callable<Boolean>> tasks = new ArrayList<>();
String dataPartitionId = headers.getPartitionId();
......
......@@ -27,7 +27,7 @@
<groupId>org.opengroup.osdu.storage</groupId>
<artifactId>storage-test-azure</artifactId>
<version>0.9.0-SNAPSHOT</version>
<version>0.9.0-SNAPSHOT-hotfix</version>
<packaging>jar</packaging>
<properties>
......@@ -41,7 +41,7 @@
<dependency>
<groupId>org.opengroup.osdu.storage</groupId>
<artifactId>storage-test-core</artifactId>
<version>0.9.0-SNAPSHOT</version>
<version>0.9.0-SNAPSHOT-hotfix</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
......
package org.opengroup.osdu.storage.records;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.storage.util.AzureTestUtils;
public class TestRecordWithEntV2OnlyAcl extends RecordWithEntV2OnlyAclTest {
@Before
@Override
public void setup() throws Exception {
this.testUtils = new AzureTestUtils();
super.setup();
}
@After
@Override
public void tearDown() throws Exception {
super.tearDown();
this.testUtils = null;
}
}
......@@ -25,7 +25,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.opengroup.osdu.storage</groupId>
<artifactId>storage-test-core</artifactId>
<version>0.9.0-SNAPSHOT</version>
<version>0.9.0-SNAPSHOT-hotfix</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
......
package org.opengroup.osdu.storage.records;
import com.sun.jersey.api.client.ClientResponse;
import org.apache.http.HttpStatus;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opengroup.osdu.storage.util.*;
import static org.junit.Assert.assertEquals;
public abstract class RecordWithEntV2OnlyAclTest extends TestBase {
protected static final long NOW = System.currentTimeMillis();
protected static final String LEGAL_TAG = LegalTagUtils.createRandomName();
protected static final String KIND = TenantUtils.getTenantName() + ":test:inttest:1.1." + NOW;
protected static final String RECORD_ID = TenantUtils.getTenantName() + ":inttest:" + NOW;
@Before
public void setup() throws Exception {
LegalTagUtils.create(LEGAL_TAG, testUtils.getToken());
}
@After
public void tearDown() throws Exception {
LegalTagUtils.delete(LEGAL_TAG, testUtils.getToken());
TestUtils.send("records/" + RECORD_ID, "DELETE", HeaderUtils.getHeaders(TenantUtils.getTenantName(), testUtils.getToken()), "", "");
}
@Test
public void should_allow_recordWithAclThatExistsIOnlyInEntV2() throws Exception{
//create record
ClientResponse response = TestUtils.send("records", "PUT", HeaderUtils.getHeaders(TenantUtils.getTenantName(), testUtils.getToken()),
RecordUtil.createJsonRecordWithEntV2OnlyAcl(RECORD_ID, KIND, LEGAL_TAG, RECORD_ID), "");
assertEquals(HttpStatus.SC_CREATED, response.getStatus());
}
}
......@@ -50,6 +50,17 @@ public class RecordUtil {
return records.toString();
}
public static String createJsonRecordWithEntV2OnlyAcl(String id, String kind, String legalTag, String data) {
JsonObject dataJson = new JsonObject();
dataJson.addProperty("custom", data);
dataJson.addProperty("score-int", 58377304471659395L);
dataJson.addProperty("score-double", 58377304.471659395);
JsonObject record = getRecordWithInputDataAndAcl(id, kind, legalTag, dataJson);
JsonArray records = new JsonArray();
records.add(record);
return records.toString();
}
public static String createJsonRecordWithReference(int recordsCount, String id, String kind, String legalTag, String fromCrs, String conversionType) {
JsonArray records = new JsonArray();
......@@ -240,9 +251,19 @@ public class RecordUtil {
}
private static JsonObject getDefaultRecord(String id, String kind, String legalTag) {
JsonObject acl = new JsonObject();
JsonArray acls = new JsonArray();
acls.add(TestUtils.getAcl());
return getDefaultRecordFromAcl(id, kind, legalTag, acls);
}
private static JsonObject getDefaultRecordWithEntV2OnlyAcl(String id, String kind, String legalTag) {
JsonArray acls = new JsonArray();
acls.add(TestUtils.getEntV2OnlyAcl());
return getDefaultRecordFromAcl(id, kind, legalTag, acls);
}
private static JsonObject getDefaultRecordFromAcl(String id, String kind, String legalTag, JsonArray acls) {
JsonObject acl = new JsonObject();
acl.add("viewers", acls);
acl.add("owners", acls);
......@@ -279,6 +300,12 @@ public class RecordUtil {
return record;
}
private static JsonObject getRecordWithInputDataAndAcl(String id, String kind, String legalTag, JsonObject data) {
JsonObject record = getDefaultRecordWithEntV2OnlyAcl(id, kind, legalTag);
record.add("data", data);
return record;
}
private static JsonObject getNumberPropertyObject(String propertyName, Number intValue) {
JsonObject numberProperty = new JsonObject();
numberProperty.addProperty(propertyName, intValue);
......
......@@ -64,6 +64,10 @@ public abstract class TestUtils {
return String.format("data.test1@%s", getAclSuffix());
}
public static final String getEntV2OnlyAcl() {
return String.format("data.storage-integration-test-acl.ent-v2@%s", getAclSuffix());
}
public static final String getIntegrationTesterAcl() {
return String.format("data.integration.test@%s", getAclSuffix());
}
......
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