assertTrue(profile.getAccounts().contains(account));
}
@Test
public void testsaveNewAccountProfile() {
Accountprofile profile = accountprofileDataOnDemand.getNewTransientAccountprofile(100);
Account account = accountDataOnDemand.getNewTransientAccount(100);
profile.setAccounts(Collections.singleton(account));
tradingService.saveAccountProfile(profile);
entityManager.flush();
entityManager.clear(); // force reload
Accountprofile newProfile = tradingService.findAccountProfile(profile.getProfileid());
account = newProfile.getAccounts().iterator().next();
assertEquals(account.getProfileProfileid().toString(), newProfile.toString());
}