daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Jan 19th, 2018 55 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top