Browse Source

Add appendixImage to commands

Andrew Grant 1 month ago
parent
commit
7255d66872

+ 38 - 0
src/main/java/scot/carricksoftware/grants/commands/images/AppendixImageCommand.java

@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 28/03/2025, 09:58. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.commands.images;
+
+import scot.carricksoftware.grants.domains.images.Image;
+
+public interface AppendixImageCommand {
+    Long getId();
+
+    void setId(Long id);
+
+    Image getImage();
+
+    void setImage(Image image);
+
+    String getLevel();
+
+    void setLevel(String level);
+
+    String getOrder();
+
+    void setOrder(String order);
+
+    String getCaption();
+
+    void setCaption(String caption);
+
+    String getHeight();
+
+    void setHeight(String height);
+
+    String getWidth();
+
+    void setWidth(String width);
+}

+ 91 - 0
src/main/java/scot/carricksoftware/grants/commands/images/AppendixImageCommandImpl.java

@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 28/03/2025, 09:59. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.commands.images;
+
+import org.springframework.stereotype.Component;
+import scot.carricksoftware.grants.domains.images.Image;
+
+@Component
+public class AppendixImageCommandImpl implements AppendixImageCommand{
+
+    private Long Id;
+    private Image image;
+    private String level;
+    private String order;
+    private String caption;
+    private String height;
+    private String width;
+
+    @Override
+    public Long getId() {
+        return Id;
+    }
+
+    @Override
+    public void setId(Long id) {
+        Id = id;
+    }
+
+    @Override
+    public Image getImage() {
+        return image;
+    }
+
+    @Override
+    public void setImage(Image image) {
+        this.image = image;
+    }
+
+    @Override
+    public String getLevel() {
+        return level;
+    }
+
+    @Override
+    public void setLevel(String level) {
+        this.level = level;
+    }
+
+    @Override
+    public String getOrder() {
+        return order;
+    }
+
+    @Override
+    public void setOrder(String order) {
+        this.order = order;
+    }
+
+    @Override
+    public String getCaption() {
+        return caption;
+    }
+
+    @Override
+    public void setCaption(String caption) {
+        this.caption = caption;
+    }
+
+    @Override
+    public String getHeight() {
+        return height;
+    }
+
+    @Override
+    public void setHeight(String height) {
+        this.height = height;
+    }
+
+    @Override
+    public String getWidth() {
+        return width;
+    }
+
+    @Override
+    public void setWidth(String width) {
+        this.width = width;
+    }
+}

+ 110 - 0
src/test/java/scot/carricksoftware/grants/commands/images/AppendixImageCommandTest.java

@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 28/03/2025, 09:54. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.commands.images;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grants.domains.images.Image;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
+
+class AppendixImageCommandTest {
+
+    private AppendixImageCommand command;
+
+    @BeforeEach
+    void setUp() {
+        command = new AppendixImageCommandImpl();
+    }
+
+    @Test
+    public void getIdTest() {
+        assertNull(command.getId());
+    }
+
+    @Test
+    public void setIdTest() {
+        Long id = GetRandomLong();
+        command.setId(id);
+        assertEquals(id, command.getId());
+    }
+
+    @Test
+    public void getCaptionTest() {
+        assertNull(command.getCaption());
+    }
+
+    @Test
+    public void setCaptionTest() {
+        String caption = GetRandomString();
+        command.setCaption(caption);
+        assertEquals(caption, command.getCaption());
+    }
+
+    @Test
+    public void getHeightTest() {
+        assertNull(command.getHeight());
+    }
+
+    @Test
+    public void setHeightTest() {
+        String height = GetRandomString();
+        command.setHeight(height);
+        assertEquals(height, command.getHeight());
+    }
+
+    @Test
+    public void getWidthTest() {
+        assertNull(command.getWidth());
+    }
+
+    @Test
+    public void setWidthTest() {
+        String width = GetRandomString();
+        command.setWidth(width);
+        assertEquals(width, command.getWidth());
+    }
+
+    @Test
+    public void getImageTest() {
+        assertNull(command.getImage());
+    }
+
+    @Test
+    public void setImageTest() {
+        Image image = new Image();
+        command.setImage(image);
+        assertEquals(image, command.getImage());
+    }
+
+    @Test
+    public void getOrderTest() {
+        assertNull(command.getOrder());
+    }
+
+    @Test
+    public void setOrderTest() {
+        String order = GetRandomString();
+        command.setOrder(order);
+        assertEquals(order, command.getOrder());
+    }
+
+    @Test
+    public void getLevelTest() {
+        assertNull(command.getLevel());
+    }
+
+    @Test
+    public void setLevelTest() {
+        String level = GetRandomString();
+        command.setLevel(level);
+        assertEquals(level, command.getLevel());
+    }
+
+}