File tree Expand file tree Collapse file tree 1 file changed +20
-12
lines changed
driver/src/test/java/org/neo4j/driver Expand file tree Collapse file tree 1 file changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -51,18 +51,6 @@ void emptyConfigShouldHaveNoMetadata()
51
51
assertEquals ( emptyMap (), TransactionConfig .empty ().metadata () );
52
52
}
53
53
54
- @ Test
55
- void shouldDisallowNullTimeout ()
56
- {
57
- assertThrows ( NullPointerException .class , () -> TransactionConfig .builder ().withTimeout ( null ) );
58
- }
59
-
60
- @ Test
61
- void shouldDisallowZeroTimeout ()
62
- {
63
- assertThrows ( IllegalArgumentException .class , () -> TransactionConfig .builder ().withTimeout ( Duration .ZERO ) );
64
- }
65
-
66
54
@ Test
67
55
void shouldDisallowNegativeTimeout ()
68
56
{
@@ -98,6 +86,26 @@ void shouldHaveTimeout()
98
86
assertEquals ( Duration .ofSeconds ( 3 ), config .timeout () );
99
87
}
100
88
89
+ @ Test
90
+ void shouldAllowDefaultTimeout ()
91
+ {
92
+ TransactionConfig config = TransactionConfig .builder ()
93
+ .withTimeout ( TransactionConfig .Builder .SERVER_DEFAULT_TIMEOUT )
94
+ .build ();
95
+
96
+ assertNull ( config .timeout () );
97
+ }
98
+
99
+ @ Test
100
+ void shouldAllowZeroTimeout ()
101
+ {
102
+ TransactionConfig config = TransactionConfig .builder ()
103
+ .withTimeout ( Duration .ZERO )
104
+ .build ();
105
+
106
+ assertEquals ( Duration .ZERO , config .timeout () );
107
+ }
108
+
101
109
@ Test
102
110
void shouldHaveMetadata ()
103
111
{
You can’t perform that action at this time.
0 commit comments