1:Mock带参数的静态方法
PowerMockito类
package org.powermock.api.mockito;
CityCodeBean cityCodeBean = CityCodeUtil.getCityCodeBeanByIata(split[4]);
/**********************************/
try {
//PowerMockito.doReturn(cityCodeBean).when(CityCodeUtil.class, "getCityCodeBeanByIata");
PowerMockito.when(CityCodeUtil.class, "getCityCodeBeanByIata", Mockito.anyString()).thenReturn(cityCodeBean);
} catch (Exception e) {
e.printStackTrace();
}