Search in sources :

Example 11 with CosmosDatabaseResponse

use of com.azure.cosmos.models.CosmosDatabaseResponse in project DataSpaceConnector by eclipse-dataspaceconnector.

the class CosmosContractDefinitionStoreIntegrationTest method prepareCosmosClient.

@BeforeAll
static void prepareCosmosClient() {
    var client = CosmosTestClient.createClient();
    typeManager = new TypeManager();
    typeManager.registerTypes(ContractDefinition.class, ContractDefinitionDocument.class);
    CosmosDatabaseResponse response = client.createDatabaseIfNotExists(DATABASE_NAME);
    database = client.getDatabase(response.getProperties().getId());
}
Also used : CosmosDatabaseResponse(com.azure.cosmos.models.CosmosDatabaseResponse) TypeManager(org.eclipse.dataspaceconnector.spi.types.TypeManager) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 12 with CosmosDatabaseResponse

use of com.azure.cosmos.models.CosmosDatabaseResponse in project DataSpaceConnector by eclipse-dataspaceconnector.

the class CosmosAssetIndexIntegrationTest method deleteDatabase.

@AfterAll
static void deleteDatabase() {
    if (database != null) {
        CosmosDatabaseResponse delete = database.delete();
        assertThat(delete.getStatusCode()).isGreaterThanOrEqualTo(200).isLessThan(300);
    }
}
Also used : CosmosDatabaseResponse(com.azure.cosmos.models.CosmosDatabaseResponse) AfterAll(org.junit.jupiter.api.AfterAll)

Example 13 with CosmosDatabaseResponse

use of com.azure.cosmos.models.CosmosDatabaseResponse in project DataSpaceConnector by eclipse-dataspaceconnector.

the class CosmosFederatedCacheNodeDirectoryIntegrationTest method deleteDatabase.

@AfterAll
static void deleteDatabase() {
    if (database != null) {
        CosmosDatabaseResponse delete = database.delete();
        assertThat(delete.getStatusCode()).isGreaterThanOrEqualTo(200).isLessThan(300);
    }
}
Also used : CosmosDatabaseResponse(com.azure.cosmos.models.CosmosDatabaseResponse) AfterAll(org.junit.jupiter.api.AfterAll)

Example 14 with CosmosDatabaseResponse

use of com.azure.cosmos.models.CosmosDatabaseResponse in project DataSpaceConnector by eclipse-dataspaceconnector.

the class CosmosPolicyStoreIntegrationTest method prepareCosmosClient.

@BeforeAll
static void prepareCosmosClient() {
    var client = CosmosTestClient.createClient();
    typeManager = new TypeManager();
    CosmosDatabaseResponse response = client.createDatabaseIfNotExists(DATABASE_NAME);
    database = client.getDatabase(response.getProperties().getId());
}
Also used : CosmosDatabaseResponse(com.azure.cosmos.models.CosmosDatabaseResponse) TypeManager(org.eclipse.dataspaceconnector.spi.types.TypeManager) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 15 with CosmosDatabaseResponse

use of com.azure.cosmos.models.CosmosDatabaseResponse in project DataSpaceConnector by eclipse-dataspaceconnector.

the class CosmosAssetIndexIntegrationTest method prepareCosmosClient.

@BeforeAll
static void prepareCosmosClient() {
    var client = CosmosTestClient.createClient();
    CosmosDatabaseResponse response = client.createDatabaseIfNotExists(DATABASE_NAME);
    database = client.getDatabase(response.getProperties().getId());
    var containerIfNotExists = database.createContainerIfNotExists(CONTAINER_NAME, "/partitionKey");
    container = database.getContainer(containerIfNotExists.getProperties().getId());
}
Also used : CosmosDatabaseResponse(com.azure.cosmos.models.CosmosDatabaseResponse) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

CosmosDatabaseResponse (com.azure.cosmos.models.CosmosDatabaseResponse)31 CosmosDatabaseRequestOptions (com.azure.cosmos.models.CosmosDatabaseRequestOptions)8 AfterAll (org.junit.jupiter.api.AfterAll)5 BeforeAll (org.junit.jupiter.api.BeforeAll)4 CosmosClientBuilder (com.azure.cosmos.CosmosClientBuilder)3 CosmosContainerResponse (com.azure.cosmos.models.CosmosContainerResponse)3 ThroughputProperties (com.azure.cosmos.models.ThroughputProperties)3 CosmosDiagnostics (com.azure.cosmos.CosmosDiagnostics)2 CosmosContainerProperties (com.azure.cosmos.models.CosmosContainerProperties)2 ArrayList (java.util.ArrayList)2 TypeManager (org.eclipse.dataspaceconnector.spi.types.TypeManager)2 ConsistencyLevel (com.azure.cosmos.ConsistencyLevel)1 CosmosAsyncClient (com.azure.cosmos.CosmosAsyncClient)1 CosmosClient (com.azure.cosmos.CosmosClient)1 CosmosContainer (com.azure.cosmos.CosmosContainer)1 CosmosDatabase (com.azure.cosmos.CosmosDatabase)1 AccountSettings (com.azure.cosmos.examples.common.AccountSettings)1 Profile (com.azure.cosmos.examples.common.Profile)1 CosmosItemResponse (com.azure.cosmos.models.CosmosItemResponse)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1