From 2b9ef71aa030f9015da8bf0b956faf2aa1d626d4 Mon Sep 17 00:00:00 2001 From: HoussemNasri Date: Mon, 9 Dec 2024 18:18:22 +0100 Subject: [PATCH] [ISSUE-1254] Add unit test to PublicAssetSerializerTest --- .../jmap/json/PublicAssetSerializerTest.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tmail-backend/jmap/extensions/src/test/scala/com/linagora/tmail/james/jmap/json/PublicAssetSerializerTest.scala b/tmail-backend/jmap/extensions/src/test/scala/com/linagora/tmail/james/jmap/json/PublicAssetSerializerTest.scala index c2fec7f5f4..4079b35260 100644 --- a/tmail-backend/jmap/extensions/src/test/scala/com/linagora/tmail/james/jmap/json/PublicAssetSerializerTest.scala +++ b/tmail-backend/jmap/extensions/src/test/scala/com/linagora/tmail/james/jmap/json/PublicAssetSerializerTest.scala @@ -135,6 +135,20 @@ class PublicAssetSerializerTest { .isTrue } + @Test + def deserializeCreationRequestShouldFailWhenUnknownPropertySpecified(): Unit = { + val jsInput: JsValue = Json.parse( + """{ + | "blobId": "1234", + | "unknown": "something" + |}""".stripMargin) + + val deserializeResult: JsResult[PublicAssetSetCreationRequest] = PublicAssetSerializer.deserializePublicAssetSetCreationRequest(jsInput) + + assertThat(deserializeResult.isError) + .isTrue + } + @Test def serializePublicAssetSetResponseShouldSucceed(): Unit = { val response = PublicAssetSetResponse(