Esempio n. 1
0
  public static Request mockWith(EntityWriter mockWriter) {
    Request mockRequest = mock(Request.class);
    MethodConfig mockMethodConfig = mock(MethodConfig.class);

    when(mockRequest.getMethodConfig()).thenReturn(mockMethodConfig);
    when(mockMethodConfig.getEntityWriter()).thenReturn(mockWriter);

    return mockRequest;
  }
Esempio n. 2
0
  public static Request mockWith(Method method) {
    Request mockRequest = mock(Request.class);
    MethodConfig mockMethodConfig = mock(MethodConfig.class);

    when(mockRequest.getMethodConfig()).thenReturn(mockMethodConfig);
    when(mockMethodConfig.getMethod()).thenReturn(method);

    return mockRequest;
  }