Device { @JsonIgnore public boolean isEnabled() { return Optional.ofNullable(enabled).orElse(true); } Device();  Device(final Device other); Device setEnabled(final Boolean enabled); @JsonIgnore boolean isEnabled(); Device setExtensions(final Map<String, Object> extensions); Device putExtension(final String key, final Object value); Map<String, Object> getExtensions(); Device setDefaults(final Map<String, Object> defaults); Map<String, Object> getDefaults(); List<String> getVia(); Device setVia(final List<String> via); List<String> getViaGroups(); Device setViaGroups(final List<String> viaGroups); List<String> getMemberOf(); Device setMemberOf(final List<String> memberOf); Device setMapper(final String mapper); String getMapper();  }
@Test public void testDecodeDefault() { final var device = Json.decodeValue("{}", Device.class); assertThat(device).isNotNull(); assertThat(device.isEnabled()); }
@Test public void testDecodeDisabled() { final var device = Json.decodeValue("{\"enabled\": false}", Device.class); assertThat(device).isNotNull(); assertThat(device.isEnabled()).isFalse(); }
@Test public void testDecodeEnabled() { final var device = Json.decodeValue("{\"enabled\": true}", Device.class); assertThat(device).isNotNull(); assertThat(device.isEnabled()); }