Skip to content

Commit

Permalink
Fix failed test after PR#3005 (#3007)
Browse files Browse the repository at this point in the history
Signed-off-by: Vitalii Parfonov <vparfonov@codenvy.com>
  • Loading branch information
Vitalii Parfonov authored Nov 7, 2016
1 parent 13b0ad5 commit 44da57e
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@
import org.junit.runner.RunWith;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

import java.util.ArrayList;
import java.util.List;

import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -167,6 +173,16 @@ public void shouldRestoreHiddenPartStackState() throws Exception {
parts.put("INFORMATION", partStack);
partStack.put("HIDDEN", true);

//PartStackPresenter should not be empty otherwise setHidden() will call twice
final List<PartPresenter> partPresenters = new ArrayList<>();
partPresenters.add(mock(PartPresenter.class));
when(partStackPresenter.getParts()).thenAnswer(new Answer<List<? extends PartPresenter>>() {
public List<? extends PartPresenter> answer(InvocationOnMock invocation) throws Throwable {
return partPresenters;
}

});

perspective.loadState(state);
verify(workBenchController).setHidden(true);
}
Expand Down

0 comments on commit 44da57e

Please sign in to comment.