InternalSchemaConfig { public abstract Optional<Integer> targetTransactionsSchemaVersion();  abstract Optional<Integer> targetTransactionsSchemaVersion(); @Value.Check void check();  }
@Test public void canCreateConfigWithRecognisedSchemaVersions() { for (int version : TransactionConstants.SUPPORTED_TRANSACTIONS_SCHEMA_VERSIONS) { assertThatCode(() -> ImmutableInternalSchemaConfig.builder() .targetTransactionsSchemaVersion(version) .build()).doesNotThrowAnyException(); } }
@Test public void throwsIfCreatingConfigWithUnrecognizedSchemaVersions() { assertThatThrownBy(() -> ImmutableInternalSchemaConfig.builder() .targetTransactionsSchemaVersion(Integer.MIN_VALUE) .build()) .isInstanceOf(IllegalStateException.class) .hasMessageContaining("is not a recognised transactions schema version"); }