Examples of MyDtoSetter


Examples of org.baeldung.jackson.field.MyDtoSetter

    @Test
    public final void givenDifferentAccessLevels_whenSetterAdded_thenDeserializable() throws IOException {
        final String jsonAsString = "{\"intValue\":1}";
        final ObjectMapper mapper = new ObjectMapper();

        final MyDtoSetter dtoObject = mapper.readValue(jsonAsString, MyDtoSetter.class);

        assertNotNull(dtoObject);
        assertThat(dtoObject.alternativeGetIntValue(), equalTo(1));
    }
View Full Code Here

Examples of org.baeldung.jackson.field.MyDtoSetter

    @Test
    public final void givenDifferentAccessLevels_whenSetterAdded_thenStillNotSerializable() throws IOException {
        final ObjectMapper mapper = new ObjectMapper();

        final MyDtoSetter dtoObject = new MyDtoSetter();

        final String dtoAsString = mapper.writeValueAsString(dtoObject);
        assertThat(dtoAsString, not(containsString("intValue")));
        System.out.println(dtoAsString);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.