Esempio n. 1
0
 @Test
 public void detachScopeNotNull() {
   // given
   prepAttach();
   ui.attach();
   ui.setScope(uiScope);
   ui.setInstanceKey(uiKey);
   // when
   ui.detach();
   // then
   verify(uiScope).releaseScope(ui.getInstanceKey());
   verify(broadcaster).unregister(Broadcaster.ALL_MESSAGES, ui);
 }
Esempio n. 2
0
  /** There is a much better functional test */
  @Test
  public void receiveBroadcastMessage() throws Exception {
    // given
    prepAttach();
    ui.attach();
    ui.setScope(uiScope);
    ui.setInstanceKey(uiKey);

    // when
    ui.receiveBroadcast("group", "message", uiKey, 55);
    // then
    assertThat(logMonitor.debugLogs())
        .contains("UI instance UIKey:33 receiving message id: 55 from: UIKey:33");
  }