package com.pgf.mqspring.component.impl; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.*; import java.io.ByteArrayInputStream; import java.io.IOException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.springframework.test.util.ReflectionTestUtils; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.model.S3Object; import com.pgf.mqspring.component.MqSpringMessageSourceComponent; class TelegramInfoComponentImplTest04 { @Mock AmazonS3 s3Client; @Mock MqSpringMessageSourceComponent messageSource; TelegramInfoComponentImpl target; @BeforeEach void beforeEach() throws IOException { MockitoAnnotations.openMocks(this); S3Object s3Object = new S3Object(); s3Object.setObjectContent(new ByteArrayInputStream(new byte[0])); Mockito.when(s3Client.getObject(anyString(), anyString())).thenReturn(s3Object); target = new TelegramInfoComponentImpl(s3Client, messageSource, "", ""); } @Test void isTelegramInfoError01() { ReflectionTestUtils.setField(target, "isTelegramInfoError", true); assertTrue(target.isTelegramInfoError()); } }