Skip to content

Commit 320fce6

Browse files
committed
Add core to build
Issue gh-610
1 parent e3b1d16 commit 320fce6

File tree

6 files changed

+25
-9
lines changed

6 files changed

+25
-9
lines changed

core/build.gradle

+17-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ dependencies {
1919
implementation "org.springframework:spring-tx"
2020
implementation "org.slf4j:slf4j-api"
2121

22+
provided "com.sun:ldapbp:1.0"
23+
2224
optional "org.springframework:spring-context"
2325
optional "org.springframework:spring-jdbc"
2426
optional "org.springframework:spring-orm"
@@ -28,7 +30,8 @@ dependencies {
2830
optional "org.apache.commons:commons-pool2"
2931
implementation 'jakarta.xml.bind:jakarta.xml.bind-api'
3032

31-
provided "com.sun:ldapbp:1.0"
33+
testImplementation platform('org.junit:junit-bom')
34+
testImplementation "org.junit.vintage:junit-vintage-engine"
3235

3336
testImplementation "junit:junit"
3437
testImplementation "commons-lang:commons-lang"
@@ -37,4 +40,17 @@ dependencies {
3740
testImplementation "org.mockito:mockito-inline"
3841
testImplementation "org.springframework:spring-test"
3942
testImplementation "org.assertj:assertj-core"
43+
testImplementation "com.unboundid:unboundid-ldapsdk"
4044
}
45+
46+
compileTestJava {
47+
doFirst {
48+
options.compilerArgs = [
49+
'--add-exports', 'java.naming/com.sun.jndi.ldap=ALL-UNNAMED'
50+
]
51+
}
52+
}
53+
54+
test {
55+
jvmArgs '--add-exports', 'java.naming/com.sun.jndi.ldap=ALL-UNNAMED'
56+
}

core/src/main/java/org/springframework/ldap/control/PagedResultsCookie.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
*/
1616
package org.springframework.ldap.control;
1717

18-
import com.sun.jndi.ldap.ctl.PagedResultsControl;
19-
18+
import javax.naming.ldap.PagedResultsControl;
2019
import java.util.Arrays;
2120

2221
/**

core/src/test/java/org/springframework/ldap/control/PagedResultsDirContextProcessorTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class PagedResultsDirContextProcessorTest {
3737

3838
private LdapContext ldapContextMock;
3939

40-
private PagedResultsDirContextProcessor tested;
40+
private PagedResultsDirContextProcessor tested;
4141

4242
@Before
4343
public void setUp() throws Exception {
@@ -101,7 +101,7 @@ public void testPostProcess_InvalidResponseControl() throws Exception {
101101
byte[] value = new byte[1];
102102
value[0] = pageSize;
103103
byte[] cookie = encodeDirSyncValue(resultSize, value);
104-
104+
105105
// Using another response control to verify that it is ignored
106106
DirSyncResponseControl control = new DirSyncResponseControl(
107107
"dummy", true, cookie);
@@ -132,7 +132,7 @@ public void testBerDecoding() throws Exception {
132132
value[0] = 8;
133133
int pageSize = 20;
134134
byte[] cookie = encodeValue(pageSize, value);
135-
135+
136136
BerDecoder ber = new BerDecoder(cookie, 0, cookie.length);
137137

138138
ber.parseSeq(null);

core/src/test/java/org/springframework/ldap/control/RequestControlDirContextProcessorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.ldap.control;
1717

18-
import com.sun.jndi.ldap.ctl.SortControl;
18+
import javax.naming.ldap.SortControl;
1919
import org.junit.After;
2020
import org.junit.Before;
2121
import org.junit.Test;

core/src/test/java/org/springframework/ldap/control/SortControlDirContextProcessorTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434

3535
/**
3636
* Unit tests for the SortControlDirContextProcessor class.
37-
*
37+
*
3838
* @author Ulrik Sandberg
3939
*/
4040
public class SortControlDirContextProcessorTest {
4141

4242
private LdapContext ldapContextMock;
4343

44-
private SortControlDirContextProcessor tested;
44+
private SortControlDirContextProcessor tested;
4545

4646
@Before
4747
public void setUp() throws Exception {

dependencies/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dependencies {
1919
api platform("io.rsocket:rsocket-bom:1.1.1")
2020
api platform("org.springframework.data:spring-data-bom:2022.1.0-SNAPSHOT")
2121
api platform("com.fasterxml.jackson:jackson-bom:2.13.0")
22+
api platform("org.junit:junit-bom:5.8.1")
2223
constraints {
2324
api "com.querydsl:querydsl-core:$queryDslVersion"
2425
api "com.querydsl:querydsl-apt:$queryDslVersion"

0 commit comments

Comments
 (0)