Commits

Sam Adams  committed b2e353b

Renamed class

  • Participants
  • Parent commits 598e4fa

Comments (0)

Files changed (2)

File chemistry-import-testutils/src/main/java/net/chempound/chemistry/testutil/ImageGeneratorMocker.java

-package net.chempound.chemistry.testutil;
-
-import net.chempound.chemistry.ImageGenerator;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-import org.xmlcml.cml.element.CMLMolecule;
-
-import java.io.File;
-import java.io.IOException;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
-
-/**
- * @author Sam Adams
- */
-public class ImageGeneratorMocker {
-
-    public static ImageGenerator mockImageGenerator() throws IOException {
-        final ImageGenerator imageGenerator = mock(ImageGenerator.class);
-
-        doAnswer(new Answer() {
-            @Override
-            public Object answer(final InvocationOnMock invocation) throws Throwable {
-                final File imageFile = (File) invocation.getArguments()[1];
-                final File thumbnailFile = (File) invocation.getArguments()[2];
-                imageFile.createNewFile();
-                thumbnailFile.createNewFile();
-                return null;
-            }
-        }).when(imageGenerator).createImages(any(CMLMolecule.class), any(File.class), any(File.class));
-        return imageGenerator;
-    }
-
-}

File chemistry-import-testutils/src/main/java/net/chempound/chemistry/testutil/ImageGeneratorStubber.java

+package net.chempound.chemistry.testutil;
+
+import net.chempound.chemistry.ImageGenerator;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+import org.xmlcml.cml.element.CMLMolecule;
+
+import java.io.File;
+import java.io.IOException;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+
+/**
+ * @author Sam Adams
+ */
+public class ImageGeneratorStubber {
+
+    public static ImageGenerator stubImageGenerator() throws IOException {
+        final ImageGenerator imageGenerator = mock(ImageGenerator.class);
+
+        doAnswer(new Answer() {
+            @Override
+            public Object answer(final InvocationOnMock invocation) throws Throwable {
+                final File imageFile = (File) invocation.getArguments()[1];
+                final File thumbnailFile = (File) invocation.getArguments()[2];
+                imageFile.createNewFile();
+                thumbnailFile.createNewFile();
+                return null;
+            }
+        }).when(imageGenerator).createImages(any(CMLMolecule.class), any(File.class), any(File.class));
+        return imageGenerator;
+    }
+
+}