Skip to content

Commit c2efde3

Browse files
authored
JAVA-2331: fix null pointer in tests that are using MockedDriverContextFactory (#1483)
1 parent 743c0b8 commit c2efde3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/test/java/com/datastax/oss/driver/internal/core/context/MockedDriverContextFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.datastax.oss.driver.api.core.session.ProgrammaticArguments;
2828
import com.datastax.oss.driver.api.core.tracker.RequestTracker;
2929
import com.datastax.oss.driver.shaded.guava.common.collect.Maps;
30+
import java.time.Duration;
3031
import java.util.Optional;
3132

3233
public class MockedDriverContextFactory {
@@ -45,6 +46,8 @@ public static DefaultDriverContext defaultDriverContext(
4546
DriverExecutionProfile blankProfile = mock(DriverExecutionProfile.class);
4647
when(blankProfile.getString(DefaultDriverOption.PROTOCOL_COMPRESSION, "none"))
4748
.thenReturn("none");
49+
when(blankProfile.getDuration(DefaultDriverOption.METRICS_NODE_EXPIRE_AFTER))
50+
.thenReturn(Duration.ofMinutes(5));
4851
return blankProfile;
4952
});
5053

0 commit comments

Comments
 (0)