浏览代码

Organisation command

Andrew Grant 6 月之前
父节点
当前提交
a14b3fbe9a

+ 22 - 0
src/main/java/scot/carricksoftware/grants/commands/places/organisations/OrganisationCommand.java

@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 11/03/2025, 17:17. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.commands.places.organisations;
+
+public interface OrganisationCommand {
+
+    Long getId();
+
+    void setId(Long id);
+
+    @SuppressWarnings("unused")
+    String getName();
+
+    @SuppressWarnings("unused")
+    void setName(String name);
+
+}
+
+

+ 37 - 0
src/main/java/scot/carricksoftware/grants/commands/places/organisations/OrganisationCommandImpl.java

@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 11/03/2025, 17:17. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.commands.places.organisations;
+
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class OrganisationCommandImpl implements OrganisationCommand {
+
+    private Long id;
+
+    private String name;
+
+    @Override
+    public Long getId() {
+        return id;
+    }
+
+    @Override
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 3 - 3
src/main/java/scot/carricksoftware/grants/domains/Organisation.java → src/main/java/scot/carricksoftware/grants/domains/places/Organisation.java

@@ -1,9 +1,9 @@
 /*
- * Copyright (c)  02 Feb 2025, Andrew Grant of Carrick Software .
- * All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
  */
 
-package scot.carricksoftware.grants.domains;
+package scot.carricksoftware.grants.domains.places;
 
 
 import jakarta.persistence.Column;

+ 4 - 6
src/test/java/scot/carricksoftware/grants/commands/countries/CountryCensusCommandTest.java → src/test/java/scot/carricksoftware/grants/commands/places/countries/CountryCommandTest.java

@@ -1,14 +1,12 @@
 /*
- * Copyright (c)  19 Feb 2025, Andrew Grant of Carrick Software .
- * All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
  */
 
-package scot.carricksoftware.grants.commands.countries;
+package scot.carricksoftware.grants.commands.places.countries;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import scot.carricksoftware.grants.commands.places.countries.CountryCommand;
-import scot.carricksoftware.grants.commands.places.countries.CountryCommandImpl;
 import scot.carricksoftware.grants.domains.places.Region;
 
 import java.util.ArrayList;
@@ -20,7 +18,7 @@ import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLo
 import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomRegion;
 
 
-class CountryCensusCommandTest {
+class CountryCommandTest {
 
     CountryCommand command;
 

+ 49 - 0
src/test/java/scot/carricksoftware/grants/commands/places/organisations/OrganisationCommandTest.java

@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.commands.places.organisations;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+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 OrganisationCommandTest {
+
+    private OrganisationCommand command;
+
+    @BeforeEach
+    void setUp() {
+        command = new OrganisationCommandImpl();
+    }
+
+    @Test
+    public void getIdTest() {
+        assertNull(command.getId());
+    }
+
+    @Test
+    public void setIdTest() {
+        Long Id = GetRandomLong();
+        command.setId(Id);
+        assertEquals(Id, command.getId());
+    }
+
+    @Test
+    public void getNameTest() {
+        assertNull(command.getName());
+    }
+
+    @Test
+    public void setNameTest() {
+        String name = GetRandomString();
+        command.setName(name);
+        assertEquals(name, command.getName());
+    }
+}

+ 2 - 4
src/test/java/scot/carricksoftware/grants/commands/places/PlaceCommandTest.java → src/test/java/scot/carricksoftware/grants/commands/places/places/PlaceCommandTest.java

@@ -1,9 +1,9 @@
 /*
- * Copyright (c) Andrew Grant of Carrick Software 11/03/2025, 17:52. All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
  *
  */
 
-package scot.carricksoftware.grants.commands.places;
+package scot.carricksoftware.grants.commands.places.places;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -16,8 +16,6 @@ import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLo
 import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomRegion;
 import static scot.carricksoftware.grants.GenerateRandomTextValues.GetRandomPlaceText;
 
-import scot.carricksoftware.grants.commands.places.places.PlaceCommand;
-import scot.carricksoftware.grants.commands.places.places.PlaceCommandImpl;
 import scot.carricksoftware.grants.domains.census.Census;
 import scot.carricksoftware.grants.domains.images.PlaceImage;
 import scot.carricksoftware.grants.domains.places.Region;

+ 2 - 4
src/test/java/scot/carricksoftware/grants/commands/regions/RegionCensusCommandTest.java → src/test/java/scot/carricksoftware/grants/commands/places/regions/RegionCensusCommandTest.java

@@ -1,14 +1,12 @@
 /*
- * Copyright (c) Andrew Grant of Carrick Software 11/03/2025, 17:53. All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
  *
  */
 
-package scot.carricksoftware.grants.commands.regions;
+package scot.carricksoftware.grants.commands.places.regions;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import scot.carricksoftware.grants.commands.places.regions.RegionCommand;
-import scot.carricksoftware.grants.commands.places.regions.RegionCommandImpl;
 import scot.carricksoftware.grants.domains.places.Country;
 
 

+ 1 - 1
src/test/java/scot/carricksoftware/grants/domains/OrganisationTest.java → src/test/java/scot/carricksoftware/grants/domains/places/OrganisationTest.java

@@ -3,7 +3,7 @@
  *
  */
 
-package scot.carricksoftware.grants.domains;
+package scot.carricksoftware.grants.domains.places;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;