@Test public void testCreateProducer() throws Exception { // given SmslibProducer mockProducer = mock(SmslibProducer.class); whenNew(SmslibProducer.class) .withArguments(endpoint, mockSmslibService) .thenReturn(mockProducer); // when Producer p = endpoint.createProducer(); // then assertSame(mockProducer, p); }
@Test public void testCreateConsumer() throws Exception { // given SmslibConsumer mockConsumer = mock(SmslibConsumer.class); Processor mockProcessor = mock(Processor.class); whenNew(SmslibConsumer.class) .withArguments(endpoint, mockSmslibService, mockProcessor) .thenReturn(mockConsumer); // when Consumer c = endpoint.createConsumer(mockProcessor); // then assertSame(mockConsumer, c); }
@Test public void testPropertiesAreLenient() { assertTrue(endpoint.isLenientProperties()); }