コード例 #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());
 }