Package org.baeldung.jackson.dtos.withEnum

Examples of org.baeldung.jackson.dtos.withEnum.MyDtoWithEnumCustom


    // tests - enum with custom serializer

    @Test
    public final void givenCustomSerializer_whenSerializingEntityWithEnum_thenCorrect() throws JsonParseException, IOException {
        final ObjectMapper mapper = new ObjectMapper();
        final String enumAsString = mapper.writeValueAsString(new MyDtoWithEnumCustom("a", 1, true, TypeEnumWithCustomSerializer.TYPE1));

        System.out.println(enumAsString);
        assertThat(enumAsString, containsString("\"name\":\"Type A\""));
    }
View Full Code Here

TOP

Related Classes of org.baeldung.jackson.dtos.withEnum.MyDtoWithEnumCustom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.