@Override
  public void define(WebService.NewController controller) {
    WebService.NewAction action = controller
      .createAction("sonarlint_events")
      .setInternal(true)
      .setDescription("Endpoint for listening to server side events. Currently it notifies listener about change to activation of a rule")
      .setSince("9.4")
      .setContentType(Response.ContentType.NO_CONTENT)
      .setHandler(this);

    action
      .createParam(PROJECT_PARAM_KEY)
      .setDescription("Comma-separated list of projects keys for which events will be delivered")
      .setRequired(true)
      .setExampleValue("example-project-key,example-project-key2");

    action
      .createParam(LANGUAGE_PARAM_KEY)
      .setDescription("Comma-separated list of languages for which events will be delivered")
      .setRequired(true)
      .setExampleValue("java,cobol");
  }
@Test
  public void defineTest() {
    WebService.Action def = ws.getDef();

    assertThat(def.since()).isEqualTo("9.4");
    assertThat(def.isInternal()).isTrue();
    assertThat(def.params())
      .extracting(WebService.Param::key, WebService.Param::isRequired)
      .containsExactlyInAnyOrder(tuple("languages", true), tuple("projectKeys", true));
  }