BusinessObjectFactory { public SeedHistory newSeedHistory(TargetInstance owner, Seed seed) { SeedHistory seedHistory = new SeedHistory(owner, seed); seedHistory.setIdentity(getNewIdentity()); return seedHistory; }  Schedule newSchedule(AbstractTarget owner); AuthorisingAgent newAuthorisingAgent(); Seed newSeed(Target owner); SeedHistory newSeedHistory(TargetInstance owner, Seed seed); UrlPattern newUrlPattern(Site owner); Permission newPermission(Site owner); Target newTarget(); Target newTarget(User theUser); TargetGroup newTargetGroup(); void setProfileManager(ProfileManager profileManager);  }
@Test public final void testNewSeedHistory() { TargetInstanceDAO tidao = new MockTargetInstanceDAO(testFile); TargetInstance ti = tidao.load(5001L); Set<Seed> seeds = ti.getTarget().getSeeds(); assertTrue(seeds.size() > 0); Iterator<Seed> it = seeds.iterator(); while(it.hasNext()) { Seed seed = it.next(); SeedHistory sh = testInstance.newSeedHistory(ti, seed); assertNotNull(sh); assertNull(sh.getOid()); assertNotNull(sh.getIdentity()); assertEquals(sh.getSeed(), seed.getSeed()); assertEquals(sh.isPrimary(), seed.isPrimary()); assertEquals(sh.getTargetInstanceOid(), ti.getOid()); } }