File tree Expand file tree Collapse file tree 7 files changed +19
-11
lines changed
src/test/java/org/springframework/ldap/ldif
src/test/java/org/springframework/ldap/odm/test
test/integration-tests-ad/src/test/java/org/springframework/ldap/itest/ad Expand file tree Collapse file tree 7 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ dependencies {
3030 api " commons-cli:commons-cli:1.5.0"
3131 api " commons-collections:commons-collections:3.2.2"
3232 api " commons-httpclient:commons-httpclient:3.1"
33- api " commons-io:commons-io:2.11.0"
3433 api " commons-lang:commons-lang:2.6"
3534 api " commons-logging:commons-logging:1.2"
3635 api " commons-pool:commons-pool:1.6"
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ dependencies {
99 testImplementation platform(' org.junit:junit-bom' )
1010 testImplementation " org.junit.vintage:junit-vintage-engine"
1111 testImplementation " junit:junit"
12- testImplementation " commons-io:commons-io"
1312 testImplementation " org.assertj:assertj-core"
1413 testImplementation (" log4j:log4j:1.2.17" ) {
1514 exclude group : ' javax.jms'
Original file line number Diff line number Diff line change 1818
1919import java .io .File ;
2020import java .io .IOException ;
21+ import java .nio .file .Files ;
2122
22- import org .apache .commons .io .FileUtils ;
2323import org .junit .Test ;
2424
2525import org .springframework .ldap .ldif .parser .LdifParser ;
@@ -39,7 +39,7 @@ public class Ldap233LdifParserTests {
3939 @ Test
4040 public void ldap233Test () throws IOException {
4141 File testFile = File .createTempFile ("ldapTest" , ".ldif" );
42- FileUtils .write (testFile , "This is just some random text" );
42+ Files .write (testFile . toPath () , "This is just some random text" . getBytes () );
4343
4444 LdifParser parser = new LdifParser (testFile );
4545 parser .setRecordSpecification (new BasicSchemaSpecification ());
Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ dependencies {
2525
2626 testImplementation project(" :spring-ldap-test" ),
2727 " junit:junit" ,
28- " jdepend:jdepend" ,
29- " commons-io:commons-io"
28+ " jdepend:jdepend"
3029 testImplementation " org.apache.directory.server:apacheds-core-entry"
3130 testImplementation " org.apache.directory.server:apacheds-core"
3231 testImplementation " org.apache.directory.server:apacheds-protocol-ldap"
Original file line number Diff line number Diff line change 1717package org .springframework .ldap .odm .test ;
1818
1919import java .io .File ;
20+ import java .io .FileOutputStream ;
21+ import java .io .OutputStream ;
2022import java .lang .reflect .Method ;
2123import java .net .URL ;
2224import java .net .URLClassLoader ;
25+ import java .nio .file .Files ;
26+ import java .nio .file .Path ;
2327import java .util .Iterator ;
2428import java .util .regex .Matcher ;
2529import java .util .regex .Pattern ;
2630
2731import javax .naming .ldap .LdapName ;
2832
29- import org .apache .commons .io .FileUtils ;
3033import org .junit .After ;
3134import org .junit .AfterClass ;
3235import org .junit .Before ;
@@ -154,7 +157,10 @@ public void generate() throws Exception {
154157 final String packageName = "org.springframework.ldap.odm.testclasses" ;
155158
156159 File tempFile = File .createTempFile ("test-odm-syntax-to-class-map" , ".txt" );
157- FileUtils .copyInputStreamToFile (new ClassPathResource ("/syntax-to-class-map.txt" ).getInputStream (), tempFile );
160+ Path from = new ClassPathResource ("/syntax-to-class-map.txt" ).getFile ().toPath ();
161+ try (OutputStream to = new FileOutputStream (tempFile )) {
162+ Files .copy (from , to );
163+ }
158164
159165 // Add classes dir to class path - needed for compilation
160166 System .setProperty ("java.class.path" ,
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ dependencies {
1212 api " org.springframework:spring-test"
1313
1414 implementation " com.google.code.typica:typica"
15- implementation " commons-io:commons-io"
1615
1716 optional " org.apache.directory.server:apacheds-core-entry"
1817 optional " org.apache.directory.server:apacheds-core"
Original file line number Diff line number Diff line change 1717package org .springframework .ldap .itest .ad ;
1818
1919import java .io .File ;
20+ import java .io .FileOutputStream ;
21+ import java .io .OutputStream ;
2022import java .lang .reflect .Method ;
2123import java .net .URL ;
2224import java .net .URLClassLoader ;
25+ import java .nio .file .Files ;
26+ import java .nio .file .Path ;
2327import java .util .HashMap ;
2428import java .util .regex .Matcher ;
2529import java .util .regex .Pattern ;
2630
27- import org .apache .commons .io .FileUtils ;
2831import org .junit .After ;
2932import org .junit .Before ;
3033import org .junit .Test ;
@@ -156,7 +159,10 @@ public void verifySchemaToJavaOnAd() throws Exception {
156159 final String packageName = "org.springframework.ldap.odm.testclasses" ;
157160
158161 File tempFile = File .createTempFile ("test-odm-syntax-to-class-map" , ".txt" );
159- FileUtils .copyInputStreamToFile (new ClassPathResource ("/syntax-to-class-map.txt" ).getInputStream (), tempFile );
162+ Path from = new ClassPathResource ("/syntax-to-class-map.txt" ).getFile ().toPath ();
163+ try (OutputStream to = new FileOutputStream (tempFile )) {
164+ Files .copy (from , to );
165+ }
160166
161167 // Add classes dir to class path - needed for compilation
162168 System .setProperty ("java.class.path" ,
You can’t perform that action at this time.
0 commit comments