Search in sources :

Example 1 with PropertyStoreMongoDB

use of org.ff4j.store.PropertyStoreMongoDB in project ff4j by ff4j.

the class FeatureStoreMongoDBCore1Test method testCreateSchema.

/**
 * Integration Test
 * @throws UnknownHostException
 */
@Test
@Ignore
public void testCreateSchema() throws UnknownHostException {
    // Given
    MongoClient client = new MongoClient(new ServerAddress("localhost", 27017));
    // Given
    Assert.assertFalse(client.getDatabaseNames().contains(FeatureStoreMongoConstants.DEFAULT_DBNAME));
    // When
    new FeatureStoreMongoDB(client).createSchema();
    new PropertyStoreMongoDB(client).createSchema();
    // Then
    Assert.assertTrue(client.getDatabaseNames().contains(FeatureStoreMongoConstants.DEFAULT_DBNAME));
    Assert.assertTrue(client.getDB(FeatureStoreMongoConstants.DEFAULT_DBNAME).collectionExists(FeatureStoreMongoConstants.DEFAULT_COLLECTIONAME_FEATURES));
    Assert.assertTrue(client.getDB(FeatureStoreMongoConstants.DEFAULT_DBNAME).collectionExists(FeatureStoreMongoConstants.DEFAULT_COLLECTIONAME_PROPERTIES));
}
Also used : MongoClient(com.mongodb.MongoClient) FeatureStoreMongoDB(org.ff4j.store.FeatureStoreMongoDB) ServerAddress(com.mongodb.ServerAddress) PropertyStoreMongoDB(org.ff4j.store.PropertyStoreMongoDB) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

MongoClient (com.mongodb.MongoClient)1 ServerAddress (com.mongodb.ServerAddress)1 FeatureStoreMongoDB (org.ff4j.store.FeatureStoreMongoDB)1 PropertyStoreMongoDB (org.ff4j.store.PropertyStoreMongoDB)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1