@Test public void testMockSimple() { MyResult result = MockUtils.generateMockResponse(MyResult.class, mock(RequestContext.class)); checkResult(result); }
public static <T> T generateMockResponse(Class<T> responseClass, RequestContext ctx, Object... params ) { try { Generator generator = new Generator(); T responseObject = generateObject(responseClass, generator); return responseObject; } catch (Exception e) { throw new RuntimeException("Failed to generate response object: "+e.getMessage(), e); } }
MockUtils { public static <T> T generateMockResponse(Class<T> responseClass, RequestContext ctx, Object... params ) { try { Generator generator = new Generator(); T responseObject = generateObject(responseClass, generator); return responseObject; } catch (Exception e) { throw new RuntimeException("Failed to generate response object: "+e.getMessage(), e); } } }
MockUtils { public static <T> T generateMockResponse(Class<T> responseClass, RequestContext ctx, Object... params ) { try { Generator generator = new Generator(); T responseObject = generateObject(responseClass, generator); return responseObject; } catch (Exception e) { throw new RuntimeException("Failed to generate response object: "+e.getMessage(), e); } }  }
MockUtils { public static <T> T generateMockResponse(Class<T> responseClass, RequestContext ctx, Object... params ) { try { Generator generator = new Generator(); T responseObject = generateObject(responseClass, generator); return responseObject; } catch (Exception e) { throw new RuntimeException("Failed to generate response object: "+e.getMessage(), e); } }  static T generateMockResponse(Class<T> responseClass, RequestContext ctx, Object... params ); }
MockUtils { public static <T> T generateMockResponse(Class<T> responseClass, RequestContext ctx, Object... params ) { try { Generator generator = new Generator(); T responseObject = generateObject(responseClass, generator); return responseObject; } catch (Exception e) { throw new RuntimeException("Failed to generate response object: "+e.getMessage(), e); } }  static T generateMockResponse(Class<T> responseClass, RequestContext ctx, Object... params );  }