TransactionConfig { public static Builder builder() { return new Builder(); } private  TransactionConfig( Builder builder ); static TransactionConfig empty(); static Builder builder(); Duration timeout(); Map<String,Value> metadata(); boolean isEmpty(); @Override boolean equals( Object o ); @Override int hashCode(); @Override String toString();  }
@Test void shouldDisallowNullTimeout() { assertThrows( NullPointerException.class, () -> TransactionConfig.builder().withTimeout( null ) ); }
@Test void shouldDisallowZeroTimeout() { assertThrows( IllegalArgumentException.class, () -> TransactionConfig.builder().withTimeout( Duration.ZERO ) ); }
@Test void shouldDisallowNegativeTimeout() { assertThrows( IllegalArgumentException.class, () -> TransactionConfig.builder().withTimeout( Duration.ofSeconds( -1 ) ) ); }
@Test void shouldDisallowNullMetadata() { assertThrows( NullPointerException.class, () -> TransactionConfig.builder().withMetadata( null ) ); }
@Test void shouldDisallowMetadataWithIllegalValues() { assertThrows( ClientException.class, () -> TransactionConfig.builder().withMetadata( singletonMap( "key", new InternalNode( 1 ) ) ) ); assertThrows( ClientException.class, () -> TransactionConfig.builder().withMetadata( singletonMap( "key", new InternalRelationship( 1, 1, 1, "" ) ) ) ); assertThrows( ClientException.class, () -> TransactionConfig.builder().withMetadata( singletonMap( "key", new InternalPath( new InternalNode( 1 ) ) ) ) ); }