use of org.kie.workbench.common.screens.home.model.HomeModelProvider in project kie-wb-common by kiegroup.
the class HomePresenterTest method setup.
@Before
public void setup() {
doReturn(mock(ShortcutPresenter.class)).when(shortcutPresenters).get();
executeParametrizedCommandWith(0, new ProfilePreferences(Profile.FULL)).when(profilePreferences).load(any(ParameterizedCommand.class), any(ParameterizedCommand.class));
modelProvider = new HomeModelProvider() {
@Override
public void initialize(Runnable done) {
done.run();
}
@Override
public HomeModel get(ProfilePreferences profilePreferences) {
final HomeModel homeModel = new HomeModel("welcome", "description", "backgroundImageUrl");
homeModel.addShortcut(ModelUtils.makeShortcut("iconCss1", "heading1", "subHeading1", mock(Command.class)));
homeModel.addShortcut(ModelUtils.makeShortcut("iconCss2", "heading2", "subHeading2", mock(Command.class), "resourceId2", ResourceType.UNKNOWN, ResourceAction.READ));
homeModel.addShortcut(ModelUtils.makeShortcut("iconCss3", "heading3", "subHeading3", mock(Command.class), "perspectiveId"));
return homeModel;
}
};
presenter = new HomePresenter(view, translationService, modelProvider, shortcutPresenters, profilePreferences);
}
Aggregations