mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-09-13 00:14:56 +00:00
Address PR review feedback
This commit is contained in:
@@ -28,14 +28,14 @@ public class PdfViewerCompatibilityTests {
|
||||
|
||||
@Test
|
||||
void shouldOpenPdfPreviewWithThumbnailSidebarByDefault() throws IOException {
|
||||
String pdfTemplate = readWebResource("/web/pdf.ftl");
|
||||
String pdfTemplate = readResource("/web/pdf.ftl");
|
||||
|
||||
assertTrue(pdfTemplate.contains("#page=1&pagemode=thumbs"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldPreferPdfForOfficePreviewByDefault() throws IOException {
|
||||
String properties = readConfigResource("/application.properties");
|
||||
String properties = readResource("/application.properties");
|
||||
|
||||
assertTrue(properties.contains("office.preview.type = ${KK_OFFICE_PREVIEW_TYPE:pdf}"));
|
||||
}
|
||||
@@ -46,18 +46,4 @@ public class PdfViewerCompatibilityTests {
|
||||
return new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
|
||||
private String readWebResource(String resourcePath) throws IOException {
|
||||
try (InputStream inputStream = getClass().getResourceAsStream(resourcePath)) {
|
||||
assertNotNull(inputStream);
|
||||
return new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
|
||||
private String readConfigResource(String resourcePath) throws IOException {
|
||||
try (InputStream inputStream = getClass().getResourceAsStream(resourcePath)) {
|
||||
assertNotNull(inputStream);
|
||||
return new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user