TemplatesViewImpl extends Composite implements TemplatesView { @Override public void showDefaultEnvironmentInfo(@NotNull Environment defaultEnvironment) { defaultRunnerInfo.update(defaultEnvironment); int x = defaultRunner.getAbsoluteLeft() + LEFT_SHIFT; int y = defaultRunner.getAbsoluteTop() - TOP_SHIFT; popupPanel.setPopupPosition(x, y); popupPanel.show(); } @Inject  TemplatesViewImpl(RunnerResources resources,
                             RunnerLocalizationConstant locale,
                             WidgetFactory widgetFactory,
                             DefaultRunnerInfo defaultRunnerInfo,
                             PopupPanel popupPanel); @Override void addEnvironment(@NotNull Map<Scope, List<Environment>> environments); @Override void selectEnvironment(@Nullable Environment selectedEnvironment); @Override void setFilterWidget(@NotNull FilterWidget filterWidget); @Override void setDefaultProjectWidget(@Nullable EnvironmentWidget widget); @Override void scrollTop(int index); @Override void showDefaultEnvironmentInfo(@NotNull Environment defaultEnvironment); @Override void clearEnvironmentsPanel(); @Override void setDelegate(@NotNull ActionDelegate delegate);  }
@Test public void defaultEnvironmentInfoShouldBeSet() throws Exception { when(view.defaultRunner.getAbsoluteLeft()).thenReturn(0); when(view.defaultRunner.getAbsoluteTop()).thenReturn(0); view.showDefaultEnvironmentInfo(systemEnvironment1); verify(popupPanel).setPopupPosition(175, -90); verify(popupPanel).show(); }