assertThat(dto.getUpdatedAt()).isNotNull();
}
@Test
public void to_characteristic() throws Exception {
DefaultCharacteristic rootCharacteristic = new DefaultCharacteristic()
.setId(1)
.setKey("MEMORY_EFFICIENCY")
.setName("Memory use");
CharacteristicDto dto = new CharacteristicDto()
.setId(2)
.setParentId(1)
.setKey("EFFICIENCY")
.setName("Efficiency")
.setOrder(5)
.setEnabled(false)
.setCreatedAt(new Date())
.setUpdatedAt(new Date());
DefaultCharacteristic characteristic = dto.toCharacteristic(rootCharacteristic);
assertThat(characteristic.id()).isEqualTo(2);
assertThat(characteristic.parent()).isEqualTo(rootCharacteristic);
assertThat(characteristic.key()).isEqualTo("EFFICIENCY");
assertThat(characteristic.name()).isEqualTo("Efficiency");
assertThat(characteristic.order()).isEqualTo(5);
assertThat(characteristic.createdAt()).isNotNull();
assertThat(characteristic.updatedAt()).isNotNull();
}