use of org.icgc.dcc.song.server.model.entity.Specimen in project SONG by overture-stack.
the class SpecimenServiceTest method testCreateAndDeleteSpecimen.
@Test
public void testCreateAndDeleteSpecimen() {
val donorId = "DO2";
Specimen s = Specimen.create("", "Specimen 101 Ipsilon Prime", donorId, "Tumour", "Cell line - derived from tumour");
s.setInfo(JsonUtils.fromSingleQuoted("{'ageCategory': 42, 'status': 'deceased'}"));
val status = specimenService.create(DEFAULT_STUDY_ID, s);
val id = s.getSpecimenId();
assertThat(id).startsWith("SP");
Assertions.assertThat(status).isEqualTo(id);
val check = specimenService.read(id);
assertThat(s).isEqualToComparingFieldByField(check);
val response = specimenService.delete(newArrayList(id));
assertThat(specimenService.isSpecimenExist(id)).isFalse();
assertThat(response).isEqualTo("OK");
}
Aggregations