From 5ceb3db9caac5e0e89814157626831b0976aba61 Mon Sep 17 00:00:00 2001 From: jyj1289 Date: Fri, 6 Sep 2024 13:53:25 +0900 Subject: [PATCH] =?UTF-8?q?test(#119):=20GenerateProofOfApplicationUseCase?= =?UTF-8?q?SpringBootTest=20=EC=B6=94=EA=B0=80=20-=20GenerateProofOfApplic?= =?UTF-8?q?ationUseCaseSpringBootTest=EB=A5=BC=20=EC=9E=91=EC=84=B1?= =?UTF-8?q?=ED=96=88=EC=96=B4=EC=9A=94.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oofOfApplicationUseCaseSpringBootTest.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/test/java/com/bamdoliro/maru/application/form/GenerateProofOfApplicationUseCaseSpringBootTest.java diff --git a/src/test/java/com/bamdoliro/maru/application/form/GenerateProofOfApplicationUseCaseSpringBootTest.java b/src/test/java/com/bamdoliro/maru/application/form/GenerateProofOfApplicationUseCaseSpringBootTest.java new file mode 100644 index 00000000..3627f1ed --- /dev/null +++ b/src/test/java/com/bamdoliro/maru/application/form/GenerateProofOfApplicationUseCaseSpringBootTest.java @@ -0,0 +1,43 @@ +package com.bamdoliro.maru.application.form; + +import com.bamdoliro.maru.domain.form.domain.Form; +import com.bamdoliro.maru.domain.user.domain.User; +import com.bamdoliro.maru.infrastructure.persistence.form.FormRepository; +import com.bamdoliro.maru.infrastructure.persistence.user.UserRepository; +import com.bamdoliro.maru.shared.fixture.FormFixture; +import com.bamdoliro.maru.shared.fixture.UserFixture; +import com.bamdoliro.maru.shared.util.SaveFileUtil; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.transaction.annotation.Transactional; + +import java.io.IOException; + +@Disabled +@ActiveProfiles("test") +@SpringBootTest +public class GenerateProofOfApplicationUseCaseSpringBootTest { + + @Autowired + private GenerateProofOfApplicationUseCase generateProofOfApplicationUseCase; + + @Autowired + private FormRepository formRepository; + + @Autowired + private UserRepository userRepository; + + @Transactional + @Test + void 접수증을_저장한다() throws IOException { + User user = userRepository.save(UserFixture.createUser()); + Form form = FormFixture.createRandomForm(user); + form.submit(); + formRepository.save(form); + + SaveFileUtil.execute(generateProofOfApplicationUseCase.execute(user), SaveFileUtil.PDF); + } +}