Browse Source

Eliminate unused (3)

Andrew Grant 1 tháng trước cách đây
mục cha
commit
e30c6ac412

+ 0 - 2
src/main/java/scot/carricksoftware/grantswriter/controllers/IndexController.java

@@ -9,8 +9,6 @@ import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
 import scot.carricksoftware.grantswriter.constants.MappingConstants;
 
-@SuppressWarnings("unused")
-
 public interface IndexController {
 
     @SuppressWarnings("SameReturnValue")

+ 6 - 3
src/main/java/scot/carricksoftware/grantswriter/controllers/TexController.java

@@ -6,12 +6,15 @@
 package scot.carricksoftware.grantswriter.controllers;
 
 import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.PostMapping;
+import scot.carricksoftware.grantswriter.constants.MappingConstants;
 
 public interface TexController {
 
-    @SuppressWarnings({"SameReturnValue", "unused"})
+    @SuppressWarnings("SameReturnValue")
     String screen(Model model);
 
-    @SuppressWarnings({"SameReturnValue", "unused"})
-    String start(Model model) throws Exception;
+    @SuppressWarnings("SameReturnValue")
+    @PostMapping(MappingConstants.TEX)
+    String start() throws Exception;
 }

+ 1 - 1
src/main/java/scot/carricksoftware/grantswriter/controllers/TexControllerImpl.java

@@ -48,7 +48,7 @@ public class TexControllerImpl implements TexController {
 
     @PostMapping(MappingConstants.TEX)
     @Override
-    public String start(Model model) throws Exception {
+    public String start() throws Exception {
         logger.debug("FilesControllerImpl::start");
         texWriter.write(writerFiles.getLatexFileName());
 

+ 2 - 2
src/test/java/scot/carricksoftware/grantswriter/controllers/TexControllerTest.java

@@ -42,12 +42,12 @@ class TexControllerTest {
 
     @Test
     public void startReturnsTheCorrectView() throws Exception {
-        assertEquals("index", controller.start(modelMock));
+        assertEquals("index", controller.start());
     }
 
     @Test
     public void startReturnsCallsTexWriterWriteTest() throws Exception {
-        controller.start(modelMock);
+        controller.start();
         verify(texWriterMock).write(writerFilesMock.getLatexFileName());
     }