Skip to content

Conversation

@ReedOei
Copy link
Contributor

@ReedOei ReedOei commented Feb 14, 2018

What changes were proposed in this pull request?

These tests require that a mocked ViewRegistry be used, which is set in a static initializer block. If the ViewRegistry is set after that, for example, but running a test in one of these classes, then the tests will no longer be using the correct ViewRegistry. Therefore, I have changed the set up methods of these test classes to set the ViewRegistry to the mocked version from that class.

How was this patch tested?

Patch was tested manually.

@adoroszlai @rlevas This pull request fixes an issue similar to others I have submitted in the past (#176 and #133).

…ceProviderTest, and ViewURLResourceProviderTest.
@asfgit
Copy link

asfgit commented Feb 15, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/612/
Test FAILed.
Test FAILured.


@Before
public void before() {
ViewRegistry.initInstance(viewregistry);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need the static init?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct, the static block is no longer necessary. I have therefore removed it from all three classes, and all tests in these classes still pass.

…tanceResourceProviderTest, ViewPermissionResourceProviderTest, and ViewURLResourceProviderTest.
@asfgit
Copy link

asfgit commented Feb 20, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/709/
Test FAILed.
Test FAILured.

@adoroszlai adoroszlai requested a review from rlevas February 20, 2018 22:17
@adoroszlai adoroszlai merged commit 78df59c into apache:trunk Feb 20, 2018
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.

4 participants