use of org.gradle.api.internal.plugins.DefaultPluginContainer in project jkube by eclipse.
the class TaskEnvironment method before.
@Override
protected void before() throws Throwable {
super.before();
project = mock(Project.class, RETURNS_DEEP_STUBS);
logger = mock(Logger.class);
when(project.getProjectDir()).thenReturn(getRoot());
when(project.getBuildDir()).thenReturn(newFolder("build"));
when(project.getPlugins()).thenReturn(new DefaultPluginContainer(null, null, null));
final ConfigurationContainer cc = mock(ConfigurationContainer.class);
when(project.getConfigurations()).thenReturn(cc);
List<Configuration> projectConfigurations = new ArrayList<Configuration>();
when(cc.stream()).thenAnswer(i -> projectConfigurations.stream());
when(cc.toArray()).thenAnswer(i -> projectConfigurations.toArray());
when(project.getBuildscript().getConfigurations().stream()).thenAnswer(i -> Stream.empty());
when(project.getConvention().getPlugin(JavaPluginConvention.class)).thenReturn(mock(JavaPluginConvention.class));
defaultTaskMockedConstruction = mockConstruction(DefaultTask.class, (mock, ctx) -> {
when(mock.getProject()).thenReturn(project);
when(mock.getLogger()).thenReturn(logger);
});
}
use of org.gradle.api.internal.plugins.DefaultPluginContainer in project jkube by eclipse.
the class GradleUtilTest method setUp.
@Before
public void setUp() throws IOException {
project = mock(Project.class, RETURNS_DEEP_STUBS);
javaPlugin = mock(JavaPluginConvention.class, RETURNS_DEEP_STUBS);
when(javaPlugin.getSourceSets().stream()).thenReturn(Stream.empty());
final ConfigurationContainer cc = mock(ConfigurationContainer.class);
when(project.getConfigurations()).thenReturn(cc);
projectConfigurations = new ArrayList<>();
when(cc.stream()).thenAnswer(i -> projectConfigurations.stream());
when(cc.toArray()).thenAnswer(i -> projectConfigurations.toArray());
when(project.getBuildscript().getConfigurations().stream()).thenAnswer(i -> Stream.empty());
when(project.getProperties()).thenReturn(Collections.emptyMap());
when(project.getBuildDir()).thenReturn(folder.newFolder("build"));
when(project.getPlugins()).thenReturn(new DefaultPluginContainer(null, null, null));
when(project.getConvention().getPlugin(JavaPluginConvention.class)).thenReturn(javaPlugin);
}
Aggregations