Skip to content

Commit

Permalink
Fix Genomic processor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Mar 27, 2024
1 parent 02a8506 commit 5325ac0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ public void setup() {
public void getPatientMask_validResponses_returnMerged() {
DistributableQuery distributableQuery = new DistributableQuery();
when(mockProcessor1.getPatientMask(distributableQuery)).thenReturn(Mono.just(new VariantMaskBitmaskImpl(new BigInteger("11011011", 2))));
when(mockProcessor1.getPatientIds()).thenReturn(List.of("1", "2", "3", "4"));
when(mockProcessor2.getPatientMask(distributableQuery)).thenReturn(Mono.just(new VariantMaskBitmaskImpl(new BigInteger("110001100011", 2))));
when(mockProcessor2.getPatientIds()).thenReturn(List.of("5", "6", "7", "8", "9", "10", "11", "12"));
when(mockProcessor3.getPatientMask(distributableQuery)).thenReturn(Mono.just(new VariantMaskBitmaskImpl(new BigInteger("11000111", 2))));
when(mockProcessor3.getPatientIds()).thenReturn(List.of("15", "16", "17", "18"));
VariantMask patientMask = patientMergingParent.getPatientMask(distributableQuery).block();
VariantMask expectedPatientMask = new VariantMaskBitmaskImpl(new BigInteger("11000100011000011011", 2));
assertEquals(expectedPatientMask, patientMask);
Expand All @@ -51,8 +54,11 @@ public void getPatientMask_validResponses_returnMerged() {
public void getPatientMask_noPatientResponses_returnMerged() {
DistributableQuery distributableQuery = new DistributableQuery();
when(mockProcessor1.getPatientMask(distributableQuery)).thenReturn(Mono.just(new VariantMaskBitmaskImpl(new BigInteger("11011011", 2))));
when(mockProcessor1.getPatientIds()).thenReturn(List.of("1", "2", "3", "4"));
when(mockProcessor2.getPatientMask(distributableQuery)).thenReturn(Mono.just(new VariantMaskBitmaskImpl(new BigInteger("110000000011", 2))));
when(mockProcessor2.getPatientIds()).thenReturn(List.of("5", "6", "7", "8", "9", "10", "11", "12"));
when(mockProcessor3.getPatientMask(distributableQuery)).thenReturn(Mono.just(new VariantMaskBitmaskImpl(new BigInteger("11000011", 2))));
when(mockProcessor3.getPatientIds()).thenReturn(List.of("15", "16", "17", "18"));
VariantMask patientMask = patientMergingParent.getPatientMask(distributableQuery).block();
VariantMask expectedPatientMask = new VariantMaskBitmaskImpl(new BigInteger("11000000000000011011", 2));
assertEquals(expectedPatientMask, patientMask);
Expand All @@ -62,8 +68,11 @@ public void getPatientMask_noPatientResponses_returnMerged() {
public void getPatientMask_emptyResponses_returnMerged() {
DistributableQuery distributableQuery = new DistributableQuery();
when(mockProcessor1.getPatientMask(distributableQuery)).thenReturn(Mono.just(new VariantMaskBitmaskImpl(new BigInteger("11011011", 2))));
when(mockProcessor1.getPatientIds()).thenReturn(List.of("1", "2", "3", "4"));
when(mockProcessor2.getPatientMask(distributableQuery)).thenReturn(Mono.just(new VariantMaskBitmaskImpl(new BigInteger("1111", 2))));
when(mockProcessor2.getPatientIds()).thenReturn(List.of());
when(mockProcessor3.getPatientMask(distributableQuery)).thenReturn(Mono.just(new VariantMaskBitmaskImpl(new BigInteger("11000111", 2))));
when(mockProcessor3.getPatientIds()).thenReturn(List.of("5", "6", "7", "8"));
VariantMask patientMask = patientMergingParent.getPatientMask(distributableQuery).block();
VariantMask expectedPatientMask = new VariantMaskBitmaskImpl(new BigInteger("110001011011", 2));
assertEquals(expectedPatientMask, patientMask);
Expand Down

0 comments on commit 5325ac0

Please sign in to comment.