Skip to content

Transactional State [3/5]: Made StorageManagerUtil and FileUtil non-static for mocking side effects in tests#1162

Merged
prateekm merged 1 commit intoapache:masterfrom
prateekm:alo-non-static-util
Oct 2, 2019
Merged

Transactional State [3/5]: Made StorageManagerUtil and FileUtil non-static for mocking side effects in tests#1162
prateekm merged 1 commit intoapache:masterfrom
prateekm:alo-non-static-util

Conversation

@prateekm
Copy link
Contributor

@prateekm prateekm commented Sep 17, 2019

This PR changes StorageManagerUtil and FileUtil method to instance methods instead of static methods. Since many of these methods have side effects (modify disk contents), this helps mock their behavior in unit tests without performing actual I/O or using PowerMock.

@prateekm prateekm force-pushed the alo-non-static-util branch 2 times, most recently from 58aa0ff to 8ad7da0 Compare September 17, 2019 23:29
@prateekm prateekm changed the title [WIP] [3/6] Transactional State: Made StorageManagerUtil and FileUtil non-static for mocking side effects in tests Transactional State [3/5]: Made StorageManagerUtil and FileUtil non-static for mocking side effects in tests Sep 18, 2019
Copy link

@bharathkumarasubramanian bharathkumarasubramanian left a comment

Choose a reason for hiding this comment

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

8ad7da0 commit changes looks good to me.
Feel free to commit it after PR:1160 and PR:1161.

…cts in tests without having to use PowerMock.
@prateekm prateekm force-pushed the alo-non-static-util branch from 8ad7da0 to 5ee2e14 Compare October 2, 2019 01:57
@prateekm prateekm merged commit a4d8014 into apache:master Oct 2, 2019
@prateekm prateekm deleted the alo-non-static-util branch March 6, 2023 18:55
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