public void testLoadLayerInfo() {
    LayerInfoImpl layer = mockLayer("testLayer");

    assertNull(LegacyTileLayerInfoLoader.load(layer));

    LegacyTileLayerInfoLoader.save(defaultVectorInfo, layer.getMetadata());

    GeoServerTileLayerInfo info2 = LegacyTileLayerInfoLoader.load(layer);

    defaultVectorInfo.setId(layer.getId());
    defaultVectorInfo.setName(tileLayerName(layer));
    assertEquals(defaultVectorInfo, info2);
  }
  public void testLoadLayerInfoExtraStyles() {
    GeoServerTileLayerInfo info = defaultVectorInfo;
    info.setAutoCacheStyles(false);
    TileLayerInfoUtil.setCachedStyles(info, "default", ImmutableSet.of("style1"));

    LayerInfoImpl layer = mockLayer("testLayer", "style1", "style2");

    assertNull(LegacyTileLayerInfoLoader.load(layer));

    LegacyTileLayerInfoLoader.save(info, layer.getMetadata());

    GeoServerTileLayerInfo actual;
    actual = LegacyTileLayerInfoLoader.load(layer);

    info.setId(layer.getId());
    info.setName(tileLayerName(layer));
    assertEquals(info, actual);

    layer.setDefaultStyle(null);
    TileLayerInfoUtil.setCachedStyles(info, null, ImmutableSet.of("style1"));
    LegacyTileLayerInfoLoader.save(info, layer.getMetadata());
    actual = LegacyTileLayerInfoLoader.load(layer);
    assertEquals(ImmutableSet.of("style1"), actual.cachedStyles());
  }
  public void testLoadLayerGroup() {
    LayerGroupInfoImpl lg = mockGroup("tesGroup", mockLayer("L1"), mockLayer("L2"));

    assertNull(LegacyTileLayerInfoLoader.load(lg));
    GeoServerTileLayerInfo info = defaultVectorInfo;
    info.getMimeFormats().clear();
    info.getMimeFormats().addAll(defaults.getDefaultOtherCacheFormats());

    LegacyTileLayerInfoLoader.save(info, lg.getMetadata());

    GeoServerTileLayerInfo actual;
    actual = LegacyTileLayerInfoLoader.load(lg);

    info.setId(lg.getId());
    info.setName(GWC.tileLayerName(lg));
    assertEquals(info, actual);
  }