Device { public Device setEnabled(final Boolean enabled) { this.enabled = enabled; return this; } 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 testEncodeEnabled() { final var device = new Device(); device.setEnabled(true); final var json = JsonObject.mapFrom(device); assertThat(json).isNotNull(); assertThat(json.getBoolean("enabled")).isTrue(); assertThat(json.getJsonObject("ext")).isNull(); }
@Test public void testEncodeDisabled() { final var device = new Device(); device.setEnabled(false); final var json = JsonObject.mapFrom(device); assertThat(json).isNotNull(); assertThat(json.getBoolean("enabled")).isFalse(); assertThat(json.getJsonObject("ext")).isNull(); }