From da8fa5b89502858dc014244674c7df888a32c9ac Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Thu, 6 Jul 2023 14:22:21 +0530 Subject: [PATCH] fixed unit tests --- .../pom.xml | 14 +++++++++++++- .../client/extension/service/JWTClientTest.java | 3 ++- .../resources/user-test/user-mgt-registry-test.xml | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml index 8b646fa964..f35ea73b60 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml @@ -155,7 +155,12 @@ org.powermock - powermock-api-mockito + powermock-api-mockito2 + test + + + org.mockito + mockito-core test @@ -253,12 +258,19 @@ org.apache.maven.plugins maven-surefire-plugin + + --add-opens=java.xml/jdk.xml.internal=ALL-UNNAMED + --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED + file:src/test/resources/log4j.properties src/test/resources/testng.xml + + org.ops4j.pax.logging + diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientTest.java b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientTest.java index d497d5e108..beb7db9962 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientTest.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientTest.java @@ -43,9 +43,10 @@ import java.security.NoSuchAlgorithmException; import java.util.HashMap; import java.util.Map; import java.util.Properties; +import org.powermock.modules.testng.PowerMockTestCase; @PrepareForTest(JWTClientUtil.class) -public class JWTClientTest { +public class JWTClientTest extends PowerMockTestCase{ private static final Log log = LogFactory.getLog(JWTClientTest.class); @ObjectFactory diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/user-test/user-mgt-registry-test.xml b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/user-test/user-mgt-registry-test.xml index fc32a2698d..96fd6acfff 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/user-test/user-mgt-registry-test.xml +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/user-test/user-mgt-registry-test.xml @@ -27,7 +27,7 @@ everyone false 500 - jdbc:h2:target/databasetest/CARBON_TEST + jdbc:h2:./target/databasetest/CARBON_TEST org.h2.Driver 50 60000