Package samples.privatefield

Examples of samples.privatefield.SimplePrivateFieldServiceClass


@SuppressStaticInitializationFor("samples.privatefield.SimplePrivateFieldServiceClass")
public class EasyMockAndPowerMockMixTest {

  @Test
  public void testSimplePrivateFieldServiceClass() throws Exception {
    SimplePrivateFieldServiceClass tested = new SimplePrivateFieldServiceClass();
    Service serviceMock = createMock(Service.class);
    setInternalState(tested, "service", serviceMock, SimplePrivateFieldServiceClass.class);

    final String expected = "Hello world!";
    expect(serviceMock.getServiceMessage()).andReturn(expected);

    replay(serviceMock);
    final String actual = tested.useService();

    verify(serviceMock);

    assertEquals(expected, actual);
  }
View Full Code Here


*/
public class SimplePrivateFieldServiceClassTest {

  @Test
  public void testSimplePrivateFieldServiceClass() throws Exception {
    SimplePrivateFieldServiceClass tested = new SimplePrivateFieldServiceClass();
    Service serviceMock = createMock(Service.class);
    setInternalState(tested, "service", serviceMock, SimplePrivateFieldServiceClass.class);

    final String expected = "Hello world!";
    expect(serviceMock.getServiceMessage()).andReturn(expected);

    replay(serviceMock);
    final String actual = tested.useService();

    verify(serviceMock);

    assertEquals(expected, actual);
  }
View Full Code Here

    assertEquals(expected, actual);
  }

  @Test
  public void testSimplePrivateFieldServiceClassTypeSafe() throws Exception {
    SimplePrivateFieldServiceClass tested = new SimplePrivateFieldServiceClass();
    Service serviceMock = createMock(Service.class);
    setInternalState(tested, serviceMock);

    final String expected = "Hello world!";
    expect(serviceMock.getServiceMessage()).andReturn(expected);

    replay(serviceMock);
    final String actual = tested.useService();

    verify(serviceMock);

    assertEquals(expected, actual);
  }
View Full Code Here

TOP

Related Classes of samples.privatefield.SimplePrivateFieldServiceClass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.