Identified depracations and updated the code
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package io.spring;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.sql.SQLException;
|
||||
@@ -26,16 +27,16 @@ import java.util.Map;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.h2.tools.Server;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
//import org.springframework.batch.test.AssertFile;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
//import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
||||
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
|
||||
@@ -145,9 +146,9 @@ public class BatchJobApplicationTests {
|
||||
}
|
||||
|
||||
private void validateFileResult() throws Exception {
|
||||
// AssertFile.assertLineCount(6, new FileSystemResource("./result.txt"));
|
||||
// AssertFile.assertFileEquals(new ClassPathResource("testresult.txt"),
|
||||
// new FileSystemResource(this.outputFile));
|
||||
assertThat(Assertions.linesOf(this.outputFile, StandardCharsets.UTF_16).size()).isEqualTo(6);
|
||||
assertThat(Assertions.contentOf((new ClassPathResource("testresult.txt")).getFile())
|
||||
.equals(new FileSystemResource(this.outputFile)));
|
||||
}
|
||||
|
||||
private void validateDBResult() {
|
||||
|
||||
Reference in New Issue
Block a user