use of com.azure.cosmos.models.CosmosDatabaseResponse in project DataSpaceConnector by eclipse-dataspaceconnector.
the class CosmosDbApiImplIntegrationTest method prepare.
@BeforeAll
static void prepare() {
var client = CosmosTestClient.createClient();
CosmosDatabaseResponse response = client.createDatabaseIfNotExists(DATABASE_NAME);
database = client.getDatabase(response.getProperties().getId());
}
use of com.azure.cosmos.models.CosmosDatabaseResponse in project DataSpaceConnector by eclipse-dataspaceconnector.
the class CosmosDbApiImplIntegrationTest method cleanup.
@AfterAll
static void cleanup() {
if (database != null) {
CosmosDatabaseResponse delete = database.delete();
assertThat(delete.getStatusCode()).isGreaterThanOrEqualTo(200).isLessThan(300);
}
}
use of com.azure.cosmos.models.CosmosDatabaseResponse in project DataSpaceConnector by eclipse-dataspaceconnector.
the class CosmosPolicyStoreIntegrationTest method deleteDatabase.
@AfterAll
static void deleteDatabase() {
if (database != null) {
CosmosDatabaseResponse delete = database.delete();
assertThat(delete.getStatusCode()).isGreaterThanOrEqualTo(200).isLessThan(300);
}
}
use of com.azure.cosmos.models.CosmosDatabaseResponse in project azure-cosmos-java-sql-api-samples by Azure-Samples.
the class DatabaseCRUDQuickstart method createDatabaseIfNotExists.
// Database Create
private void createDatabaseIfNotExists() throws Exception {
logger.info("Create database " + databaseName + " if not exists...");
// Create database if not exists
CosmosDatabaseResponse databaseResponse = client.createDatabaseIfNotExists(databaseName);
database = client.getDatabase(databaseResponse.getProperties().getId());
logger.info("Done.");
}
use of com.azure.cosmos.models.CosmosDatabaseResponse in project azure-cosmos-java-sql-api-samples by Azure-Samples.
the class DatabaseCRUDQuickstart method deleteADatabase.
// Database delete
private void deleteADatabase() throws Exception {
logger.info("Last step: delete database " + databaseName + " by ID.");
// Delete database
CosmosDatabaseResponse dbResp = client.getDatabase(databaseName).delete(new CosmosDatabaseRequestOptions());
logger.info("Status code for database delete: {}", dbResp.getStatusCode());
logger.info("Done.");
}
Aggregations