-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Code Coverage additions for Extensions #17596
base: master
Are you sure you want to change the base?
Conversation
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.
Left some suggestions.
public class SSLContextProviderTest | ||
{ | ||
@Mock | ||
private SSLClientConfig mockConfig; |
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.
Why not create a concrete object instead of using a mock?
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.
Wanted to keep this in sync with SSLClientConfigTest
, and then verify the getters are getting called. On another note, I think these tests are testing SSLClientConfig
getters that are already tested in its own test class; so we can remove them.
String expectedKeyManagerFactoryAlgorithm = "SunX509"; | ||
Boolean expectedValidateHostnames = true; | ||
|
||
// Use reflection to set the private fields |
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.
Please don't use reflection for this.
Either
- add a constructor
- OR, override the getters to return the expected values
- OR, deserialize the object from a json string
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.
Picked up the second option here to override the getters to return the expected values. Pushing changes in the next commit.
} | ||
|
||
@Test | ||
public void testToString() |
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.
Do we really need to test the toString
method? AFAICT, the toString
of this class is used only for debug logging.
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.
Sounds good, removing in the next commit.
} | ||
|
||
@Test | ||
public void testToString() |
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.
Probably not needed.
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.
Sounds good, removing in the next commit.
af7daca
to
84435fb
Compare
Description
extensions-core
andextensions-contrib
directoriesRelease note
Key changed/added classes in this PR
extensions-contrib/prometheus-emitter/src/test/java/org/apache/druid/emitter/prometheus/PrometheusEmitterConfigTest.java
extensions-contrib/prometheus-emitter/src/test/java/org/apache/druid/emitter/prometheus/PrometheusEmitterTest.java
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/MSQTaskListTest.java
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/MSQTuningConfigTest.java
extensions-core/simple-client-sslcontext/pom.xml
extensions-core/simple-client-sslcontext/src/test/java/org/apache/druid/https/SSLClientConfigTest.java
extensions-core/simple-client-sslcontext/src/test/java/org/apache/druid/https/SSLContextProviderTest.java
This PR has: