-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert mongo-common tests from groovy to java #12382
Convert mongo-common tests from groovy to java #12382
Conversation
...ing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java
Outdated
Show resolved
Hide resolved
...ing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java
Outdated
Show resolved
Hide resolved
...y/src/test/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoDbAttributesGetterTest.java
Outdated
Show resolved
Hide resolved
… and "cleanup" 2. Collection tool class methods use static import Signed-off-by: xiepuhuan <[email protected]>
...ing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java
Outdated
Show resolved
Hide resolved
...ing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java
Outdated
Show resolved
Hide resolved
...ing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java
Outdated
Show resolved
Hide resolved
...ing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java
Outdated
Show resolved
Hide resolved
...est/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/Mongo4ReactiveClientTest.java
Outdated
Show resolved
Hide resolved
...est/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/Mongo4ReactiveClientTest.java
Outdated
Show resolved
Hide resolved
...ent/src/test/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/MongoClientTest.java
Outdated
Show resolved
Hide resolved
...ent/src/test/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/MongoClientTest.java
Outdated
Show resolved
Hide resolved
...ing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: xiepuhuan <[email protected]>
Signed-off-by: xiepuhuan <[email protected]>
...ing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java
Outdated
Show resolved
Hide resolved
...est/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/Mongo4ReactiveClientTest.java
Outdated
Show resolved
Hide resolved
2. Convert long to int using `Math.toIntExam`. Signed-off-by: xiepuhuan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, don't forget to delete following unnecessary dependencies
opentelemetry-java-instrumentation/instrumentation/mongo/mongo-common/testing/build.gradle.kts
Line 9 in d156afb
implementation("org.apache.groovy:groovy") |
opentelemetry-java-instrumentation/instrumentation/mongo/mongo-common/testing/build.gradle.kts
Line 11 in d156afb
implementation("org.spockframework:spock-core") |
Thanks. |
...ing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java
Outdated
Show resolved
Hide resolved
...ent/src/test/java/io/opentelemetry/javaagent/instrumentation/mongo/v3_7/MongoClientTest.java
Outdated
Show resolved
Hide resolved
...est/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/Mongo4ReactiveClientTest.java
Outdated
Show resolved
Hide resolved
...ent/src/test/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/MongoClientTest.java
Outdated
Show resolved
Hide resolved
...ng/src/main/java/io/opentelemetry/instrumentation/mongo/testing/AbstractMongoClientTest.java
Outdated
Show resolved
Hide resolved
2. Close resources using AutoCleanupExtension 3. Reconstruct the mongoSpan method
...y/src/test/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoDbAttributesGetterTest.java
Outdated
Show resolved
Hide resolved
...ing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java
Outdated
Show resolved
Hide resolved
...ent/src/test/java/io/opentelemetry/javaagent/instrumentation/mongo/v3_7/MongoClientTest.java
Outdated
Show resolved
Hide resolved
...est/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/Mongo4ReactiveClientTest.java
Outdated
Show resolved
Hide resolved
...st/java/io/opentelemetry/javaagent/instrumentation/mongoasync/v3_3/MongoAsyncClientTest.java
Outdated
Show resolved
Hide resolved
...st/java/io/opentelemetry/javaagent/instrumentation/mongoasync/v3_3/MongoAsyncClientTest.java
Outdated
Show resolved
Hide resolved
...ng/src/main/java/io/opentelemetry/instrumentation/mongo/testing/AbstractMongoClientTest.java
Outdated
Show resolved
Hide resolved
...ng/src/main/java/io/opentelemetry/instrumentation/mongo/testing/AbstractMongoClientTest.java
Outdated
Show resolved
Hide resolved
...ng/src/main/java/io/opentelemetry/instrumentation/mongo/testing/AbstractMongoClientTest.java
Outdated
Show resolved
Hide resolved
2. Change the return type of the involved method from int to long. 3. Using isIn instead of containsAnyOf for correct assertions. 4. Directly throw InterruptedException without capturing it. 5. Latch calls await method with timeout. 6. Merge comment lines. 7. Use the get method to wait for the future to complete, just like the original Groovy code. 8. In the mongoSpan method parameters, use SpanDataAsset instead of trace and index. 9. In the mongoSpan method, optimizing assertion error prompts. Signed-off-by: xiepuhuan <[email protected]>
Related to #7195