JdbcParamVersionRepository implements ParamVersionRepository, InitializableComponent { @Override public Long versionOfParam(String paramName) { if (!hasVersionOfParam(paramName)) { return null; } SelectQuery query = QueryFactory.select("version").from(configuration.entityName()).where("name = :name") .withArgument("name", paramName); return queryRunner.queryUnique(query, new LongMapper()); } JdbcParamVersionRepository(ParamVersionSchemaCreator schemaCreator,
                                      JdbcConfig configuration,
                                      SimpleQueryRunner queryRunner,
                                      TransactionRunner transactionRunner); @Override void initialize(); @Override Long incrementVersion(final String paramName); @Override Long versionOfParam(String paramName); @Override Map<String, Long> versionOfAllParams();  }
@Test public void shouldReturnNullAsVersionOfNonexistentParam() { JdbcParamVersionRepository versionRepository = get(JdbcParamVersionRepository.class); Long nonexistentParam = versionRepository.versionOfParam("someParam"); assertThat(nonexistentParam).isNull(); }