Search in sources :

Example 6 with PathAttributeDTO

use of com.robo4j.socket.http.dto.PathAttributeDTO in project robo4j by Robo4J.

the class ReflectUtilTests method createJsonByObjectMapCollection.

@Test
void createJsonByObjectMapCollection() {
    Throwable exception = assertThrows(RoboReflectException.class, () -> {
        Map<String, PathAttributeDTO> map = new HashMap<>();
        map.put("one", new PathAttributeDTO("one1", "1"));
        map.put("two", new PathAttributeDTO("two2", "2"));
        ReflectUtils.createJson(map);
    });
    assertTrue(exception.getMessage().startsWith("object getter value"));
}
Also used : HashMap(java.util.HashMap) PathAttributeDTO(com.robo4j.socket.http.dto.PathAttributeDTO) Test(org.junit.jupiter.api.Test)

Aggregations

PathAttributeDTO (com.robo4j.socket.http.dto.PathAttributeDTO)6 Test (org.junit.jupiter.api.Test)5 ClassGetSetDTO (com.robo4j.socket.http.dto.ClassGetSetDTO)2 PathAttributeListDTO (com.robo4j.socket.http.dto.PathAttributeListDTO)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 AttributeDescriptor (com.robo4j.AttributeDescriptor)1 RoboContext (com.robo4j.RoboContext)1 RoboReference (com.robo4j.RoboReference)1 SimpleLoggingUtil (com.robo4j.logging.SimpleLoggingUtil)1 StatusCode (com.robo4j.socket.http.enums.StatusCode)1 HttpDecoratedRequest (com.robo4j.socket.http.message.HttpDecoratedRequest)1 HttpRequestDenominator (com.robo4j.socket.http.message.HttpRequestDenominator)1 ServerContext (com.robo4j.socket.http.units.ServerContext)1 ServerPathConfig (com.robo4j.socket.http.units.ServerPathConfig)1 HttpPathUtils (com.robo4j.socket.http.util.HttpPathUtils)1 JsonUtil (com.robo4j.socket.http.util.JsonUtil)1 ReflectUtils (com.robo4j.socket.http.util.ReflectUtils)1 UTF8_SOLIDUS (com.robo4j.util.Utf8Constant.UTF8_SOLIDUS)1 List (java.util.List)1