<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?

      时间:2023-05-29
    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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:存根和模拟时的区别 下一篇:Mockito thenReturn 返回相同的实例

                相关文章

              1. <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>
                  • <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'>