[JIRA] (JENKINS-61079) Tests have compilation errors in 2.1

0 views
Skip to first unread message

enevalainen@gmail.com (JIRA)

unread,
Feb 13, 2020, 8:52:03 AM2/13/20
to jenkinsc...@googlegroups.com
Eero Nevalainen created an issue
 
Jenkins / Bug JENKINS-61079
Tests have compilation errors in 2.1
Issue Type: Bug Bug
Assignee: Aleksi Simell
Components: influxdb-plugin
Created: 2020-02-13 13:51
Priority: Minor Minor
Reporter: Eero Nevalainen

Eg. CustomDataMapPointGeneratorTest and CustomDataPointGeneratorTest fail to compile with

The method thenReturn(capture#5-of ?) in the type OngoingStubbing<capture#5-of ?> is not applicable for the arguments (Job)

Apparently the Job mock does not match the expected types.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

enevalainen@gmail.com (JIRA)

unread,
Feb 13, 2020, 9:35:03 AM2/13/20
to jenkinsc...@googlegroups.com
Eero Nevalainen commented on Bug JENKINS-61079
 
Re: Tests have compilation errors in 2.1

The fix is actually really simple, just use the type-unsafe doReturn on the Job mock. Like so:

 

        Mockito.doReturn(job).when(build).getParent();

 

Don't have the time to go through a pull request myself, unfortunately.

aleksi.simell@eficode.com (JIRA)

unread,
Feb 14, 2020, 1:03:02 AM2/14/20
to jenkinsc...@googlegroups.com

Eero Nevalainen How are you able to reproduce this? When I run `mvn test` all tests compile and run successfully. I have seen the error in IDE, but nowhere else. I know the workaround, but since it doesn't seem to affect the actual functionality of the tests I haven't done that to all the tests.

enevalainen@gmail.com (JIRA)

unread,
Feb 14, 2020, 3:04:02 AM2/14/20
to jenkinsc...@googlegroups.com

Ah, interesting. I specifically try to run the tests in an IDE. Maybe maven and Eclipse use different compiler levels or there is some other "flag" that makes it stricter in the IDE?

 

Reply all
Reply to author
Forward
0 new messages