@Test
public void testSubmitMetric() {

    when(namespaceService.isPermitted(any(), any())).thenReturn(true);
    int metricCount = 60;
    List<Metric> metrics = new ArrayList<>(metricCount);
    for (int i = 0; i < metricCount; i++) {
        metrics.add(createMetricWithIncreasingResolution(1000, 2));
    }
    collectionService.submitMetrics(user, metrics);
    verify(monitorService).modifyCounter(MonitorService.Counter.DATAPOINT_WRITES, metricCount * 2, null);
    verify(wardenService).modifyPolicyCounter(user, WardenService.PolicyCounter.METRICS_PER_HOUR, metricCount);
    verify(wardenService).modifyPolicyCounter(user, WardenService.PolicyCounter.DATAPOINTS_PER_HOUR, metricCount * 2);
}