Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new artifact mockito-subclass (to use mock-maker-subclass MockMaker) #2821

Merged
merged 1 commit into from Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
matrix:
java: [8, 11, 17]
mock-maker: ['mock-maker-default', 'mock-maker-inline']
mock-maker: ['mock-maker-default', 'mock-maker-inline', 'mock-maker-subclass']

# All build steps
# SINGLE-MATRIX-JOB means that the step does not need to be executed on every job in the matrix
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle.kts
Expand Up @@ -2,7 +2,8 @@ plugins {
id("com.gradle.enterprise").version("3.3.4")
}

include("inline",
include("subclass",
"inline",
"proxy",
"extTest",
"groovyTest",
Expand Down
@@ -0,0 +1 @@
member-accessor-module
@@ -0,0 +1 @@
mock-maker-subclass
@@ -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);
}

}
11 changes: 11 additions & 0 deletions subprojects/subclass/subclass.gradle
@@ -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