I am trying to write some unit tests for plugins that rely on lazy evaluation. For this they make use of the projectsEvaluated callback. Is there an easy way to test these lifecycle methods?
So far the best i’ve come up with is
project = ProjectBuilder.builder().build(); gradle = (DefaultGradle) project.getGradle(); gradle.getBuildListenerBroadcaster().projectsEvaluated(gradle);
But that feels hacky because it requires me to do a cast down to DefaultGradle. Is there some sort of test helper i can use for this ?