@@ -150,8 +150,9 @@ class ClientMetadataHelperSpecification extends Specification {
150150 }
151151
152152 static BsonDocument createExpectedClientMetadataDocument (String appName ) {
153+ String driverVersion = ' unknown'
153154 def expectedDriverDocument = new BsonDocument (' name' , new BsonString (' mongo-java-driver' ))
154- .append(' version' , new BsonString (getDriverVersion() ))
155+ .append(' version' , new BsonString (driverVersion ))
155156 def expectedOperatingSystemDocument = new BsonDocument (' type' ,
156157 new BsonString (ClientMetadataHelper . getOperatingSystemType(System . getProperty(' os.name' ))))
157158 .append(' name' , new BsonString (System . getProperty(' os.name' )))
@@ -182,19 +183,4 @@ class ClientMetadataHelperSpecification extends Specification {
182183 expectedClientDocument. append(' platform' , new BsonString (platforms))
183184 expectedClientDocument
184185 }
185-
186-
187- // not sure how else to test this. It's really a test of the build system that generates the version.properties file
188- private static String getDriverVersion () {
189- String driverVersion = ' unknown' ;
190- Class<InternalStreamConnectionInitializer > clazz = InternalStreamConnectionInitializer ;
191- URL versionPropertiesFileURL = clazz. getResource(' /version.properties' );
192- if (versionPropertiesFileURL != null ) {
193- Properties versionProperties = new Properties ();
194- InputStream versionPropertiesInputStream = versionPropertiesFileURL. openStream();
195- versionProperties. load(versionPropertiesInputStream);
196- driverVersion = versionProperties. getProperty(' version' );
197- }
198- driverVersion;
199- }
200186}
0 commit comments