@Override
  public void define(Context context) {
    NewController controller = context.createController(CONTROLLER_COMPONENTS)
      .setSince("4.2")
      .setDescription("Get information about a component (file, directory, project, ...) and its ancestors or descendants. " +
        "Update a project or module key.");

    Arrays.stream(actions)
      .forEach(action -> action.define(controller));

    controller.done();
  }
@Test
  public void define_controller() {
    WebService.Context context = new WebService.Context();
    new ComponentsWs(action).define(context);
    WebService.Controller controller = context.controller(CONTROLLER_COMPONENTS);

    assertThat(controller).isNotNull();
    assertThat(controller.description()).isNotEmpty();
    assertThat(controller.since()).isEqualTo("4.2");
    assertThat(controller.actions()).extracting(WebService.Action::key).containsExactly(actionKey);
  }