-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cruise Control mock refactoring #10056
Conversation
...t/java/io/strimzi/operator/cluster/operator/assembly/KafkaRebalanceAssemblyOperatorTest.java
Outdated
Show resolved
Hide resolved
operator-common/src/main/java/io/strimzi/operator/common/Util.java
Outdated
Show resolved
Hide resolved
operator-common/src/main/java/io/strimzi/operator/common/Util.java
Outdated
Show resolved
Hide resolved
operator-common/src/main/java/io/strimzi/operator/common/Util.java
Outdated
Show resolved
Hide resolved
...va/io/strimzi/operator/common/operator/resource/cruisecontrol/AbstractMockCruiseControl.java
Outdated
Show resolved
Hide resolved
This is part of the refactoring mentioned in the RF change proposal. Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
...ava/io/strimzi/operator/cluster/operator/resource/cruisecontrol/CruiseControlClientTest.java
Show resolved
Hide resolved
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.
LGTM.
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.
Few more nits, but LGTM otherwise.
@@ -114,16 +121,26 @@ public static void beforeAll() { | |||
|
|||
vertx = Vertx.vertx(); | |||
sharedWorkerExecutor = vertx.createSharedWorkerExecutor("kubernetes-ops-pool"); | |||
|
|||
// Configure Cruise Control mock | |||
serverPort = CruiseControl.REST_API_PORT; |
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.
As you are changing this, would it make sense to change it everywhere the same way or not at all?
- Here you create a static variable but assign it a fixed value
- In
KafkaRebalanceStateMachineTest
you keep usingCruiseControl.REST_API_PORT
directly - In
CruiseControlClientTest
you seem to change it to using static variable andTestUtils.getFreePort()
=> this seems to me like the best variant
If you are alread changing it, it seems like it might make sense to change it the same way everywhere.
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.
The problem with those tests is that they don't use the CC client directly, but through KafkaRebalanceAssemblyOperator
where CC port is hard coded to CruiseControl.REST_API_PORT
. I didn't changed it to keep the PR focused on tests, but I can do it if you prefer.
...t/java/io/strimzi/operator/cluster/operator/assembly/KafkaRebalanceAssemblyOperatorTest.java
Outdated
Show resolved
Hide resolved
topic-operator/src/test/java/io/strimzi/operator/topic/TopicOperatorTestUtil.java
Outdated
Show resolved
Hide resolved
/azp run regression |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
@scholzj I added one more small commit to share the basic auth value method, which was in the first commit, but not complete. Sorry. |
operator-common/src/main/java/io/strimzi/operator/common/Util.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
/azp run regression |
Azure Pipelines successfully started running 1 pipeline(s). |
This is part of the refactoring mentioned in the RF change proposal. Next PRs: share CC client logic, replacing Vertx with Java HTTP client.