assertThat(saved.getEntityId(), is(equalTo(region.getEntityId())));
}
@Test
public void save_cascadePersist() {
Region region = new Region();
region.setRegionWidgets(new ArrayList<RegionWidget>());
RegionWidget regionWidget = new RegionWidget();
region.getRegionWidgets().add(regionWidget);
Region saved = repository.save(region);
manager.flush();
assertThat(saved.getRegionWidgets().size(), is(equalTo(1)));
RegionWidget actual = saved.getRegionWidgets().get(0);
assertThat(actual, is(sameInstance(regionWidget)));
assertThat(actual.getEntityId(), is(notNullValue()));
}