    @Test
    public void getLastCommittedOffset_noConsumerCommit_failedToCommit() {

        when(consumer.committed(topicPartition)).thenReturn(null);
        partition.earliestBrokerOffset = 123L;
        doThrow(new KafkaException("unable to commit")).when(consumer).commitSync(anyMap());

        partition.getLastCommittedOffset();
        verify(consumer).commitSync(Collections.singletonMap(topicPartition, new OffsetAndMetadata(123L)));
        assertThat(logAppender.getLogs(),
                hasItem("Unable to commit reset offset 123 during initialization of partition " + topicPartition +
                        " for group my-group"));
    }