use of com.mongodb.EmbedMongoDB in project embedmongo-maven-plugin by joelittlejohn.
the class MongoScriptsMojoTest method should_fail_to_execute_instruction_with_error.
@Test
public void should_fail_to_execute_instruction_with_error() throws IOException, MojoFailureException, MojoExecutionException {
DB database = mock(DB.class);
initFolderWithError();
CommandResult result = new EmbedMongoDB("myDB").notOkErrorResult("Error while executing instructions from file '" + rootFolderWithError.listFiles()[0].getName());
given(database.doEval(anyString(), Matchers.<Object>anyVararg())).willReturn(result);
thrown.expect(MojoExecutionException.class);
thrown.expectMessage("Error while executing instructions from file '" + rootFolderWithError.listFiles()[0].getName());
new MongoScriptsMojoForTest(rootFolderWithError, PORT, "myDB", database, null).execute();
}
Aggregations