public static Version loadApiVersion(System2 system) {
    return getVersion(system, SONAR_API_VERSION_FILE_PATH);
  }
@Test
  void throw_ISE_if_fail_to_load_version() throws Exception {
    when(system.getResource(anyString())).thenReturn(new File("target/unknown").toURI().toURL());

    assertThatThrownBy(() -> MetadataLoader.loadApiVersion(system))
      .isInstanceOf(IllegalStateException.class)
      .hasMessageContaining("Can not load /sonar-api-version.txt from classpath");
  }