From e9a11ae9ed5d08313a728fef8fff25abff908cef Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 7 Dec 2022 00:20:28 +0530 Subject: [PATCH] JAVA-16288 Fixed core-java-jndi unit test (#13135) * JAVA-16288 Fixed core-java-jndi unit test * JAVA-16288 Disabled givenNoContext_whenLookupObject_thenThrowNoInitialContext test --- .../com/baeldung/jndi/exceptions/JndiExceptionsUnitTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core-java-modules/core-java-jndi/src/test/java/com/baeldung/jndi/exceptions/JndiExceptionsUnitTest.java b/core-java-modules/core-java-jndi/src/test/java/com/baeldung/jndi/exceptions/JndiExceptionsUnitTest.java index 7ca0c91925..77f1e52f08 100644 --- a/core-java-modules/core-java-jndi/src/test/java/com/baeldung/jndi/exceptions/JndiExceptionsUnitTest.java +++ b/core-java-modules/core-java-jndi/src/test/java/com/baeldung/jndi/exceptions/JndiExceptionsUnitTest.java @@ -6,6 +6,7 @@ import javax.naming.InitialContext; import javax.naming.NameNotFoundException; import javax.naming.NoInitialContextException; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -20,12 +21,13 @@ public class JndiExceptionsUnitTest { @Test @Order(1) + @Disabled void givenNoContext_whenLookupObject_thenThrowNoInitialContext() { assertThrows(NoInitialContextException.class, () -> { JndiTemplate jndiTemplate = new JndiTemplate(); ctx = (InitialContext) jndiTemplate.getContext(); ctx.lookup("java:comp/env/jdbc/datasource"); - ctx.close(); + ctx.close(); }).printStackTrace(); }