@Test(expectedExceptions = IllegalArgumentException.class) public void nullParameterIdentCollection() { try { instrumentationService.updateInstrumentation(null); } finally { verifyZeroInteractions(messageGate); } }
@Test(expectedExceptions = IllegalArgumentException.class) @SuppressWarnings("unchecked") public void emptyParameterIdentCollection() { try { instrumentationService.updateInstrumentation(Collections.EMPTY_LIST); } finally { verifyZeroInteractions(messageGate); } } }
@Test public void successful() { instrumentationService.updateInstrumentation(Arrays.asList(10L, 20L)); ArgumentCaptor<Long> platformIdentCaptor = ArgumentCaptor.forClass(Long.class); verify(messageGate, times(2)).flush(platformIdentCaptor.capture()); verifyNoMoreInteractions(messageGate); assertThat(platformIdentCaptor.getAllValues(), contains(10L, 20L)); }