Skip to content

Commit a4e2e48

Browse files
authored
Add mockito-subclass artifact (#2821)
Signed-off-by: Andriy Redko <[email protected]>
1 parent e2e6289 commit a4e2e48

File tree

6 files changed

+42
-2
lines changed

6 files changed

+42
-2
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
matrix:
3232
java: [8, 11, 17]
33-
mock-maker: ['mock-maker-default', 'mock-maker-inline']
33+
mock-maker: ['mock-maker-default', 'mock-maker-inline', 'mock-maker-subclass']
3434

3535
# All build steps
3636
# SINGLE-MATRIX-JOB means that the step does not need to be executed on every job in the matrix

settings.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ plugins {
22
id("com.gradle.enterprise").version("3.3.4")
33
}
44

5-
include("inline",
5+
include("subclass",
6+
"inline",
67
"proxy",
78
"extTest",
89
"groovyTest",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
member-accessor-module
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mock-maker-subclass
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2022 Mockito contributors
3+
* This program is made available under the terms of the MIT License.
4+
*/
5+
package org.mockitosubclass;
6+
7+
import org.junit.Test;
8+
import org.mockito.internal.configuration.plugins.Plugins;
9+
import org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker;
10+
import org.mockito.internal.util.reflection.ModuleMemberAccessor;
11+
12+
import static org.junit.Assert.*;
13+
14+
public class PluginTest {
15+
16+
@Test
17+
public void mock_maker_should_be_inline() throws Exception {
18+
assertTrue(Plugins.getMockMaker() instanceof ByteBuddyMockMaker);
19+
}
20+
21+
@Test
22+
public void member_accessor_should_be_module() throws Exception {
23+
assertTrue(Plugins.getMemberAccessor() instanceof ModuleMemberAccessor);
24+
}
25+
26+
}

subprojects/subclass/subclass.gradle

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
description = "Mockito preconfigured subclass mock maker"
2+
3+
apply from: "$rootDir/gradle/java-library.gradle"
4+
5+
dependencies {
6+
api project.rootProject
7+
testImplementation libraries.junit4
8+
testImplementation libraries.assertj
9+
}
10+
11+
tasks.javadoc.enabled = false

0 commit comments

Comments
 (0)