无法将模拟URLClassLoader对象转换为URLClassLoader

时间:2019-05-19 02:42:25

标签: java mockito powermock powermockito

如何使用Mockito转换或模拟以下代码段

URLClassLoader cl = (URLClassloader) getClass().getClassLoader();
URL url = cl.findResource("META-INF/MANIFEST.MF");
Manifest manifest = new Manifest(url.openStream());
String buildNumber = manifest.getMainAttributes().getValue("Build-number");

0 个答案:

没有答案