@@ -917,4 +917,25 @@ void deserializationHandlesTypedLiteralsForTypedProperties() throws Exception {
917917 assertEquals (Set .of (true ), result .getProperties ().get (URI .create (
918918 "http://onto.fel.cvut.cz/ontologies/application/jb4jsonld/attribute/approved" )));
919919 }
920+
921+ @ Test
922+ void deserializationHandlesTypedLiteralsForUntypedProperties () throws Exception {
923+ final JsonArray input = readAndExpand ("objectWithTypedLiteralInProperties.json" );
924+ final Person result = sut .deserialize (input , Person .class );
925+ assertNotNull (result );
926+ assertEquals ("Catherine" , result .getFirstName ());
927+ assertEquals ("Halsey" , result .getLastName ());
928+ assertThat (result .getProperties (),
929+ hasKey ("http://onto.fel.cvut.cz/ontologies/application/jb4jsonld/attribute/warrantor" ));
930+ assertEquals (Set .of ("Lord Hood" ), result .getProperties ()
931+ .get ("http://onto.fel.cvut.cz/ontologies/application/jb4jsonld/attribute/warrantor" ));
932+ assertThat (result .getProperties (),
933+ hasKey ("http://onto.fel.cvut.cz/ontologies/application/jb4jsonld/attribute/revision-count" ));
934+ assertEquals (Set .of ("4" , "8" ), result .getProperties ()
935+ .get ("http://onto.fel.cvut.cz/ontologies/application/jb4jsonld/attribute/revision-count" ));
936+ assertThat (result .getProperties (),
937+ hasKey ("http://onto.fel.cvut.cz/ontologies/application/jb4jsonld/attribute/approved" ));
938+ assertEquals (Set .of ("true" ), result .getProperties ()
939+ .get ("http://onto.fel.cvut.cz/ontologies/application/jb4jsonld/attribute/approved" ));
940+ }
920941}
0 commit comments