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

Trying to make mock tests pass against Spring Security #2106

Merged
merged 3 commits into from
Sep 29, 2020

Conversation

jglick
Copy link
Member

@jglick jglick commented Sep 21, 2020

Fixes one failure when run against jenkinsci/jenkins#4848. The other two fail in

java.lang.NullPointerException
	at hudson.security.ACL.hasPermission(ACL.java:134)
	at io.jenkins.blueocean.service.embedded.rest.UserImplPermissionTest$3.answer(UserImplPermissionTest.java:130)
	at io.jenkins.blueocean.service.embedded.rest.UserImplPermissionTest$3.answer(UserImplPermissionTest.java:126)

which I do not think can be fixed without actually updating the jenkins.version, because you cannot mock

public static @NonNull Authentication getAuthentication2()

without that dep, and ACL.hasPermission(Permission) is final.

@@ -143,15 +149,20 @@ public Boolean answer(InvocationOnMock invocation) {
*/
@Test
public void useTestAgainstOrgBaseOnFolder() {
try { // https://github.com/powermock/powermock/issues/428
Copy link
Member Author

Choose a reason for hiding this comment

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

@jglick
Copy link
Member Author

jglick commented Sep 29, 2020

@olamy this is a follow-up to #2084.

@olamy olamy merged commit 736b18e into jenkinsci:master Sep 29, 2020
@jglick jglick deleted the spring-PCT branch September 29, 2020 22:26
jglick added a commit to jglick/jep that referenced this pull request Oct 6, 2020
oleg-nenashev added a commit to jenkinsci/jep that referenced this pull request Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants