Skip to content
Snippets Groups Projects
Commit 75fe7f0b authored by Anastasiia Gelmut's avatar Anastasiia Gelmut
Browse files

GONRG-3532 Integration Test Implement Clean-up for Datastore

parent 9cb6c9df
No related branches found
No related tags found
1 merge request!100Integration Test Implement Clean-up for Datastore (GONRG-3532)
Pipeline #70536 failed
...@@ -36,14 +36,17 @@ public class TestCreatePartition extends CreatePartitionTest { ...@@ -36,14 +36,17 @@ public class TestCreatePartition extends CreatePartitionTest {
@Override @Override
@After @After
public void tearDown() throws Exception { public void tearDown() throws Exception {
deleteResource();
this.testUtils = null; this.testUtils = null;
} }
@Override @Override
@Test @Test
public void should_return40XResponseCode_when_makingRequest_withInvalidPayload() throws Exception { public void should_return40XResponseCode_when_makingRequest_withInvalidPayload()
throws Exception {
String invalidPayload = "{\"properties_invalid\":{}}"; String invalidPayload = "{\"properties_invalid\":{}}";
ClientResponse response = descriptor.runWithCustomPayload(getId(), invalidPayload, testUtils.getAccessToken()); ClientResponse response = descriptor.runWithCustomPayload(getId(), invalidPayload,
testUtils.getAccessToken());
assertEquals(400, response.getStatus()); assertEquals(400, response.getStatus());
} }
} }
...@@ -32,6 +32,7 @@ public class TestDeletePartition extends DeletePartitionTest { ...@@ -32,6 +32,7 @@ public class TestDeletePartition extends DeletePartitionTest {
@Override @Override
@After @After
public void tearDown() throws Exception { public void tearDown() throws Exception {
deleteResource();
this.testUtils = null; this.testUtils = null;
} }
} }
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
package org.opengroup.osdu.partition.api; package org.opengroup.osdu.partition.api;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.opengroup.osdu.partition.api.descriptor.DeletePartitionDescriptor;
import org.opengroup.osdu.partition.util.GCPTestUtils; import org.opengroup.osdu.partition.util.GCPTestUtils;
public class TestGetPartitionById extends GetPartitionByIdApitTest { public class TestGetPartitionById extends GetPartitionByIdApitTest {
...@@ -32,6 +34,14 @@ public class TestGetPartitionById extends GetPartitionByIdApitTest { ...@@ -32,6 +34,14 @@ public class TestGetPartitionById extends GetPartitionByIdApitTest {
@Override @Override
@After @After
public void tearDown() throws Exception { public void tearDown() throws Exception {
deleteResource();
this.testUtils = null; this.testUtils = null;
} }
@Override
protected void deleteResource() throws Exception {
DeletePartitionDescriptor deletePartitionDes = new DeletePartitionDescriptor();
deletePartitionDes.setPartitionId(getId());
ClientResponse response = deletePartitionDes.run(getId(), this.testUtils.getAccessToken());
}
} }
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
package org.opengroup.osdu.partition.api; package org.opengroup.osdu.partition.api;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.opengroup.osdu.partition.api.descriptor.DeletePartitionDescriptor;
import org.opengroup.osdu.partition.util.GCPTestUtils; import org.opengroup.osdu.partition.util.GCPTestUtils;
public class TestListPartitions extends ListPartitionsApitTest { public class TestListPartitions extends ListPartitionsApitTest {
...@@ -32,6 +34,14 @@ public class TestListPartitions extends ListPartitionsApitTest { ...@@ -32,6 +34,14 @@ public class TestListPartitions extends ListPartitionsApitTest {
@Override @Override
@After @After
public void tearDown() throws Exception { public void tearDown() throws Exception {
deleteResource();
this.testUtils = null; this.testUtils = null;
} }
@Override
protected void deleteResource() throws Exception {
DeletePartitionDescriptor deletePartitionDes = new DeletePartitionDescriptor();
deletePartitionDes.setPartitionId(getId());
ClientResponse response = deletePartitionDes.run(getId(), this.testUtils.getAccessToken());
}
} }
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
package org.opengroup.osdu.partition.api; package org.opengroup.osdu.partition.api;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.opengroup.osdu.partition.api.descriptor.DeletePartitionDescriptor;
import org.opengroup.osdu.partition.util.GCPTestUtils; import org.opengroup.osdu.partition.util.GCPTestUtils;
public class TestUpdatePartition extends UpdatePartitionTest { public class TestUpdatePartition extends UpdatePartitionTest {
...@@ -31,7 +33,15 @@ public class TestUpdatePartition extends UpdatePartitionTest { ...@@ -31,7 +33,15 @@ public class TestUpdatePartition extends UpdatePartitionTest {
@Override @Override
@After @After
public void tearDown() { public void tearDown() throws Exception {
deleteResource();
this.testUtils = null; this.testUtils = null;
} }
@Override
protected void deleteResource() throws Exception {
DeletePartitionDescriptor deletePartitionDes = new DeletePartitionDescriptor();
deletePartitionDes.setPartitionId(getId());
ClientResponse response = deletePartitionDes.run(getId(), this.testUtils.getAccessToken());
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment