Use LoginUserRule to avoid manually setting and resetting login user singleton

Description

LoginUserRule sets the singleton LoginUser for the duration of a test, making sure to reset the LoginUser afterwards. This approach is preferred over manually calling LoginUserTestUtils.resetLoginUser(user); in
test setup and LoginUserTestUtils.resetLoginUser() in an @After method.

With the rule we manage LoginUser in a single place and don't need to worry about forgetting to reset it.
Currently, there are still a few places in our tests where we call LoginUser.reset() directly when we could use LoginUserRule instead. The goal of this ticket is to change these tests to use LoginUserRule

Environment

None

Activity

Show:
miasantreble
July 15, 2017, 6:21 AM

does this change also apply to LoginUserTest?

Your pinned fields
Click on the next to a field label to start pinning.

Assignee

amanb

Reporter

Bin Fan

Labels