Open ShivamChavan01 opened 17 hours ago
Hi @rohanKanojia,
Could I please get assigned to the relevant issue?
I’ve tested the code using the asInstanceOf()
method, and it works fine!
I would appreciate your advice regarding the following line of code: https://github.com/eclipse-jkube/jkube/blob/d2afc38505144ef4d5c1ff084d8e8ab83e9e5637/jkube-kit/config/resource/src/test/java/org/eclipse/jkube/kit/config/resource/ResourceConfigTest.java#L135
Can I replace this line with:
.asInstanceOf(InstanceOfAssertFactories.list(VolumeConfig.class))
.singleElement()
Can I replace this line with
@ShivamChavan01 : I don't think we need to make this change as we're already passing an object of List
type to assertThat
Okay what About the Above Changes Can i Make it ??
It's a bit strange as I don't see sonar complaining about these occurrences of asList
. Although refactoring them like you suggested should do no harm.
It's a bit strange as I don't see sonar complaining about these occurrences of
asList
. Although refactoring them like you suggested should do no harm.
Yeah I agree,if you think it's a good idea to proceed with the refactoring with the latest AssertJ practices, I'd be happy to make those changes. Could you please confirm if I should go ahead with it?
Component
JKube Kit
Task description
Description
In the latest versions of Assertj asList() DSL method has been marked as deprecated: The class ResourceConfigTest presents the issue: Usage of the deprecated method asList() from AssertJ.
The following lines of code: https://github.com/eclipse-jkube/jkube/blob/d2afc38505144ef4d5c1ff084d8e8ab83e9e5637/jkube-kit/config/resource/src/test/java/org/eclipse/jkube/kit/config/resource/ResourceConfigTest.java#L154-L155
https://github.com/eclipse-jkube/jkube/blob/d2afc38505144ef4d5c1ff084d8e8ab83e9e5637/jkube-kit/config/resource/src/test/java/org/eclipse/jkube/kit/config/resource/ResourceConfigTest.java#L160-L161
https://github.com/eclipse-jkube/jkube/blob/d2afc38505144ef4d5c1ff084d8e8ab83e9e5637/jkube-kit/config/resource/src/test/java/org/eclipse/jkube/kit/config/resource/ResourceConfigTest.java#L179-L180
https://github.com/eclipse-jkube/jkube/blob/d2afc38505144ef4d5c1ff084d8e8ab83e9e5637/jkube-kit/config/resource/src/test/java/org/eclipse/jkube/kit/config/resource/ResourceConfigTest.java#L183-L184
users are advised to use
asInstanceOf(InstanceOfAssertFactories.list(type.class))
instead, we need to updateasList()
calls with this.Expected Behavior
AssertJ's
asList()
is replaced withasInstanceOf(InstanceOfAssertFactories.list(type.class))
Acceptance Criteria