File tree Expand file tree Collapse file tree 3 files changed +28
-25
lines changed
main/java/org/neo4j/driver
test/java/org/neo4j/driver Expand file tree Collapse file tree 3 files changed +28
-25
lines changed Original file line number Diff line number Diff line change 3737import org .neo4j .driver .internal .RoutingSettings ;
3838import org .neo4j .driver .internal .SecuritySettings ;
3939import org .neo4j .driver .internal .observation .DriverObservationProvider ;
40- import org .neo4j .driver .internal .observation .NoopObservationProvider ;
4140import org .neo4j .driver .internal .retry .ExponentialBackoffRetryLogic ;
4241import org .neo4j .driver .net .ServerAddressResolver ;
4342import org .neo4j .driver .observation .ObservationProvider ;
@@ -749,11 +748,10 @@ public ConfigBuilder withResolver(ServerAddressResolver resolver) {
749748 */
750749 @ Preview (name = "Observability" )
751750 public ConfigBuilder withObservationProvider (ObservationProvider observationProvider ) {
752- this .observationProvider =
753- Objects .requireNonNullElseGet (observationProvider , NoopObservationProvider ::getInstance );
754- if (!(observationProvider instanceof DriverObservationProvider )) {
751+ if (observationProvider != null && !(observationProvider instanceof DriverObservationProvider )) {
755752 throw new IllegalArgumentException ("Unssupported observation provider" );
756753 }
754+ this .observationProvider = observationProvider ;
757755 return this ;
758756 }
759757
Original file line number Diff line number Diff line change @@ -562,4 +562,11 @@ void shouldRejectUnknownObservationProvider() {
562562 assertThrows (
563563 IllegalArgumentException .class , () -> Config .builder ().withObservationProvider (observationProvider ));
564564 }
565+
566+ @ Test
567+ void shouldAllowNullObservationProvider () {
568+ var config = Config .builder ().withObservationProvider (null ).build ();
569+
570+ assertTrue (config .observationProvider ().isEmpty ());
571+ }
565572}
Original file line number Diff line number Diff line change 142142 <profile >
143143 <id >generate-html</id >
144144 <build >
145- <pluginManagement >
146- <plugins >
147- <plugin >
148- <groupId >org.asciidoctor</groupId >
149- <artifactId >asciidoctor-maven-plugin</artifactId >
150- <executions >
151- <execution >
152- <id >asciidoc-to-html</id >
153- <phase >prepare-package</phase >
154- <goals >
155- <goal >process-asciidoc</goal >
156- </goals >
157- <configuration >
158- <sourceDirectory >${project.build.directory} /docs</sourceDirectory >
159- <outputDirectory >${project.build.directory} /html</outputDirectory >
160- </configuration >
161- </execution >
162- </executions >
163- </plugin >
164- </plugins >
165- </pluginManagement >
145+ <plugins >
146+ <plugin >
147+ <groupId >org.asciidoctor</groupId >
148+ <artifactId >asciidoctor-maven-plugin</artifactId >
149+ <executions >
150+ <execution >
151+ <id >asciidoc-to-html</id >
152+ <phase >prepare-package</phase >
153+ <goals >
154+ <goal >process-asciidoc</goal >
155+ </goals >
156+ <configuration >
157+ <sourceDirectory >${project.build.directory} /docs</sourceDirectory >
158+ <outputDirectory >${project.build.directory} /html</outputDirectory >
159+ </configuration >
160+ </execution >
161+ </executions >
162+ </plugin >
163+ </plugins >
166164 </build >
167165 </profile >
168166 </profiles >
You can’t perform that action at this time.
0 commit comments