@Test
 public void shouldProduceAnsiSQLStrategy() throws Exception {
   strategyProducer.strategyClass =
       "uk.gov.justice.services.event.buffer.core.service.AnsiSQLBasedBufferInitialisationStrategy";
   assertThat(
       strategyProducer.bufferInitialisationStrategy(),
       instanceOf(AnsiSQLBasedBufferInitialisationStrategy.class));
 }
  @Test
  public void shouldThrowExceptionIfClassDoesNotExist() {
    strategyProducer.strategyClass =
        "uk.gov.justice.services.event.buffer.core.service.SomeUnknowClazzz";

    exception.expect(IllegalArgumentException.class);
    exception.expectMessage("Could not instantiate buffer initialisation strategy");

    strategyProducer.bufferInitialisationStrategy();
  }
 @Test
 public void shouldPassRepositoryToAnsiStrategy() throws Exception {
   strategyProducer.strategyClass =
       "uk.gov.justice.services.event.buffer.core.service.AnsiSQLBasedBufferInitialisationStrategy";
   final BufferInitialisationStrategy bufferInitialisationStrategy =
       strategyProducer.bufferInitialisationStrategy();
   final UUID streamId = UUID.randomUUID();
   when(streamStatusRepository.findByStreamId(streamId))
       .thenReturn(Optional.of(new StreamStatus(streamId, 0L)));
   bufferInitialisationStrategy.initialiseBuffer(streamId);
   verify(streamStatusRepository).findByStreamId(streamId);
 }