it("should group cluster profiles by plugin id", () => {
    const clusterProfilesJSON = clusterProfilesTestData();
    clusterProfilesJSON._embedded.cluster_profiles.push(clusterProfileTestData("cluster_3", "plugin_1"));
    const clusterProfiles = ClusterProfiles.fromJSON(clusterProfilesJSON);

    const groupedClusterProfiles = clusterProfiles.groupByPlugin();

    expect(groupedClusterProfiles.plugin_1).toHaveLength(2);
    expect(groupedClusterProfiles.plugin_1[0].id()).toEqual("cluster_1");
    expect(groupedClusterProfiles.plugin_1[1].id()).toEqual("cluster_3");

    expect(groupedClusterProfiles.plugin_2).toHaveLength(1);
    expect(groupedClusterProfiles.plugin_2[0].id()).toEqual("cluster_2");
  });
    it("should deserialize cluster profiles", () => {
      const clusterProfilesJSON = clusterProfilesTestData();
      const clusterProfiles     = ClusterProfiles.fromJSON(clusterProfilesJSON);

      expect(clusterProfiles.length).toBe(2);
      expect(clusterProfiles[0].id()).toEqual("cluster_1");
      expect(clusterProfiles[0].pluginId()).toEqual("plugin_1");
      expect(clusterProfiles[0].properties().valueFor("key_1")).toEqual("value_1");
      expect(clusterProfiles[0].properties().valueFor("key_2")).toEqual("value_2");

      expect(clusterProfiles[1].id()).toEqual("cluster_2");
      expect(clusterProfiles[1].pluginId()).toEqual("plugin_2");
      expect(clusterProfiles[1].properties().valueFor("key_1")).toEqual("value_1");
      expect(clusterProfiles[1].properties().valueFor("key_2")).toEqual("value_2");
    });