Skip to content

Instantly share code, notes, and snippets.

@codingtim
Last active August 27, 2016 09:50
Show Gist options
  • Save codingtim/c89dd5a9a77976b987ad55c0212c9c20 to your computer and use it in GitHub Desktop.
Save codingtim/c89dd5a9a77976b987ad55c0212c9c20 to your computer and use it in GitHub Desktop.
Usage of InMemoryMongo
public class SomeMongoTest
private static InMemoryMongo inMemoryMongo;
private static Client client;
@BeforeClass
public static void setUpClass() throws Exception {
inMemoryMongo = new InMemoryMongo().start();
client = inMemoryMongo.getClient();
}
@AfterClass
public static void tearDownClass() throws Exception {
inMemoryMongo.stop();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment