@Test
public void shouldReturnPreparedParameterWithIndexForCacheableParameter() {

    // given
    Level[] levels = new Level[]{
        level().withName("level").withMatcher("matcher").withLevelCreator("creator").withType("type").build(),
        level().withName("outputLevel").withType("type").build()
    };
    Parameter parameter = parameter().withName("param").withInputLevels(1).withArraySeparator('^')
            .withEntries().withLevels(levels).build();
    when(levelPreparer.prepare(any(Level.class))).thenReturn(preparedLevel().build()).thenReturn(preparedLevel().withName("outputLevel").build());
    // when
    PreparedParameter preparedParameter = paramPreparer.prepare(new ParameterFromRepository(parameter, RepositoryName.from("test")));
    // then
    assertThat(preparedParameter).hasName("param").hasInputLevels(1).hasArraySeparator('^').hasIndex()
            .hasLevelNameEntry("outputLevel", 0);
}