@Test
public void executeException() throws Exception {

    // Given
    when(mockedMavenProject.getBasedir()).thenReturn(new File("baseDir"));
    when(mockedSpeedment.getOrThrow(ConfigFileHelper.class)).thenReturn(mockedConfigFileHelper);
    doThrow(new RuntimeException("test Exception")).when(mockedConfigFileHelper).loadFromDatabaseAndSaveToFile();
    mojo.setConfigFile(mockedConfigLocation);
    // When
    assertThrows(MojoExecutionException.class, () -> mojo.execute(mockedSpeedment));
    // Then
}