package com.pgf.mqspring.component; import static org.junit.jupiter.api.Assertions.*; import java.io.IOException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import com.pgf.mqspring.constant.MqSpringMessageId; class MqSpringMessageSourceComponentTest01 { MqSpringMessageSourceComponent messageSource; @BeforeEach void beforeEach() throws IOException { messageSource = new MqSpringMessageSourceComponent("CDA"); messageSource.setBasename("com/pgf/mqspring/component/MqSpringMessageSourceComponentTest_01/messages"); } @Test void getMessage01() { assertEquals("[CDA] [SYS7005E]:テストメッセージ01", messageSource.getMessage(MqSpringMessageId.SYS7005E)); } @Test void getMessage02() { assertEquals("[CDA] [SYS7006E]:SYS7006Eの取得に失敗しました。", messageSource.getMessage(MqSpringMessageId.SYS7006E)); } @Test void getMessage03() { assertEquals("[CDA] [SYS7007E]:テストメッセージ03:1", messageSource.getMessage(MqSpringMessageId.SYS7007E, 1)); } @Test void getMessage04() { assertEquals("[CDA] [SYS7010E]:テストメッセージ04:1,2", messageSource.getMessage(MqSpringMessageId.SYS7010E, 1, 2)); } }