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

improved FireboltProperties: removed of() factory method, added constructors #320

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

alexradzin
Copy link
Collaborator

@alexradzin alexradzin commented Jan 8, 2024

The annoying factory method of() is removed. Now we have constructor that accepts Properties instead. Constructor can guarantee that all final members are initialised.

@alexradzin alexradzin requested a review from a team as a code owner January 8, 2024 13:36
Copy link
Contributor

@ptiurin ptiurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you comment on what this improves? The change is fine IMO, but it's not clear what's the benefit.
Also, I'd suggest adopting a better PR/commit name. Perhaps refactor FireboltProperties to use AllArgsConstructor or even better refactor FireboltProperties to <insert the reason for this change>.

try (MockedConstruction<FireboltProperties> mockedFireboltPropertiesConstruction = Mockito.mockConstruction(FireboltProperties.class, (fireboltPropertiesMock, context) -> {
when(fireboltPropertiesMock.getAccount()).thenReturn(fireboltProperties.getAccount());
when(fireboltPropertiesMock.getDatabase()).thenReturn(fireboltProperties.getDatabase());
//when(FireboltProperties.of(any())).thenReturn(fireboltProperties);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@alexradzin alexradzin changed the title improved FireboltProperties improved FireboltProperties: removed of() factory method, added constructors Jan 11, 2024
@alexradzin
Copy link
Collaborator Author

Can you comment on what this improves? The change is fine IMO, but it's not clear what's the benefit. Also, I'd suggest adopting a better PR/commit name. Perhaps refactor FireboltProperties to use AllArgsConstructor or even better refactor FireboltProperties to <insert the reason for this change>.

Done

@alexradzin alexradzin force-pushed the refactor-firebolt-properties branch from 241cf55 to e34b57a Compare January 11, 2024 13:52
@alexradzin alexradzin force-pushed the refactor-firebolt-properties branch from e34b57a to 98b76d8 Compare January 11, 2024 13:54
Copy link

@alexradzin alexradzin merged commit 47803d5 into master Jan 11, 2024
4 checks passed
@alexradzin alexradzin deleted the refactor-firebolt-properties branch January 11, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants