@Test
public void testCommitMetrics() {

    List<Serializable> messages = Arrays.asList(
            new ArrayList<>(Arrays.asList(TestUtils.createMetric())),
            new ArrayList<>(Arrays.asList(TestUtils.createMetric()))
    );
    when(mqService.dequeue(eq(MQService.MQQueue.METRIC.getQueueName()), any(CollectionType.class), anyInt(), anyInt())).thenReturn(messages);
    assertEquals(2, collectionService.commitMetrics(2, 60000).size());
}