Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RunWith(PowerMockRunner.class) @PowerMockIgnore("javax.net.ssl.*") @PrepareForTest(WeatherUtil.class)
- public class WeatherTest {
- @Test public void testGoodPayload() {
- PowerMockito.mockStatic(WeatherUtil.class);
- weatherObject = jsonToObject(stringToJson(goodPayload));
- when(WeatherUtil.getWeatherBody(LLNL_WEATHER)).thenReturn(weatherObject);
- when(WeatherUtil.getWeather(LLNL)).thenCallRealMethod();
- when(WeatherUtil.getSiteId(Mockito.anyObject())).thenCallRealMethod();
- Weather testWeather = WeatherUtil.getWeather(LLNL);
- assertNotNull(testWeather);
- }
- }
Add Comment
Please, Sign In to add comment