Guest User

Untitled

a guest
Jan 19th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. @RunWith(PowerMockRunner.class) @PowerMockIgnore("javax.net.ssl.*") @PrepareForTest(WeatherUtil.class)
  2. public class WeatherTest {
  3. @Test public void testGoodPayload() {
  4. PowerMockito.mockStatic(WeatherUtil.class);
  5. weatherObject = jsonToObject(stringToJson(goodPayload));
  6. when(WeatherUtil.getWeatherBody(LLNL_WEATHER)).thenReturn(weatherObject);
  7. when(WeatherUtil.getWeather(LLNL)).thenCallRealMethod();
  8. when(WeatherUtil.getSiteId(Mockito.anyObject())).thenCallRealMethod();
  9. Weather testWeather = WeatherUtil.getWeather(LLNL);
  10. assertNotNull(testWeather);
  11. }
  12. }
Add Comment
Please, Sign In to add comment