Skip to content

Commit

Permalink
More treatment manager tests;
Browse files Browse the repository at this point in the history
  • Loading branch information
gthea committed Sep 5, 2023
1 parent 894d98a commit b6592e6
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,4 +439,40 @@ public void getTreatmentsWithConfigByFlagSetsRecordsTelemetry() {

verify(mTelemetryStorageProducer).recordLatency(eq(Method.TREATMENTS_WITH_CONFIG_BY_FLAG_SETS), anyLong());
}

@Test
public void getTreatmentsByFlagSetExceptionIsRecordedInTelemetry() {
when(mSplitsStorage.getNamesByFlagSets(any())).thenThrow(new RuntimeException("test"));

mTreatmentManager.getTreatmentsByFlagSet("set_1", null, false);

verify(mTelemetryStorageProducer).recordException(eq(Method.TREATMENTS_BY_FLAG_SET));
}

@Test
public void getTreatmentsByFlagSetsExceptionIsRecordedInTelemetry() {
when(mSplitsStorage.getNamesByFlagSets(any())).thenThrow(new RuntimeException("test"));

mTreatmentManager.getTreatmentsByFlagSets(Arrays.asList("set_1", "set_2"), null, false);

verify(mTelemetryStorageProducer).recordException(eq(Method.TREATMENTS_BY_FLAG_SETS));
}

@Test
public void getTreatmentsWithConfigByFlagSetExceptionIsRecordedInTelemetry() {
when(mSplitsStorage.getNamesByFlagSets(any())).thenThrow(new RuntimeException("test"));

mTreatmentManager.getTreatmentsWithConfigByFlagSet("set_1", null, false);

verify(mTelemetryStorageProducer).recordException(eq(Method.TREATMENTS_WITH_CONFIG_BY_FLAG_SET));
}

@Test
public void getTreatmentsWithConfigByFlagSetsExceptionIsRecordedInTelemetry() {
when(mSplitsStorage.getNamesByFlagSets(any())).thenThrow(new RuntimeException("test"));

mTreatmentManager.getTreatmentsWithConfigByFlagSets(Arrays.asList("set_1", "set_2"), null, false);

verify(mTelemetryStorageProducer).recordException(eq(Method.TREATMENTS_WITH_CONFIG_BY_FLAG_SETS));
}
}

0 comments on commit b6592e6

Please sign in to comment.