@GET
  @Path("package")
  public Response getAllPackageInfo() {
    try {
      return new JsonResponse<>(Response.Status.OK, "", helium.getAllPackageInfo()).build();
    } catch (RuntimeException e) {
      logger.error(e.getMessage(), e);
      return new JsonResponse<>(Response.Status.INTERNAL_SERVER_ERROR, e.getMessage()).build();
    }
  }
@Test
  void testVisualizationPackageOrder() throws IOException {
    CloseableHttpResponse get1 = httpGet("/helium/order/visualization");
    assertThat(get1, isAllowed());
    Map<String, Object> resp1 = gson.fromJson(EntityUtils.toString(get1.getEntity(), StandardCharsets.UTF_8),
            new TypeToken<Map<String, Object>>() { }.getType());
    List<Object> body1 = (List<Object>) resp1.get("body");
    assertEquals(0, body1.size());
    get1.close();

    //We assume allPackages list has been refreshed before sorting
    helium.getAllPackageInfo();

    String postRequestJson = "[name2, name1]";
    CloseableHttpResponse post = httpPost("/helium/order/visualization", postRequestJson);
    assertThat(post, isAllowed());
    post.close();

    CloseableHttpResponse get2 = httpGet("/helium/order/visualization");
    assertThat(get2, isAllowed());
    Map<String, Object> resp2 = gson.fromJson(EntityUtils.toString(get2.getEntity(), StandardCharsets.UTF_8),
            new TypeToken<Map<String, Object>>() { }.getType());
    List<Object> body2 = (List<Object>) resp2.get("body");
    assertEquals(2, body2.size());
    assertEquals("name2", body2.get(0));
    assertEquals("name1", body2.get(1));
    get2.close();
  }