예제 #1
0
  @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);
  }
예제 #2
0
  @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);
  }
예제 #3
0
 @Test
 public void testPropertiesAreLenient() {
   assertTrue(endpoint.isLenientProperties());
 }