@Test @UsingDataSet({"profile.yml"}) @ShouldMatchDataSet( value = {"profile.yml"}, excludeColumns = {"id"}) public void get_ExistingProfile_Found() throws Exception { Profile profile = profileRepository.get(1000L); Assert.assertNotNull(profile); }
@Test @UsingDataSet({"profile.yml"}) @ShouldMatchDataSet( value = {"profile.yml", "social_connection.yml"}, excludeColumns = {"id"}) public void shouldAddSocialConnectionToProfile() throws Exception { Profile profile = profileRepository.get(1000L); profile.addSocialConnection(createSocialConnection()); profileRepository.save(profile); }
@Test @ShouldMatchDataSet( value = {"profile.yml", "social_connection.yml"}, excludeColumns = {"id"}) public void save_NewProfileWithSocialConnection_ShouldPersist() throws Exception { Profile profile = createProfile(); profile.addSocialConnection(createSocialConnection()); Profile saved = profileRepository.save(profile); Profile persistedProfile = profileRepository.get(saved.getId()); for (SocialConnection socialConnection : persistedProfile.getSocialConnections()) { Assert.assertNotNull(socialConnection.getId()); } }