From 9ae3486d26acd0a4cf6e5bb50ab78677967b1c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Alcarraz?= Date: Tue, 24 Oct 2023 17:21:24 -0500 Subject: [PATCH] Rename test module as suggested by @ar and @fgonzal Also: - rename unused parameter to ignored. - fixed code example in README.md --- modules/{test => testcore}/README.md | 9 +++++---- modules/{test => testcore}/build.gradle | 0 .../src/main/java/org/jpos/ee/test/LogSource.java | 0 .../main/java/org/jpos/ee/test/LogSupplierExtension.java | 5 ++--- .../src/main/java/org/jpos/ee/test/MUXMock.java | 0 .../main/java/org/jpos/ee/test/MUXSupplierExtension.java | 2 +- .../src/main/java/org/jpos/ee/test/TestUtil.java | 0 .../java/org/jpos/ee/test/LogSupplierExtensionTest.java | 0 .../java/org/jpos/ee/test/MUXSupplierExtensionTest.java | 0 settings.gradle | 4 ++-- 10 files changed, 10 insertions(+), 10 deletions(-) rename modules/{test => testcore}/README.md (96%) rename modules/{test => testcore}/build.gradle (100%) rename modules/{test => testcore}/src/main/java/org/jpos/ee/test/LogSource.java (100%) rename modules/{test => testcore}/src/main/java/org/jpos/ee/test/LogSupplierExtension.java (95%) rename modules/{test => testcore}/src/main/java/org/jpos/ee/test/MUXMock.java (100%) rename modules/{test => testcore}/src/main/java/org/jpos/ee/test/MUXSupplierExtension.java (98%) rename modules/{test => testcore}/src/main/java/org/jpos/ee/test/TestUtil.java (100%) rename modules/{test => testcore}/src/test/java/org/jpos/ee/test/LogSupplierExtensionTest.java (100%) rename modules/{test => testcore}/src/test/java/org/jpos/ee/test/MUXSupplierExtensionTest.java (100%) diff --git a/modules/test/README.md b/modules/testcore/README.md similarity index 96% rename from modules/test/README.md rename to modules/testcore/README.md index 2ef32f5333..4a0ddac39b 100644 --- a/modules/test/README.md +++ b/modules/testcore/README.md @@ -9,13 +9,14 @@ In the following example, if the logger does not already exist, a default one, t ```java @ExtendWith(LogSupplierExtension.class) class LogTest { - @LogSource (logger="Q2", realm="log-test") + @LogSource(logger = "Q2", realm = "log-test") Log log; - + @Test - public void testDebug(){ + public void testDebug() { log.debug("debug called"); } +} ``` @@ -71,4 +72,4 @@ class MUXSupplierExtensionTest { assertSame(response, mux.request(request, 1000L)); } } -``` \ No newline at end of file +``` diff --git a/modules/test/build.gradle b/modules/testcore/build.gradle similarity index 100% rename from modules/test/build.gradle rename to modules/testcore/build.gradle diff --git a/modules/test/src/main/java/org/jpos/ee/test/LogSource.java b/modules/testcore/src/main/java/org/jpos/ee/test/LogSource.java similarity index 100% rename from modules/test/src/main/java/org/jpos/ee/test/LogSource.java rename to modules/testcore/src/main/java/org/jpos/ee/test/LogSource.java diff --git a/modules/test/src/main/java/org/jpos/ee/test/LogSupplierExtension.java b/modules/testcore/src/main/java/org/jpos/ee/test/LogSupplierExtension.java similarity index 95% rename from modules/test/src/main/java/org/jpos/ee/test/LogSupplierExtension.java rename to modules/testcore/src/main/java/org/jpos/ee/test/LogSupplierExtension.java index fc85cc18e8..afbd5a8cf4 100644 --- a/modules/test/src/main/java/org/jpos/ee/test/LogSupplierExtension.java +++ b/modules/testcore/src/main/java/org/jpos/ee/test/LogSupplierExtension.java @@ -63,14 +63,13 @@ public void beforeEach(ExtensionContext context) throws IllegalArgumentException * * @param parameterContext the context for the parameter for which an argument should * be resolved; never {@code null} - * @param extensionContext the extension context for the {@code Executable} - * about to be invoked; never {@code null} + * @param ignored unused * @return {@code true} if this resolver can resolve an argument for the parameter * @see #resolveParameter * @see ParameterContext */ @Override - public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException { + public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext ignored) throws ParameterResolutionException { return parameterContext.isAnnotated(LogSource.class) && parameterContext.getTarget().map(Object::getClass).filter(c -> c.isAssignableFrom(LogSource.class)).isPresent(); } diff --git a/modules/test/src/main/java/org/jpos/ee/test/MUXMock.java b/modules/testcore/src/main/java/org/jpos/ee/test/MUXMock.java similarity index 100% rename from modules/test/src/main/java/org/jpos/ee/test/MUXMock.java rename to modules/testcore/src/main/java/org/jpos/ee/test/MUXMock.java diff --git a/modules/test/src/main/java/org/jpos/ee/test/MUXSupplierExtension.java b/modules/testcore/src/main/java/org/jpos/ee/test/MUXSupplierExtension.java similarity index 98% rename from modules/test/src/main/java/org/jpos/ee/test/MUXSupplierExtension.java rename to modules/testcore/src/main/java/org/jpos/ee/test/MUXSupplierExtension.java index 4a1f92b319..a857f69124 100644 --- a/modules/test/src/main/java/org/jpos/ee/test/MUXSupplierExtension.java +++ b/modules/testcore/src/main/java/org/jpos/ee/test/MUXSupplierExtension.java @@ -55,7 +55,7 @@ protected void setUp(ExtensionContext context, boolean beforeAll) { * @param afterAll if this is for an afterAll method unregister only static muxes otherwise only instences. */ protected void tearDown(ExtensionContext context, boolean afterAll){ - runOnFields(context, afterAll, (f, annotation) -> NameRegistrar.unregister("mux." + annotation.name())); + runOnFields(context, afterAll, (ignored, annotation) -> NameRegistrar.unregister("mux." + annotation.name())); } /** diff --git a/modules/test/src/main/java/org/jpos/ee/test/TestUtil.java b/modules/testcore/src/main/java/org/jpos/ee/test/TestUtil.java similarity index 100% rename from modules/test/src/main/java/org/jpos/ee/test/TestUtil.java rename to modules/testcore/src/main/java/org/jpos/ee/test/TestUtil.java diff --git a/modules/test/src/test/java/org/jpos/ee/test/LogSupplierExtensionTest.java b/modules/testcore/src/test/java/org/jpos/ee/test/LogSupplierExtensionTest.java similarity index 100% rename from modules/test/src/test/java/org/jpos/ee/test/LogSupplierExtensionTest.java rename to modules/testcore/src/test/java/org/jpos/ee/test/LogSupplierExtensionTest.java diff --git a/modules/test/src/test/java/org/jpos/ee/test/MUXSupplierExtensionTest.java b/modules/testcore/src/test/java/org/jpos/ee/test/MUXSupplierExtensionTest.java similarity index 100% rename from modules/test/src/test/java/org/jpos/ee/test/MUXSupplierExtensionTest.java rename to modules/testcore/src/test/java/org/jpos/ee/test/MUXSupplierExtensionTest.java diff --git a/settings.gradle b/settings.gradle index 89e7e49855..2a70dbda42 100644 --- a/settings.gradle +++ b/settings.gradle @@ -46,8 +46,8 @@ include ':modules:core', ':modules:seqno', ':modules:db-flyway', ':modules:elasticsearch', - ':modules:bom' - ':modules:test' + ':modules:bom', + ':modules:testcore' rootProject.name = 'jposee'