CustomPythonRulesPlugin implements Plugin { @Override public void define(Context context) { context.addExtension(CustomPythonRuleRepository.class); }  @Override void define(Context context);  }
@Test public void test() { SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(Version.create(7, 9), SonarQubeSide.SCANNER, SonarEdition.DEVELOPER); Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(sonarRuntime).build(); new CustomPythonRulesPlugin().define(context); assertThat(context.getExtensions()).hasSize(1); }