@Test
public void shouldSetCurrentContextWhileCreatingMenu() throws IOException {

    RapidFtrApplication instance = RapidFtrApplication.getApplicationInstance();
    SynchronisationAsyncTask mockSyncAll = mock(SynchronisationAsyncTask.class);
    instance.setSyncTask(mockSyncAll);
    instance.setCurrentUser(createUser());
    RapidFtrActivity mainActivity = new ViewAllChildrenActivity();
    Menu mockMenu = mock(Menu.class);
    when(mockMenu.getItem(anyInt())).thenReturn(mock(MenuItem.class));
    when(mockMenu.findItem(anyInt())).thenReturn(mock(MenuItem.class));
    mainActivity.onCreateOptionsMenu(mockMenu);
    verify(mockSyncAll).setContext(mainActivity);
}