@Test
public void testRetrieveSignedDomainMeta() {

    ZMSImpl zmsImpl = zmsInit();
    Domain domainMeta = new Domain().setName("dom1").setYpmId(123).setModified(Timestamp.fromCurrentTime())
            .setAccount("1234").setAuditEnabled(true).setOrg("org");
    SignedDomain domain = zmsImpl.retrieveSignedDomainMeta(domainMeta, null);
    assertNull(domain.getDomain().getAccount());
    assertNull(domain.getDomain().getYpmId());
    domain = zmsImpl.retrieveSignedDomainMeta(domainMeta, "unknown");
    assertNull(domain.getDomain().getAccount());
    assertNull(domain.getDomain().getYpmId());
    assertNull(domain.getDomain().getOrg());
    assertNull(domain.getDomain().getAuditEnabled());
    domain = zmsImpl.retrieveSignedDomainMeta(domainMeta, "account");
    assertEquals(domain.getDomain().getAccount(), "1234");
    assertNull(domain.getDomain().getYpmId());
    assertNull(domain.getDomain().getOrg());
    assertNull(domain.getDomain().getAuditEnabled());
    domain = zmsImpl.retrieveSignedDomainMeta(domainMeta, "ypmid");
    assertNull(domain.getDomain().getAccount());
    assertEquals(domain.getDomain().getYpmId().intValue(), 123);
    assertNull(domain.getDomain().getOrg());
    assertNull(domain.getDomain().getAuditEnabled());
    domain = zmsImpl.retrieveSignedDomainMeta(domainMeta, "all");
    assertEquals(domain.getDomain().getAccount(), "1234");
    assertEquals(domain.getDomain().getYpmId().intValue(), 123);
    assertEquals(domain.getDomain().getOrg(), "org");
    assertTrue(domain.getDomain().getAuditEnabled());
    domainMeta.setAccount(null);
    domain = zmsImpl.retrieveSignedDomainMeta(domainMeta, "account");
    assertNull(domain);
    domainMeta.setAccount("1234");
    domainMeta.setYpmId(null);
    domain = zmsImpl.retrieveSignedDomainMeta(domainMeta, "ypmid");
    assertNull(domain);
    zmsImpl.objectStore.clearConnections();
}