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

Refactor NamedOperationCacheIT #3171

Closed
GCHQDeveloper314 opened this issue Mar 13, 2024 · 6 comments · Fixed by #3173
Closed

Refactor NamedOperationCacheIT #3171

GCHQDeveloper314 opened this issue Mar 13, 2024 · 6 comments · Fixed by #3173
Assignees
Labels
enhancement Improvement to existing functionality/feature good first issue Small, lower complexity and doesn't require pre-existing Gaffer knowledge tech-debt Relates to Technical Debt
Milestone

Comments

@GCHQDeveloper314
Copy link
Member

Describe the new feature you'd like
Refactor of NamedOperationCacheIT.java to use JUnit correctly.

Why do you want this feature?
This class has a single @Test method which then proceeds to run multiple tests by manually calling methods. Instead, these should all be annotated as individual tests for JUnit to run itself. There are also some methods annotated as before and after which are simply run manually.

Use of com.google.common.collect.Lists should also be removed as it is unnecessary.

@GCHQDeveloper314 GCHQDeveloper314 added enhancement Improvement to existing functionality/feature tech-debt Relates to Technical Debt good first issue Small, lower complexity and doesn't require pre-existing Gaffer knowledge labels Mar 13, 2024
@GCHQDeveloper314 GCHQDeveloper314 added this to the Backlog milestone Mar 13, 2024
@nine03
Copy link
Contributor

nine03 commented Mar 15, 2024

Hi, i want to work on this issue.
Could you assign this issue?

@GCHQDeveloper314
Copy link
Member Author

We usually assign the issue after a PR has been opened against it. We always ensure the contributor is assigned to the issue before it is closed - this ensures the contribution is recorded in our release notes.

@GCHQDeveloper314
Copy link
Member Author

There are some details on our ways of working page. However as you are an external contributor, I don't believe it matters so much as the automation to link PR to issue may not pick up the branch anyway as it will be in your fork. We will link it manually before merging.

@nine03
Copy link
Contributor

nine03 commented Mar 15, 2024

@GCHQDeveloper314

com.google.common.collect.Lists
requirement says I should delete this.
There are many places that use Lists.
Are you suggesting that I import and use org.assertj.core.util?

@GCHQDeveloper314
Copy link
Member Author

GCHQDeveloper314 commented Mar 15, 2024

That is an option, although Arrays.asList() is preferable to using AssertJ as it has been used elsewhere in the codebase.

@nine03
Copy link
Contributor

nine03 commented Mar 16, 2024

I have resolved this issue and have created a pull request.
Could you kindly review and address it when you have the chance?

GCHQDeveloper314 added a commit that referenced this issue Mar 19, 2024
* Refactor NamedOperationCacheIT

* Remove method which manually calls JUnit test methods

* Make Array add more concise with forEach and method reference

* Use Arrays where possible

* Remove duplicated setup code in tests

* Remove duplicated creation of GetAllNamedOperations

---------

Co-authored-by: GCHQDeveloper314 <94527357+GCHQDeveloper314@users.noreply.github.com>
@GCHQDeveloper314 GCHQDeveloper314 modified the milestones: Backlog, v2.2.0 Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to existing functionality/feature good first issue Small, lower complexity and doesn't require pre-existing Gaffer knowledge tech-debt Relates to Technical Debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants