@Test
  public void testSimple() throws IOException {
    LinkDto l = LinkDto.newInstance("http://foo", "Foo");

    JsonNode t = BasicDtoTest.tree(l);
    Assert.assertEquals(t.size(), 2);
    Assert.assertEquals(t.get("href").asText(), l.getHref());
    Assert.assertEquals(t.get("targetName").asText(), l.getTargetName());
    Assert.assertTrue(l.getCustomAttributes() == null || l.getCustomAttributes().isEmpty());

    Assert.assertEquals(l, new ObjectMapper().readValue(t.toString(), LinkDto.class));
  }
  @Test
  public void testCustomAttrs() throws IOException {
    LinkDto l = LinkDto.newInstance("http://foo", "Foo", MutableMap.of("bar", "bee"));

    JsonNode t = BasicDtoTest.tree(l);
    Assert.assertEquals(t.size(), 3);
    Assert.assertEquals(t.get("href").asText(), l.getHref());
    Assert.assertEquals(t.get("targetName").asText(), l.getTargetName());
    Assert.assertEquals(t.get("bar").asText(), l.getCustomAttributes().get("bar"));

    Assert.assertEquals(l, new ObjectMapper().readValue(t.toString(), LinkDto.class));
  }
  @Test
  public void testAppServerPct() {
    CampPlatform p = MockWebPlatform.newPlatform();
    DtoFactory f = new DtoFactory(p, "");

    PlatformComponentTemplate t = MockWebPlatform.APPSERVER;
    PlatformComponentTemplateDto dto = f.adapt(t);

    log.info("Web PCT serialized as: " + BasicDtoTest.tree(dto));
    Assert.assertEquals(dto.getName(), t.getName());
    Assert.assertNotNull(dto.getCreatedAsString());
    Assert.assertTrue(dto.getCreatedAsString().startsWith("20"));
  }