public CosmosDbDatabaseOperations createDatabaseIfNotExistAndGetDatabaseOperations(
            final String databaseName, final ThroughputProperties throughputProperties) {
        CosmosDbUtils.validateIfParameterIsNotEmpty(databaseName, PARAM_DATABASE_NAME);

        return new CosmosDbDatabaseOperations(getAndCreateDatabaseIfNotExist(databaseName, true, throughputProperties));
    }
@Test
    void testCreateDatabaseIfNotExistAndGetDatabaseOperations() {
        final CosmosAsyncClientWrapper client = mock(CosmosAsyncClientWrapper.class);
        final CosmosAsyncDatabase databaseNew = mock(CosmosAsyncDatabase.class);
        final CosmosAsyncDatabase databaseExisting = mock(CosmosAsyncDatabase.class);

        when(databaseNew.getId()).thenReturn("test-new-database");
        when(databaseExisting.getId()).thenReturn("test-existing-database");

        // when is a new database
        when(client.getDatabase("test-new-database")).thenReturn(databaseNew);
        // when is an existing database
        when(client.getDatabase("test-existing-database")).thenReturn(databaseExisting);

        when(client.createDatabaseIfNotExists(any(), any())).thenReturn(Mono.just(mock(CosmosDatabaseResponse.class)));

        final CosmosDbClientOperations operations = CosmosDbClientOperations.withClient(client);

        CosmosDbTestUtils
                .assertIllegalArgumentException(() -> operations.createDatabaseIfNotExistAndGetDatabaseOperations(null, null));
        CosmosDbTestUtils
                .assertIllegalArgumentException(() -> operations.createDatabaseIfNotExistAndGetDatabaseOperations("", null));
        CosmosDbTestUtils.assertIllegalArgumentException(() -> operations.getDatabaseOperations(null));
        CosmosDbTestUtils.assertIllegalArgumentException(() -> operations.getDatabaseOperations(""));

        assertEquals("test-new-database",
                operations.createDatabaseIfNotExistAndGetDatabaseOperations("test-new-database", null).getDatabaseId().block());
        assertEquals("test-existing-database",
                operations.getDatabaseOperations("test-existing-database").getDatabaseId().block());
    }