You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2021/02/16 10:19:54 UTC

[isis-app-simpleapp] branch jdo updated: api changes with approvaltests

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch jdo
in repository https://gitbox.apache.org/repos/asf/isis-app-simpleapp.git


The following commit(s) were added to refs/heads/jdo by this push:
     new b391bd9  api changes with approvaltests
b391bd9 is described below

commit b391bd918be9ecde5b75e71bd208e18b593d5fb3
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Feb 16 11:19:44 2021 +0100

    api changes with approvaltests
---
 .../util/CurrentVsApprovedApprovalTextWriter.java  | 46 +++++++++++-----------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/webapp/src/test/java/domainapp/webapp/util/CurrentVsApprovedApprovalTextWriter.java b/webapp/src/test/java/domainapp/webapp/util/CurrentVsApprovedApprovalTextWriter.java
index c7bb8e4..55ac7d5 100644
--- a/webapp/src/test/java/domainapp/webapp/util/CurrentVsApprovedApprovalTextWriter.java
+++ b/webapp/src/test/java/domainapp/webapp/util/CurrentVsApprovedApprovalTextWriter.java
@@ -1,35 +1,35 @@
 package domainapp.webapp.util;
 
-import java.io.File;
-
+import org.approvaltests.core.Options;
 import org.approvaltests.writers.ApprovalTextWriter;
 
 public class CurrentVsApprovedApprovalTextWriter extends ApprovalTextWriter {
 
-    private final String fileExtensionWithoutDot;
+    //private final String fileExtensionWithoutDot;
 
     public CurrentVsApprovedApprovalTextWriter(String received, String fileExtensionWithoutDot) {
-        super(received, fileExtensionWithoutDot);
-        this.fileExtensionWithoutDot = fileExtensionWithoutDot;
-    }
-
-    @Override
-    public String getReceivedFilename(final String base) {
-        return toFilename("current", base);
+        super(received, new Options().forFile()
+                .withExtension(fileExtensionWithoutDot));
+        //this.fileExtensionWithoutDot = fileExtensionWithoutDot;
     }
 
-    @Override
-    public String getApprovalFilename(final String base) {
-        return toFilename("approved", base);
-    }
-
-    private String toFilename(final String prefix, final String base) {
-        final File file = new File(base);
-        final File parentFile = file.getParentFile();
-        final String localName = file.getName();
-        final File newDir = new File(parentFile, prefix);
-        final File newFile = new File(newDir, localName + "." + fileExtensionWithoutDot);
-        return newFile.toString();
-    }
+//    @Override
+//    public String getReceivedFilename(final String base) {
+//        return toFilename("current", base);
+//    }
+//
+//    @Override
+//    public String getApprovalFilename(final String base) {
+//        return toFilename("approved", base);
+//    }
+//
+//    private String toFilename(final String prefix, final String base) {
+//        final File file = new File(base);
+//        final File parentFile = file.getParentFile();
+//        final String localName = file.getName();
+//        final File newDir = new File(parentFile, prefix);
+//        final File newFile = new File(newDir, localName + "." + fileExtensionWithoutDot);
+//        return newFile.toString();
+//    }
 
 }