×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Massimo Zappino
Added: May 2, 2014 3:17 PM
Modified: Aug 11, 2017 2:35 PM
Views: 171
  1. Client mockedClient = createMock(Client.class);
  2.  
  3. expect(mockedClient.getAccount()).andReturn(resourceGenerate.anUser());
  4. expect(mockedClient.getLanguages()).andReturn(resourceGenerate.aLanguageCollection());
  5. replay(mockedClient);
  6.  
  7. Field field = framework.getClass().getDeclaredField("client");
  8. field.setAccessible(true);
  9. field.set(framework, mockedClient);