@Test public void create_first_characteristic() { when(dao.selectMaxCharacteristicOrder(session)).thenReturn(0); DefaultDebtCharacteristic result = (DefaultDebtCharacteristic) service.create("Portability", null); assertThat(result.id()).isEqualTo(currentId); assertThat(result.key()).isEqualTo("PORTABILITY"); assertThat(result.name()).isEqualTo("Portability"); assertThat(result.order()).isEqualTo(1); assertThat(result.createdAt()).isEqualTo(now); }
@Test public void create_sub_characteristic() { when(dao.selectById(1, session)).thenReturn(characteristicDto); DefaultDebtCharacteristic result = (DefaultDebtCharacteristic) service.create("Compilation name", 1); assertThat(result.id()).isEqualTo(currentId); assertThat(result.key()).isEqualTo("COMPILATION_NAME"); assertThat(result.name()).isEqualTo("Compilation name"); assertThat(result.parentId()).isEqualTo(1); assertThat(result.createdAt()).isEqualTo(now); }