forked from powermock/powermock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…for two fields of the same type.
- Loading branch information
1 parent
a9f82fb
commit 37b7e5b
Showing
7 changed files
with
74 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ repo | |
.idea | ||
**/build/** | ||
.gradle | ||
**/classes/** | ||
**/classes/** | ||
**/out/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...symock/junit412/src/test/java/samples/junit412/bug/github755/TwoObjectsAnnotatedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package samples.junit412.bug.github755; | ||
|
||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.powermock.api.easymock.annotation.Mock; | ||
import org.powermock.api.easymock.annotation.MockNice; | ||
import org.powermock.modules.junit4.PowerMockRunner; | ||
import samples.newmocking.SomeDependency; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@RunWith(PowerMockRunner.class) | ||
public class TwoObjectsAnnotatedTest { | ||
|
||
@Mock | ||
private String obj1; | ||
|
||
@Mock | ||
private String obj2; | ||
|
||
@MockNice | ||
private SomeDependency someClass1; | ||
|
||
@MockNice | ||
private SomeDependency someClass2; | ||
|
||
@Test | ||
public void should_create_mock_for_all_fields_annotated_Mock() { | ||
assertThat(obj1).isNotNull(); | ||
assertThat(obj2).isNotNull(); | ||
} | ||
|
||
@Test | ||
public void should_create_mock_for_all_fields_annotated_MockNice() { | ||
assertThat(someClass1).isNotNull(); | ||
assertThat(someClass2).isNotNull(); | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
tests/easymock/junit412/src/test/java/samples/junit412/bug/github755/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** | ||
* @Mock annotation from easymock api does not work for two fields of the same type. | ||
* | ||
*/ | ||
package samples.junit412.bug.github755; |