refactor(metadata): replace Spring JSON processor with Jackson for leaner prod image (#905)
This commit is contained in:
+13
@@ -702,6 +702,19 @@ class EpubMetadataExtractorTest {
|
||||
assertThat(metadata.getMoods()).containsExactlyInAnyOrder("dark", "atmospheric");
|
||||
}
|
||||
|
||||
@Test
|
||||
void extractsMoodsFromUserMetadataArray() throws IOException {
|
||||
String json = """
|
||||
{"#moods": {"#value#": ["dark", "atmospheric"]}}""";
|
||||
String opf = wrapOpf("""
|
||||
<dc:title>Book</dc:title>
|
||||
<meta property="calibre:user_metadata">%s</meta>
|
||||
""".formatted(json));
|
||||
BookMetadata metadata = extractor.extractMetadata(createEpub(opf));
|
||||
|
||||
assertThat(metadata.getMoods()).containsExactlyInAnyOrder("dark", "atmospheric");
|
||||
}
|
||||
|
||||
@Test
|
||||
void extractsExtraTagsFromUserMetadata() throws IOException {
|
||||
String json = """
|
||||
|
||||
Reference in New Issue
Block a user