package com.pgf.mqspring.component.impl; import static org.junit.jupiter.api.Assertions.*; import java.io.UnsupportedEncodingException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.springframework.test.util.ReflectionTestUtils; import com.pgf.mqspring.component.TelegramInfoComponent; class CharacterCodeConverterComponentImplTest09 { @Mock TelegramInfoComponent telegramInfoComponent; @InjectMocks CharacterCodeConverterComponentImpl target; @BeforeEach void beforeEacn() { MockitoAnnotations.openMocks(this); } @Test void decodeStringData01() { byte[] bytes = ReflectionTestUtils.invokeMethod(CharacterCodeConverterComponentImpl.class, "encodeEbcdicSisoNone", "テストデータ"); assertEquals("テストデータ", ReflectionTestUtils.invokeMethod(target, "decodeStringData", bytes, true)); } @Test void decodeStringData02() throws UnsupportedEncodingException { assertEquals("テストデータ", ReflectionTestUtils.invokeMethod(target, "decodeStringData", "テストデータ".getBytes("Cp930"), false)); } }