Commit 6d88b3b0 authored by Abhishek Kumar (SLB)'s avatar Abhishek Kumar (SLB)
Browse files

Modifying testcase

parent 741a9322
Pipeline #45429 failed with stages
in 40 minutes and 5 seconds
......@@ -35,6 +35,7 @@ import java.util.Collection;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Optional;
import org.junit.Before;
......@@ -471,11 +472,12 @@ public class AzureSchemaInfoStoreTest {
public void testGetSchemaInfoList_Withoutqueryparam_FailedWhenSearchedIntoSharedPartition()
throws NotFoundException, ApplicationException, BadRequestException {
List<SchemaInfoDoc> schemaInfoDocsList = new LinkedList<>();
schemaInfoDocsList.add(getMockSchemaInfoDoc());
doReturn(new ArrayList<>()).when(cosmosStore).queryItems(eq("common"), any(), any(), any(), any(), any());
assertEquals(0,
schemaInfoStore.getSchemaInfoList(QueryParams.builder().limit(100).offset(0).build(), dataPartitionId).size());
schemaInfoDocsList.add(getMockSchemaInfoDocWithSupersededBy());
doReturn(schemaInfoDocsList).when(cosmosStore).queryItems(eq(dataPartitionId), any(), any(), any(), any(), any());
doThrow(new NoSuchElementException()).when(cosmosStore).findItem(eq("common"), any(), any(), any(), any(), any());
doReturn(Optional.of(getMockSchemaInfoDoc())).when(cosmosStore).findItem(eq(dataPartitionId), any(), any(), any(), any(), any());
schemaInfoStore.getSchemaInfoList(QueryParams.builder().limit(100).offset(0).build(), dataPartitionId);
expectedException.none();
}
@Test
......@@ -542,6 +544,12 @@ public class AzureSchemaInfoStoreTest {
return new SchemaInfoDoc(id, headers.getPartitionId(), getFlattenedSchemaInfo());
}
private SchemaInfoDoc getMockSchemaInfoDocWithSupersededBy() {
String id = headers.getPartitionId() + ":" + schemaId;
return new SchemaInfoDoc(id, headers.getPartitionId(), getFlattenedSchemaInfo_SupersededBy());
}
private FlattenedSchemaInfo getFlattenedSchemaInfo() {
return FlattenedSchemaInfo.builder()
......
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