registered module in SettingsJsonTest

This commit is contained in:
Jan-Peter Klein 2024-04-29 11:12:14 +02:00
parent b16f32ca83
commit 08f81b7df4
No known key found for this signature in database
GPG Key ID: 90EDA3A7C822FD0E

View File

@ -3,6 +3,7 @@ package org.cryptomator.common.settings;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.hamcrest.MatcherAssert;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@ -68,7 +69,7 @@ public class SettingsJsonTest {
jsonObj.theme = UiTheme.DARK;
jsonObj.showTrayIcon = false;
var jsonStr = new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(jsonObj);
var jsonStr = new ObjectMapper().registerModule(new JavaTimeModule()).writerWithDefaultPrettyPrinter().writeValueAsString(jsonObj);
MatcherAssert.assertThat(jsonStr, containsString("\"theme\" : \"DARK\""));
MatcherAssert.assertThat(jsonStr, containsString("\"showTrayIcon\" : false"));