Package com.github.jknack.mwa.mongo

Examples of com.github.jknack.mwa.mongo.MongoModule


    Environment env = createMock(Environment.class);
    expect(env.getRequiredProperty("db")).andReturn("mongodb://localhost/mydb");

    replay(env);

    MongoURI mongoURI = new MongoModule().mongoURI(env);
    assertNotNull(mongoURI);
    assertNotNull(mongoURI.getHosts());
    assertTrue(mongoURI.getHosts().contains("localhost"));
    assertEquals("mydb", mongoURI.getDatabase());
View Full Code Here


    MongoURI uri = createMock(MongoURI.class);
    expect(uri.connect()).andReturn(mongo);

    replay(uri, mongo);

    Mongo result = new MongoModule().mongo(uri);
    assertEquals(mongo, result);

    verify(uri, mongo);
  }
View Full Code Here

            .createMockAndExpectNew(SimpleMongoDbFactory.class, mongo, database);

    PowerMock.replay(SimpleMongoDbFactory.class);
    replay(uri, mongo, mongoDbFactory);

    MongoDbFactory result = new MongoModule().mongoDbFactory(uri, mongo);
    assertEquals(mongoDbFactory, result);

    verify(uri, mongo, mongoDbFactory);
    PowerMock.verify(SimpleMongoDbFactory.class);
  }
View Full Code Here

                database, credentials);

    PowerMock.replay(SimpleMongoDbFactory.class);
    replay(uri, mongo, mongoDbFactory);

    MongoDbFactory result = new MongoModule().mongoDbFactory(uri, mongo);
    assertEquals(mongoDbFactory, result);

    verify(uri, mongo, mongoDbFactory);
    PowerMock.verify(SimpleMongoDbFactory.class);
  }
View Full Code Here

    PowerMock.verify(SimpleMongoDbFactory.class);
  }

  @Test
  public void exceptionTranslator() {
    assertNotNull(new MongoModule().mongoExceptionTranslator());
  }
View Full Code Here

TOP

Related Classes of com.github.jknack.mwa.mongo.MongoModule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.