From f6d87ab99d9e731f5735f662cc5c8b76f19a7153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edd=C3=BA=20Mel=C3=A9ndez?= Date: Wed, 3 Sep 2025 12:01:06 -0600 Subject: [PATCH] Move LDAP tests to JUnit Jupiter --- modules/ldap/build.gradle | 8 ++++++++ .../org/testcontainers/ldap/LLdapContainerTest.java | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/ldap/build.gradle b/modules/ldap/build.gradle index fa255990be8..4722de4d317 100644 --- a/modules/ldap/build.gradle +++ b/modules/ldap/build.gradle @@ -3,6 +3,14 @@ description = "Testcontainers :: LDAP" dependencies { api project(':testcontainers') + testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0' + + testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4' testImplementation 'org.assertj:assertj-core:3.27.4' testImplementation 'com.unboundid:unboundid-ldapsdk:7.0.3' } + +test { + useJUnitPlatform() +} + diff --git a/modules/ldap/src/test/java/org/testcontainers/ldap/LLdapContainerTest.java b/modules/ldap/src/test/java/org/testcontainers/ldap/LLdapContainerTest.java index d8914c793c2..96e77c9a3f0 100644 --- a/modules/ldap/src/test/java/org/testcontainers/ldap/LLdapContainerTest.java +++ b/modules/ldap/src/test/java/org/testcontainers/ldap/LLdapContainerTest.java @@ -4,14 +4,14 @@ import com.unboundid.ldap.sdk.LDAPConnection; import com.unboundid.ldap.sdk.LDAPException; import com.unboundid.ldap.sdk.LDAPURL; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; -public class LLdapContainerTest { +class LLdapContainerTest { @Test - public void test() throws LDAPException { + void test() throws LDAPException { try ( // container { LLdapContainer lldap = new LLdapContainer("lldap/lldap:v0.6.1-alpine") // } @@ -24,7 +24,7 @@ public void test() throws LDAPException { } @Test - public void testUsingLdapUrl() throws LDAPException { + void testUsingLdapUrl() throws LDAPException { try (LLdapContainer lldap = new LLdapContainer("lldap/lldap:v0.6.1-alpine")) { lldap.start(); @@ -36,7 +36,7 @@ public void testUsingLdapUrl() throws LDAPException { } @Test - public void testWithCustomBaseDn() throws LDAPException { + void testWithCustomBaseDn() throws LDAPException { try ( LLdapContainer lldap = new LLdapContainer("lldap/lldap:v0.6.1-alpine") .withBaseDn("dc=testcontainers,dc=org") @@ -53,7 +53,7 @@ public void testWithCustomBaseDn() throws LDAPException { } @Test - public void testWithCustomUserPass() throws LDAPException { + void testWithCustomUserPass() throws LDAPException { try (LLdapContainer lldap = new LLdapContainer("lldap/lldap:v0.6.1-alpine").withUserPass("adminPas$word")) { lldap.start();