Subnet implements Serializable { @JsonIgnore public String getId() { return id; }  String getName(); void setName(String name); @JsonIgnore boolean isEnableDHCP(); Boolean getEnableDHCP(); void setEnableDHCP(Boolean enableDHCP); String getNetworkId(); void setNetworkId(String networkId); String getTenantId(); void setTenantId(String tenantId); List<String> getDnsNames(); void setDnsNames(List<String> dnsNames); List<Pool> getList(); void setList(List<Pool> list); List<String> getHostRoutes(); void setHostRoutes(List<String> hostRoutes); IpVersion getIpversion(); void setIpversion(IpVersion ipversion); String getGw(); void setGw(String gw); String getCidr(); void setCidr(String cidr); @JsonIgnore String getId(); @JsonProperty void setId(String id); @Override String toString();  }
@Test public void testDeserializationReadOnlyFields() throws Exception { Subnet subnet = objectMapper.readValue(SUBNET_JSON, Subnet.class); assertThat(subnet.getId(), is(equalTo(ID))); }