@Before
public void before() throws MessagingException {
initMocks(this);
config = new RestoreConfig(store, 0, true, false, false, -1, 0);
when(service.getApplicationContext()).thenReturn(RuntimeEnvironment.application);
when(service.getState()).thenReturn(state);
when(service.getPreferences()).thenReturn(new Preferences(RuntimeEnvironment.application));
when(store.getFolder(any(DataType.class), any(DataTypePreferences.class))).thenReturn(folder);
task = new RestoreTask(service, converter, resolver, tokenRefresher);
}