@Test
public void mongoDbFactoryWithCredentials() throws Exception {
String user = "user";
char[] pass = {'p', 'a', 's', 's' };
String database = "mydb";
MongoURI uri = createMock(MongoURI.class);
expect(uri.getUsername()).andReturn(user);
expect(uri.getPassword()).andReturn(pass);
expect(uri.getDatabase()).andReturn(database);
Mongo mongo = createMock(Mongo.class);
UserCredentials credentials =
new UserCredentials(user, String.valueOf(pass));