package com.pgf.mqspring.component.impl; import static org.junit.jupiter.api.Assertions.*; 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 CharacterCodeConverterComponentImplTest08 { @Mock TelegramInfoComponent telegramInfoComponent; @InjectMocks CharacterCodeConverterComponentImpl target; @BeforeEach void beforeEacn() { MockitoAnnotations.openMocks(this); } @Test void encodeStringData01() { byte[] expected = { -15 }; assertArrayEquals(expected, ReflectionTestUtils.invokeMethod(CharacterCodeConverterComponentImpl.class, "encodeStringData", "111", 1, true)); } @Test void encodeStringData02() { byte[] expected = { -15 }; assertArrayEquals(expected, ReflectionTestUtils.invokeMethod(CharacterCodeConverterComponentImpl.class, "encodeStringData", "111", 1, false)); } @Test void encodeStringData03() { byte[] expected = { -15, -15, -15 }; assertArrayEquals(expected, ReflectionTestUtils.invokeMethod(CharacterCodeConverterComponentImpl.class, "encodeStringData", "111", 3, true)); } @Test void encodeStringData04() { byte[] expected = { -15, -15, -15, 64, 64 }; assertArrayEquals(expected, ReflectionTestUtils.invokeMethod(CharacterCodeConverterComponentImpl.class, "encodeStringData", "111", 5, true)); } @Test void encodeStringData05() { byte[] expected = { -15, -15, -15, 64, 64 }; assertArrayEquals(expected, ReflectionTestUtils.invokeMethod(CharacterCodeConverterComponentImpl.class, "encodeStringData", "111", 5, false)); } }