-
Notifications
You must be signed in to change notification settings - Fork 357
Update parent pom, update jenkins core, use bom #238
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
Conversation
@amuniz @stephenc I would appreciate if you could have a look at the test failures. I am not even sure why this is failing but it seems to be related to the mocking/spying. In a live instance everything is working. |
Failure in indexing logs is:
It's weird, because the only mocking around those tests is the BB API mock, which has nothing to do with Jenkins jobs (even less with freestyle jobs...) |
I have given up on mocks for testing these kinds of things |
I think I found the problem. a/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BranchScanningIntegrationTest.java b/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BranchScanningIntegrationTest.java
index b365a78..95afab8 100644
--- a/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BranchScanningIntegrationTest.java
+++ b/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BranchScanningIntegrationTest.java
@@ -191,13 +191,9 @@ public class BranchScanningIntegrationTest {
@Override
public FreeStyleProject newInstance(Branch branch) {
- FreeStyleProject job = new FreeStyleProject(getOwner(), branch.getName());
- job.onCreatedFromScratch();
- FreeStyleProject spied = spy(job);
- // Do nothing.. Running the actual build is not desired/required (and not possible) in this tests.
- when(spied.scheduleBuild()).thenReturn(false);
- setBranch(spied, branch);
- return spied;
+ FreeStyleProject job = new FreeStyleProject(getOwner(), branch.getEncodedName());
+ setBranch(job, branch);
+ return job;
}
@Override That spying on the job was causing problems, and is not needed anymore, I believe. |
fixed two of them. Down to one test which is also doing some odd mocking 😓 |
Seems like mockito cannot mock a super method being called on a sub class
Not sure what changed in mocktio 3 that does not allow calling real method on a subclass when call is done on super |
Your checklist for this pull request