-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
mockito-subclass
artifact (#2821)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
- Loading branch information
Showing
6 changed files
with
42 additions
and
2 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
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
1 change: 1 addition & 0 deletions
1
...rojects/subclass/src/main/resources/mockito-extensions/org.mockito.plugins.MemberAccessor
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 @@ | ||
member-accessor-module |
1 change: 1 addition & 0 deletions
1
subprojects/subclass/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker
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 @@ | ||
mock-maker-subclass |
26 changes: 26 additions & 0 deletions
26
subprojects/subclass/src/test/java/org/mockitosubclass/PluginTest.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,26 @@ | ||
/* | ||
* Copyright (c) 2022 Mockito contributors | ||
* This program is made available under the terms of the MIT License. | ||
*/ | ||
package org.mockitosubclass; | ||
|
||
import org.junit.Test; | ||
import org.mockito.internal.configuration.plugins.Plugins; | ||
import org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker; | ||
import org.mockito.internal.util.reflection.ModuleMemberAccessor; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class PluginTest { | ||
|
||
@Test | ||
public void mock_maker_should_be_inline() throws Exception { | ||
assertTrue(Plugins.getMockMaker() instanceof ByteBuddyMockMaker); | ||
} | ||
|
||
@Test | ||
public void member_accessor_should_be_module() throws Exception { | ||
assertTrue(Plugins.getMemberAccessor() instanceof ModuleMemberAccessor); | ||
} | ||
|
||
} |
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,11 @@ | ||
description = "Mockito preconfigured subclass mock maker" | ||
|
||
apply from: "$rootDir/gradle/java-library.gradle" | ||
|
||
dependencies { | ||
api project.rootProject | ||
testImplementation libraries.junit4 | ||
testImplementation libraries.assertj | ||
} | ||
|
||
tasks.javadoc.enabled = false |