regionWidgetApi = new RegionWidgetApi(regionWidgetService);
}
@Test
public void replaceAllRegionWidgetPreferences_validParams() {
RegionWidgetPreferenceListWrapper LIST_WRAPPER = new RegionWidgetPreferenceListWrapper(Arrays.asList( (RegionWidgetPreference)
new RegionWidgetPreferenceImpl(), new RegionWidgetPreferenceImpl()
));
expect(regionWidgetService.saveRegionWidgetPreferences(VALID_REGION_WIDGET_ID, LIST_WRAPPER.getPreferences())).
andReturn(LIST_WRAPPER.getPreferences());
replay(regionWidgetService);
RegionWidgetPreferenceListWrapper result = regionWidgetApi.replaceAllRegionWidgetPreferences(VALID_REGION_WIDGET_ID,
LIST_WRAPPER);
verify(regionWidgetService);
assertThat(result.getPreferences(), sameInstance(LIST_WRAPPER.getPreferences()));
}