daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Jan 19th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data
Top