Skip to content
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

VolumePermissionEnricherTest : Replace AssertJ's deprecated asList() DSL method with asInstanceOf(InstanceOfAssertFactories.list(type.class)) #3361

Closed
1 task done
rohanKanojia opened this issue Sep 4, 2024 · 7 comments · Fixed by #3392
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@rohanKanojia
Copy link
Member

rohanKanojia commented Sep 4, 2024

Component

JKube Kit

Task description

In the latest versions of Assertj asList() DSL method has been marked as deprecated:

users are advised to use asInstanceOf(InstanceOfAssertFactories.list(type.class)) instead, we need to update asList() calls with this.

Expected Behavior

AssertJ's asList() is replaced with asInstanceOf(InstanceOfAssertFactories.list(type.class))

Acceptance Criteria

  • asList() DSL method call is replaced with asInstanceOf(InstanceOfAssertFactories.list(type.class)) in all places
@rohanKanojia rohanKanojia added good first issue Good for newcomers help wanted Extra attention is needed labels Sep 4, 2024
@ShivamChavan01
Copy link
Contributor

hey @rohanKanojia can i do it

@vijaybhagwat24
Copy link
Contributor

kindly assign this to me.

@ShivamChavan01
Copy link
Contributor

Hey @vijaybhagwat24 I was away for 4 days because of some interview I'm working on it rn. I'll finish it tomorrow sorry for not updating

@vijaybhagwat24
Copy link
Contributor

hope you completed this.

@manusa
Copy link
Member

manusa commented Sep 18, 2024

Hi @vijaybhagwat24
This one #2774 is free to take ;)

@ShivamChavan01
Copy link
Contributor

I've been working on the issue #3361, specifically updating the VolumePermissionEnricherTest by replacing the deprecated asList() DSL method with asInstanceOf(InstanceOfAssertFactories.list(type.class)). During the process, I encountered a build failure due to missing Kubernetes dependencies, including io.fabric8.kubernetes.api.model and io.fabric8.kubernetes.client.

Could you please clarify whether I need to explicitly add these dependencies to the project, or if there’s a different setup for the build environment that I might be missing?

Also, I wanted to confirm if omitting the asInstanceOf() method within the singleElement() assertion is valid, or if it must be retained to ensure type safety. My understanding is that the asInstanceOf() method is essential for handling type inference, and removing it might cause issues in assertions on lists like VolumeMount.

Looking forward to your guidance on this!
Screenshot 2024-09-15 133012

@manusa
Copy link
Member

manusa commented Sep 18, 2024

Could you please clarify whether I need to explicitly add these dependencies to the project, or if there’s a different setup for the build environment that I might be missing?

You likely have some issue in your IDE setup.
Ignore those issues and try running the build, test, and so on, commands from the command line interface (CLI).

Also, I wanted to confirm if omitting the asInstanceOf() method within the singleElement() assertion is valid, or if it must be retained to ensure type safety. My understanding is that the asInstanceOf() method is essential for handling type inference, and removing it might cause issues in assertions on lists like VolumeMount.

You need to do the replacements whenever the AssertJ asList() DSL method is invoked in the code regardless of whatever comes next.

Some tips for IntelliJ in case things are not working for you:

image

Checking the Delegate IDE build/run actions to Maven and/or the Skip Tests and then reloading the project might help you with the issue in your screenshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
4 participants