@Test
public void testLookupDomainByProductId() {

    
    String domainName = "lookupdomainbyproductid";
    
    TopLevelDomain dom1 = createTopLevelDomainObject(domainName,
            "Test Domain1", "testOrg", adminUser);
    dom1.setYpmId(101);
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom1);
    DomainList list = zms.dbService.lookupDomainByProductId(101);
    assertNotNull(list.getNames());
    assertEquals(list.getNames().size(), 1);
    assertEquals(list.getNames().get(0), domainName);
    list = zms.dbService.lookupDomainById(null, 101);
    assertNotNull(list.getNames());
    assertEquals(list.getNames().size(), 1);
    assertEquals(list.getNames().get(0), domainName);
    
    list = zms.dbService.lookupDomainByProductId(102);
    assertNull(list.getNames());
    list = zms.dbService.lookupDomainById(null, 102);
    assertNull(list.getNames());
    // by default we're assiging id 0 to all domains without valid value
    list = zms.dbService.lookupDomainByProductId(0);
    assertNotNull(list.getNames());
    
    list = zms.dbService.lookupDomainById(null, 0);
    assertNotNull(list.getNames());
    
    zms.deleteTopLevelDomain(mockDomRsrcCtx, domainName, auditRef);
}