I am working on Jenkins Unit tests, and am trying to add a
round trip test.
Unfortunately, I keep getting errors.
When I run the test, I get the following error:
I've played with the test a bit, and found that if I comment out my setUp, the test works. It seems that the test breaks as soon as I add the following line:
SystemCredentialsProvider.getInstance().getCredentials().add(credentials);
I'm somewhat at a loss as to how to debug this further.
Stack traces seem to point to where the exception is thrown (throwFailingHttpStatusCodeExceptionIfNecessary), and not where the error occurred. The error itself is quite generic.
Any hints on how to approach this?
How can I try to get at the root cause for the 500?
Thanks!
PS. This is the stack trace I'm getting:
testRoundtrip(com.google.jenkins.plugins.storage.ClassicUploadStepTest) Time elapsed: 6.1 sec <<< ERROR!
at com.gargoylesoftware.htmlunit.WebClient.throwFailingHttpStatusCodeExceptionIfNecessary(WebClient.java:535)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:415)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:400)
at org.jvnet.hudson.test.JenkinsRule$WebClient.goTo(JenkinsRule.java:2148)
at org.jvnet.hudson.test.JenkinsRule$WebClient.goTo(JenkinsRule.java:2128)
at org.jvnet.hudson.test.JenkinsRule$WebClient.getPage(JenkinsRule.java:2084)
at org.jvnet.hudson.test.JenkinsRule.configRoundtrip(JenkinsRule.java:1077)
at org.jvnet.hudson.test.JenkinsRule.configRoundtrip(JenkinsRule.java:1087)
at com.google.jenkins.plugins.storage.ClassicUploadStepTest.ConfigurationRoundTripTest(ClassicUploadStepTest.java:82)
at com.google.jenkins.plugins.storage.ClassicUploadStepTest.testRoundtrip(ClassicUploadStepTest.java:89)