BomPlugin implements Plugin<Project> { @Override public void apply(Project project) { project.getPlugins().apply(DependencyManagementPlugin.class); DependencyManagementExtension dependencyManagement = project.getExtensions().getByType(DependencyManagementExtension.class); dependencyManagement.imports(importsHandler -> importsHandler.mavenBom( JoinfacesPlugin.BOM_COORDINATES )); }  @Override void apply(Project project);  }
@Test void apply() { this.project.getPlugins().apply(BomPlugin.class); assertThat(this.project.getPlugins()).anyMatch(DependencyManagementPlugin.class::isInstance); DependencyManagementExtension dependencyManagement = this.project.getExtensions().findByType(DependencyManagementExtension.class); assertThat(dependencyManagement).isNotNull(); }