Skip to content

Commit

Permalink
Update unit tests for GENIE treatment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dippindots committed Jan 27, 2023
1 parent 9e01993 commit 86e7402
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,38 @@ public void getTreatmentAgentsByPatientId() {
}

@Test
public void getSamplesByPatientId() {
public void getSamplesByPatientIdWhenNoMatchingSamples() {
ClinicalEventSample clinicalEventSample = new ClinicalEventSample();
clinicalEventSample.setPatientId("TCGA-A1-A0SD");
clinicalEventSample.setSampleId("TCGA-A1-A0SD-01");
clinicalEventSample.setStudyId("study_tcga_pub");
clinicalEventSample.setTimeTaken(211);

HashMap<String, List<ClinicalEventSample>> expected = new HashMap<>();
expected.put("TCGA-A1-A0SD", Collections.singletonList(clinicalEventSample));


Map<String, List<ClinicalEventSample>> actual = treatmentRepository.getSamplesByPatientId(
Collections.singletonList("TCGA-A1-A0SD-01"),
Collections.singletonList("study_tcga_pub")
);

Assert.assertEquals(actual, expected);
}

@Test
public void getSamplesByPatientId() {
ClinicalEventSample clinicalEventSample = new ClinicalEventSample();
clinicalEventSample.setPatientId("TCGA-A1-A0SB");
clinicalEventSample.setSampleId("TCGA-A1-A0SB-01");
clinicalEventSample.setStudyId("study_tcga_pub");
clinicalEventSample.setTimeTaken(211);

HashMap<String, List<ClinicalEventSample>> expected = new HashMap<>();
expected.put("TCGA-A1-A0SB", Collections.singletonList(clinicalEventSample));

Map<String, List<ClinicalEventSample>> actual = treatmentRepository.getSamplesByPatientId(
Collections.singletonList("TCGA-A1-A0SB-01"),
Collections.singletonList("study_tcga_pub")
);

Assert.assertEquals(actual, expected);
}
Expand Down Expand Up @@ -140,7 +156,7 @@ public void getTreatmentCount() {

@Test
public void getSampleCount() {
Integer expected = 4;
Integer expected = 2;
Integer actual = treatmentRepository.getSampleCount(Collections.singletonList("study_tcga_pub"));

Assert.assertEquals(actual, expected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ INSERT INTO clinical_event (CLINICAL_EVENT_ID,PATIENT_ID,START_DATE,STOP_DATE,EV
INSERT INTO clinical_event_data (CLINICAL_EVENT_ID,KEY,VALUE) VALUES (1,'STATUS','radiographic_progression');
INSERT INTO clinical_event_data (CLINICAL_EVENT_ID,KEY,VALUE) VALUES (1,'SAMPLE_ID','TCGA-A1-A0SB-01');
INSERT INTO clinical_event_data (CLINICAL_EVENT_ID,KEY,VALUE) VALUES (2,'SURGERY','OA II Initial');
INSERT INTO clinical_event_data (CLINICAL_EVENT_ID,KEY,VALUE) VALUES (2,'SAMPLE_ID','TCGA-A1-A0SB-01');
INSERT INTO clinical_event_data (CLINICAL_EVENT_ID,KEY,VALUE) VALUES (3,'EVENT_TYPE_DETAILED','AA III Recurrence1');
INSERT INTO clinical_event_data (CLINICAL_EVENT_ID,KEY,VALUE) VALUES (3,'AGENT','Madeupanib');
INSERT INTO clinical_event_data (CLINICAL_EVENT_ID,KEY,VALUE) VALUES (3,'AGENT_TARGET','Directly to forehead, Elbow');
Expand Down

0 comments on commit 86e7402

Please sign in to comment.