Search in sources :

Example 1 with SelectionEvent

use of com.vaadin.event.selection.SelectionEvent in project cia by Hack23.

the class ComplianceCheckPageItemRendererClickListenerTest method selectionChangeEventSourceEmptyTest.

/**
 * Selection change event source empty test.
 */
@Test
public void selectionChangeEventSourceEmptyTest() {
    final ComplianceCheckPageItemRendererClickListener listener = new ComplianceCheckPageItemRendererClickListener();
    final SelectionEvent event = Mockito.mock(SelectionEvent.class);
    Mockito.when(event.getAllSelectedItems()).thenReturn(new HashSet<>());
    listener.selectionChange(event);
    Mockito.verify(event, times(1)).getAllSelectedItems();
}
Also used : SelectionEvent(com.vaadin.event.selection.SelectionEvent) Test(org.junit.Test) AbstractUnitTest(com.hack23.cia.testfoundation.AbstractUnitTest)

Example 2 with SelectionEvent

use of com.vaadin.event.selection.SelectionEvent in project cia by Hack23.

the class RuleViolationPageItemRendererClickListenerTest method selectionChangeEventSourceEmptyTest.

/**
 * Selection change event source empty test.
 */
@Test
public void selectionChangeEventSourceEmptyTest() {
    final RuleViolationPageItemRendererClickListener listener = new RuleViolationPageItemRendererClickListener();
    final SelectionEvent event = Mockito.mock(SelectionEvent.class);
    Mockito.when(event.getAllSelectedItems()).thenReturn(new HashSet<>());
    listener.selectionChange(event);
    Mockito.verify(event, times(1)).getAllSelectedItems();
}
Also used : SelectionEvent(com.vaadin.event.selection.SelectionEvent) AbstractUnitTest(com.hack23.cia.testfoundation.AbstractUnitTest) Test(org.junit.Test)

Aggregations

AbstractUnitTest (com.hack23.cia.testfoundation.AbstractUnitTest)2 SelectionEvent (com.vaadin.event.selection.SelectionEvent)2 Test (org.junit.Test)2