Skip to content

Commit

Permalink
Adjust unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdedude committed Jan 12, 2022
1 parent 5e57c9e commit 73e525b
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions driver/src/test/java/org/neo4j/driver/TransactionConfigTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,6 @@ void emptyConfigShouldHaveNoMetadata()
assertEquals( emptyMap(), TransactionConfig.empty().metadata() );
}

@Test
void shouldDisallowNullTimeout()
{
assertThrows( NullPointerException.class, () -> TransactionConfig.builder().withTimeout( null ) );
}

@Test
void shouldDisallowZeroTimeout()
{
assertThrows( IllegalArgumentException.class, () -> TransactionConfig.builder().withTimeout( Duration.ZERO ) );
}

@Test
void shouldDisallowNegativeTimeout()
{
Expand Down Expand Up @@ -98,6 +86,26 @@ void shouldHaveTimeout()
assertEquals( Duration.ofSeconds( 3 ), config.timeout() );
}

@Test
void shouldAllowDefaultTimeout()
{
TransactionConfig config = TransactionConfig.builder()
.withTimeout( TransactionConfig.Builder.SERVER_DEFAULT_TIMEOUT )
.build();

assertNull( config.timeout() );
}

@Test
void shouldAllowZeroTimeout()
{
TransactionConfig config = TransactionConfig.builder()
.withTimeout( Duration.ZERO )
.build();

assertEquals( Duration.ZERO, config.timeout() );
}

@Test
void shouldHaveMetadata()
{
Expand Down

0 comments on commit 73e525b

Please sign in to comment.