Jelajahi Sumber

Death Certificate converter call military converter test

Andrew Grant 4 bulan lalu
induk
melakukan
e5ffa32d26

+ 39 - 0
src/test/java/scot/carricksoftware/grants/converters/certificates/deathcertificates/DeathCertificateCommandCallsMilitaryConverterTest.java

@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.deathcertificates;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommand;
+import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommandImpl;
+import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
+
+import static org.mockito.Mockito.verify;
+
+@ExtendWith(MockitoExtension.class)
+class DeathCertificateCommandCallsMilitaryConverterTest {
+
+    private DeathCertificateCommandConverter converter;
+    private DeathCertificateCommand deathCertificateCommand;
+
+    @Mock
+    private DeathCertificateCommandMilitaryConverter deathCertificateCommandMilitaryConverterMock;
+
+    @BeforeEach
+    void setUp() {
+        converter = new DeathCertificateCommandConverterImpl(deathCertificateCommandMilitaryConverterMock);
+        deathCertificateCommand = new DeathCertificateCommandImpl();
+    }
+
+    @Test
+    void converterTest() {
+        DeathCertificate deathCertificate  = converter.convert(deathCertificateCommand);
+        verify(deathCertificateCommandMilitaryConverterMock).convert(deathCertificateCommand, deathCertificate);
+    }
+}

+ 39 - 0
src/test/java/scot/carricksoftware/grants/converters/certificates/deathcertificates/DeathCertificateConverterCallsMilitaryConverterTest.java

@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 24/03/2025, 19:02. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.deathcertificates;
+
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommand;
+import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
+
+import static org.mockito.Mockito.verify;
+
+@ExtendWith(MockitoExtension.class)
+class DeathCertificateConverterCallsMilitaryConverterTest {
+
+    private DeathCertificateConverter converter;
+    private DeathCertificate deathCertificate;
+
+    @Mock
+    private DeathCertificateMilitaryConverter militaryConverterMock;
+
+    @BeforeEach
+    void setUp() {
+        converter = new DeathCertificateConverterImpl(militaryConverterMock);
+        deathCertificate = new DeathCertificate();
+    }
+
+    @Test
+    void militaryConverterIsCalledTest() {
+         DeathCertificateCommand deathCertificateCommand =  converter.convert(deathCertificate);
+        verify(militaryConverterMock).convert(deathCertificate, deathCertificateCommand);
+    }
+}