RED-4510: Generated Redaction Log and Generating will not run with profile
This commit is contained in:
parent
099d1092f3
commit
ddcc23d197
@ -28,7 +28,6 @@ import java.util.Set;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.assertj.core.data.Offset;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
@ -212,7 +211,6 @@ public class RulesTest {
|
|||||||
public void generateRedactionLogForOneFile() {
|
public void generateRedactionLogForOneFile() {
|
||||||
|
|
||||||
String fileName = "files/Compounds/31 A14111B - EU AIR3 - MCP Section 1 - Identity of the plant protection product.pdf";
|
String fileName = "files/Compounds/31 A14111B - EU AIR3 - MCP Section 1 - Identity of the plant protection product.pdf";
|
||||||
fileName = "scanned/VV-377031.pdf";//TODO
|
|
||||||
fileSize = 1;
|
fileSize = 1;
|
||||||
generateAndSaveRedactionLog(fileName, true);
|
generateAndSaveRedactionLog(fileName, true);
|
||||||
}
|
}
|
||||||
@ -224,7 +222,6 @@ public class RulesTest {
|
|||||||
* Please commit generated files, if not the following tests will fail
|
* Please commit generated files, if not the following tests will fail
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@Ignore//TODO
|
|
||||||
public void generateRedactionLogForAllFiles() {
|
public void generateRedactionLogForAllFiles() {
|
||||||
|
|
||||||
Set<String> files = getFileNames(new HashSet<>(), FileSystems.getDefault().getPath(RESOURCES_PATH));
|
Set<String> files = getFileNames(new HashSet<>(), FileSystems.getDefault().getPath(RESOURCES_PATH));
|
||||||
@ -239,11 +236,9 @@ public class RulesTest {
|
|||||||
* If RedactionLog Json does not exist, test will fail.
|
* If RedactionLog Json does not exist, test will fail.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
// @Ignore//TODO
|
|
||||||
public void analyseFileAndCompareRedactionLog() {
|
public void analyseFileAndCompareRedactionLog() {
|
||||||
|
|
||||||
// String fileName = "files/RulesTest/SYNGENTA_EFSA_sanitisation_GFL_v1_withHighlights.pdf"; //TODO PSC
|
String fileName = "files/RulesTest/SYNGENTA_EFSA_sanitisation_GFL_v1_withHighlights.pdf";
|
||||||
String fileName = "scanned/VV-377031.pdf";
|
|
||||||
fileSize = 1;
|
fileSize = 1;
|
||||||
analyseFileAndCompareRedactionLog(fileName);
|
analyseFileAndCompareRedactionLog(fileName);
|
||||||
}
|
}
|
||||||
@ -255,7 +250,6 @@ public class RulesTest {
|
|||||||
*/
|
*/
|
||||||
@IfProfileValue(name = "test-groups", value = "rules-test")
|
@IfProfileValue(name = "test-groups", value = "rules-test")
|
||||||
@Test
|
@Test
|
||||||
@Ignore//TODO PSC
|
|
||||||
public void analyseAllFilesAndCompareRedactionLogs() {
|
public void analyseAllFilesAndCompareRedactionLogs() {
|
||||||
|
|
||||||
Set<String> files = getFileNames(new HashSet<>(), FileSystems.getDefault().getPath(RESOURCES_PATH));
|
Set<String> files = getFileNames(new HashSet<>(), FileSystems.getDefault().getPath(RESOURCES_PATH));
|
||||||
@ -355,17 +349,8 @@ public class RulesTest {
|
|||||||
assertThat(savedRedactionLogEntry.get().getSectionNumber()).isEqualTo(redactionLogEntry.getSectionNumber());
|
assertThat(savedRedactionLogEntry.get().getSectionNumber()).isEqualTo(redactionLogEntry.getSectionNumber());
|
||||||
assertThat(savedRedactionLogEntry.get().getTextBefore()).isEqualTo(redactionLogEntry.getTextBefore());
|
assertThat(savedRedactionLogEntry.get().getTextBefore()).isEqualTo(redactionLogEntry.getTextBefore());
|
||||||
assertThat(savedRedactionLogEntry.get().getTextAfter()).isEqualTo(redactionLogEntry.getTextAfter());
|
assertThat(savedRedactionLogEntry.get().getTextAfter()).isEqualTo(redactionLogEntry.getTextAfter());
|
||||||
|
|
||||||
System.out.println("OFF " + savedRedactionLogEntry.get().getId());
|
|
||||||
System.out.println("OFF " + savedRedactionLogEntry.get().getStartOffset() + " " + redactionLogEntry.getStartOffset());
|
|
||||||
System.out.println("OFF " + savedRedactionLogEntry.get().getEndOffset() + " " + redactionLogEntry.getEndOffset());
|
|
||||||
|
|
||||||
assertThat(savedRedactionLogEntry.get().getStartOffset()).isCloseTo(redactionLogEntry.getStartOffset(), Offset.offset(4));
|
|
||||||
assertThat(savedRedactionLogEntry.get().getEndOffset()).isCloseTo(redactionLogEntry.getEndOffset(), Offset.offset(4));
|
|
||||||
|
|
||||||
assertThat(savedRedactionLogEntry.get().getStartOffset()).isEqualTo(redactionLogEntry.getStartOffset());
|
assertThat(savedRedactionLogEntry.get().getStartOffset()).isEqualTo(redactionLogEntry.getStartOffset());
|
||||||
assertThat(savedRedactionLogEntry.get().getEndOffset()).isEqualTo(redactionLogEntry.getEndOffset());
|
assertThat(savedRedactionLogEntry.get().getEndOffset()).isEqualTo(redactionLogEntry.getEndOffset());
|
||||||
|
|
||||||
assertThat(savedRedactionLogEntry.get().isImage()).isEqualTo(redactionLogEntry.isImage());
|
assertThat(savedRedactionLogEntry.get().isImage()).isEqualTo(redactionLogEntry.isImage());
|
||||||
assertThat(savedRedactionLogEntry.get().isImageHasTransparency()).isEqualTo(redactionLogEntry.isImageHasTransparency());
|
assertThat(savedRedactionLogEntry.get().isImageHasTransparency()).isEqualTo(redactionLogEntry.isImageHasTransparency());
|
||||||
assertThat(savedRedactionLogEntry.get().isDictionaryEntry()).isEqualTo(redactionLogEntry.isDictionaryEntry());
|
assertThat(savedRedactionLogEntry.get().isDictionaryEntry()).isEqualTo(redactionLogEntry.isDictionaryEntry());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user