public Stubber doNothing() { answers.add(new DoesNothing()); return this; }
@Override public Stubber doNothing() { answers.add(doesNothing()); return this; }
public VoidMethodStubbable<T> toReturn() { invocationContainerImpl.addAnswerForVoidMethod(new DoesNothing()); return this; }
return MOCKITO_CORE.doAnswer(new DoesNothing());
return POWERMOCKITO_CORE.doAnswer(new DoesNothing());
doAnswer(new DoesNothing()).when(holder).initialize(); doAnswer(new DoesNothing()).when(holder).start();
public Stubber doNothing() { answers.add(new DoesNothing()); return this; }
public VoidMethodStubbable<T> toReturn() { invocationContainerImpl.addAnswerForVoidMethod(new DoesNothing()); return this; }
return MOCKITO_CORE.doAnswer(new DoesNothing());
@Test public void testXpathFlow() { assertNotNull(this.loggingChannel); MessageHandler handler = TestUtils.getPropertyValue(this.loggingChannel, "handler", MessageHandler.class); assertThat(handler, instanceOf(LoggingHandler.class)); assertEquals(LoggingHandler.Level.ERROR, TestUtils.getPropertyValue(handler, "level", LoggingHandler.Level.class)); Log messageLogger = TestUtils.getPropertyValue(handler, "messageLogger", Log.class); assertEquals("test.category", TestUtils.getPropertyValue(messageLogger, "name")); messageLogger = spy(messageLogger); ArgumentCaptor<String> argumentCaptor = ArgumentCaptor.forClass(String.class); willAnswer(new DoesNothing()).given(messageLogger).error(argumentCaptor.capture()); for (String log : argumentCaptor.getAllValues()) { assertNotNull(UUID.fromString(log)); } new DirectFieldAccessor(handler).setPropertyValue("messageLogger", messageLogger); this.inputChannel.send(new GenericMessage<>("<foo/>")); assertNotNull(this.wrongMessagesChannel.receive(10000)); this.inputChannel.send(new GenericMessage<>("<foo xmlns=\"my:namespace\"/>")); assertNotNull(this.wrongMessagesChannel.receive(10000)); this.inputChannel.send(new GenericMessage<>("<Tags xmlns=\"my:namespace\"/>")); assertNotNull(this.splittingChannel.receive(10000)); this.inputChannel.send(new GenericMessage<>("<Tag xmlns=\"my:namespace\"/>")); assertNotNull(this.receivedChannel.receive(10000)); verify(messageLogger, times(3)).error(anyString()); assertNotNull(this.wrongMessagesWireTapChannel.receive(10000)); assertNotNull(this.wrongMessagesWireTapChannel.receive(10000)); }