forked from kimhyungsik/ax_hub_mcp_tool
docs: README 현행화 및 고아 테스트 제거
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
package io.shinhanlife.dap.mcc.presentation;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
class DtoExcelDownloadControllerTest {
|
||||
|
||||
private final DtoExcelDownloadController controller = new DtoExcelDownloadController();
|
||||
|
||||
@Test
|
||||
void downloadsBothOnild0320Variants() throws Exception {
|
||||
assertWorkbook("ONILD0320_I", "csNo");
|
||||
assertWorkbook("ONILD0320_O", "notiDt");
|
||||
}
|
||||
|
||||
private void assertWorkbook(String dtoName, String expectedField) throws Exception {
|
||||
ResponseEntity<byte[]> response = controller.download(dtoName);
|
||||
|
||||
assertThat(response.getStatusCode().is2xxSuccessful()).isTrue();
|
||||
assertThat(response.getBody()).isNotNull();
|
||||
try (XSSFWorkbook workbook = new XSSFWorkbook(new ByteArrayInputStream(response.getBody()))) {
|
||||
assertThat(workbook.getSheetAt(0))
|
||||
.anySatisfy(row -> assertThat(row)
|
||||
.anySatisfy(cell -> assertThat(cell.toString()).isEqualTo(expectedField)));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user