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()
5151 assertEquals ( emptyMap (), TransactionConfig .empty ().metadata () );
5252 }
5353
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-
6654 @ Test
6755 void shouldDisallowNegativeTimeout ()
6856 {
@@ -98,6 +86,26 @@ void shouldHaveTimeout()
9886 assertEquals ( Duration .ofSeconds ( 3 ), config .timeout () );
9987 }
10088
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+
101109 @ Test
102110 void shouldHaveMetadata ()
103111 {
You can’t perform that action at this time.
0 commit comments