<small id='BGRbw'></small><noframes id='BGRbw'>

      <bdo id='BGRbw'></bdo><ul id='BGRbw'></ul>
  1. <tfoot id='BGRbw'></tfoot>
    1. <i id='BGRbw'><tr id='BGRbw'><dt id='BGRbw'><q id='BGRbw'><span id='BGRbw'><b id='BGRbw'><form id='BGRbw'><ins id='BGRbw'></ins><ul id='BGRbw'></ul><sub id='BGRbw'></sub></form><legend id='BGRbw'></legend><bdo id='BGRbw'><pre id='BGRbw'><center id='BGRbw'></center></pre></bdo></b><th id='BGRbw'></th></span></q></dt></tr></i><div id='BGRbw'><tfoot id='BGRbw'></tfoot><dl id='BGRbw'><fieldset id='BGRbw'></fieldset></dl></div>
    2. <legend id='BGRbw'><style id='BGRbw'><dir id='BGRbw'><q id='BGRbw'></q></dir></style></legend>
    3. 我应该使用哪些 Maven 工件来导入 PowerMock?

      Which Maven artifacts should I use to import PowerMock?(我应该使用哪些 Maven 工件来导入 PowerMock?)
    4. <tfoot id='8ZHDf'></tfoot>

      <i id='8ZHDf'><tr id='8ZHDf'><dt id='8ZHDf'><q id='8ZHDf'><span id='8ZHDf'><b id='8ZHDf'><form id='8ZHDf'><ins id='8ZHDf'></ins><ul id='8ZHDf'></ul><sub id='8ZHDf'></sub></form><legend id='8ZHDf'></legend><bdo id='8ZHDf'><pre id='8ZHDf'><center id='8ZHDf'></center></pre></bdo></b><th id='8ZHDf'></th></span></q></dt></tr></i><div id='8ZHDf'><tfoot id='8ZHDf'></tfoot><dl id='8ZHDf'><fieldset id='8ZHDf'></fieldset></dl></div>

      <small id='8ZHDf'></small><noframes id='8ZHDf'>

              <bdo id='8ZHDf'></bdo><ul id='8ZHDf'></ul>
              <legend id='8ZHDf'><style id='8ZHDf'><dir id='8ZHDf'><q id='8ZHDf'></q></dir></style></legend>

                  <tbody id='8ZHDf'></tbody>
                本文介绍了我应该使用哪些 Maven 工件来导入 PowerMock?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我需要将哪些 jar 添加到我的 pom.xml 以使 PowerMock 与 Mockito 一起使用?我有以下依赖项:

                What jars do I need to add to my pom.xml to get PowerMock working with Mockito? I have the following dependencies:

                <dependency>
                    <groupId>org.mockito</groupId>
                    <artifactId>mockito-all</artifactId>
                    <version>1.9.0</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.powermock</groupId>
                    <artifactId>powermock-api-mockito</artifactId>
                    <version>1.4.11</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.powermock</groupId>
                    <artifactId>powermock-api-support</artifactId>
                    <version>1.4.11</version>
                    <scope>test</scope>
                 </dependency>
                

                但是当我在类级别添加 @PrepareForTest 注释时,Eclipse 找不到它,但它可以找到 PowerMockito.我错过了什么罐子?

                but when I add the @PrepareForTest annotation at class level, Eclipse cannot find it, but it can find PowerMockito. What jar am I missing?

                推荐答案

                根据Mockito_Maven PowerMock wiki 上的页面,使用这个:

                According to the Mockito_Maven page on the PowerMock wiki, use this:

                <properties>
                    <powermock.version>1.6.6</powermock.version>
                </properties>
                <dependencies>
                   <dependency>
                      <groupId>org.powermock</groupId>
                      <artifactId>powermock-module-junit4</artifactId>
                      <version>${powermock.version}</version>
                      <scope>test</scope>
                   </dependency>
                   <dependency>
                      <groupId>org.powermock</groupId>
                      <artifactId>powermock-api-mockito</artifactId>
                      <version>${powermock.version}</version>
                      <scope>test</scope>
                   </dependency>
                </dependencies>
                

                powermock-api-support 似乎是 "仅实用程序类",您仍然需要 powermock-module-junit4 中提供的核心库.

                powermock-api-support seems to be "utility classes only", where you still need the core libraries provided in powermock-module-junit4.

                这篇关于我应该使用哪些 Maven 工件来导入 PowerMock?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                • <tfoot id='jL8Tn'></tfoot>
                      <i id='jL8Tn'><tr id='jL8Tn'><dt id='jL8Tn'><q id='jL8Tn'><span id='jL8Tn'><b id='jL8Tn'><form id='jL8Tn'><ins id='jL8Tn'></ins><ul id='jL8Tn'></ul><sub id='jL8Tn'></sub></form><legend id='jL8Tn'></legend><bdo id='jL8Tn'><pre id='jL8Tn'><center id='jL8Tn'></center></pre></bdo></b><th id='jL8Tn'></th></span></q></dt></tr></i><div id='jL8Tn'><tfoot id='jL8Tn'></tfoot><dl id='jL8Tn'><fieldset id='jL8Tn'></fieldset></dl></div>
                        <tbody id='jL8Tn'></tbody>
                      • <bdo id='jL8Tn'></bdo><ul id='jL8Tn'></ul>

                        1. <legend id='jL8Tn'><style id='jL8Tn'><dir id='jL8Tn'><q id='jL8Tn'></q></dir></style></legend>

                          <small id='jL8Tn'></small><noframes id='jL8Tn'>