| | |
| | import java.io.File; |
| | +import java.io.IOException; |
| | import java.net.URI; |
| | import java.nio.file.Path; |
 |
| | import static com.keenwrite.constants.Constants.DOCUMENT_DEFAULT; |
| | import static java.lang.String.format; |
| | -import static org.junit.jupiter.api.Assertions.assertEquals; |
| | -import static org.junit.jupiter.api.Assertions.assertNotNull; |
| | +import static org.junit.jupiter.api.Assertions.*; |
| | |
| | /** |
 |
| | */ |
| | @Test |
| | - void test_ImageLookup_RelativePathWithExtension_ResolvedSuccessfully() { |
| | + void test_ImageLookup_RelativePathWithExtension_ResolvedSuccessfully() |
| | + throws IOException { |
| | final var resource = getResourcePath( PATH_KITTEN_PNG ); |
| | final var imagePath = new File( PATH_KITTEN_PNG ).toPath(); |
 |
| | final var parser = pBuilder.extensions( extensions ).build(); |
| | final var renderer = hBuilder.extensions( extensions ).build(); |
| | + final var file = root.resolve( subpath.resolve( imagePath ) ).toFile(); |
| | + file.deleteOnExit(); |
| | |
| | + assertTrue( file.createNewFile() ); |
| | assertNotNull( parser ); |
| | assertNotNull( renderer ); |
 |
| | assertEquals( expectedHtml, actualHtml ); |
| | } |
| | + |
| | + assertTrue( file.delete() ); |
| | } |
| | |