mercredi 4 mars 2015

Vaadin attach class to Page?

How can I mock 'Page' and set the class's page to my mock? (Is that even possible?)



public class Example extends CssLayout(){

public void notification(){
Notification notif = new Notification("Title", "Message", Notification.Type.HUMANIZED_MESSAGE);
notif.setStyleName("Warning");
notif.setPosition(Position.TOP_CENTER);
notif.setDelayMsec(10000);
notif.show(Page.getCurrent());

}
}


What I want to do :



Example example = new Example();
Page p = mock(Page.class);
example.setPage(p)


Thanks for any help!


Aucun commentaire:

Enregistrer un commentaire