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

Mockito Tests not work after updating to 1.9.0 #1101

Closed
MCMicS opened this issue Sep 6, 2022 · 3 comments
Closed

Mockito Tests not work after updating to 1.9.0 #1101

MCMicS opened this issue Sep 6, 2022 · 3 comments
Assignees
Milestone

Comments

@MCMicS
Copy link

MCMicS commented Sep 6, 2022

Describe the bug
A clear and concise description of what the bug is.
Add the full stack trace if available.
If possible, run the failing task with --stacktrace flag.

Mockito cannot mock/spy because :
 - final class

To Reproduce
see failed action https://github.com/MCMicS/jenkins-control-plugin/runs/8199874953?check_suite_focus=true

Expected behavior
Test will be executed like in version 1.8.1

@MCMicS MCMicS added the bug label Sep 6, 2022
@karollewandowski karollewandowski self-assigned this Sep 6, 2022
@karollewandowski
Copy link
Contributor

Please replace your MockMaker config file:

  • jenkins-control-plugin/src/test/resources/mockito-extensions (simply remove it)

with the mockito-inline artifact:

  • replace 'org.mockito:mockito-core:4.7.0' with 'org.mockito:mockito-inline:4.7.0'

See: https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#mockito-inline

I'm not sure how the recent changes caused this issue, but I verified the solution, and it works properly.

@MCMicS
Copy link
Author

MCMicS commented Sep 6, 2022

thanks for the hint. with mockito-inline it works again.

@karollewandowski
Copy link
Contributor

karollewandowski commented Sep 7, 2022

The issue seems to be caused by this change:

It pushes the resources directories from the build directory to the end of the test classpath, which results in loading org.mockito.plugins.MockMaker config from Power Mock, which is first in the classpath, so the project's org.mockito.plugins.MockMaker is ignored. It may cause more similar issues for other resources.

@hsz hsz added this to the next milestone Sep 19, 2022
karollewandowski added a commit that referenced this issue Sep 20, 2022
karollewandowski added a commit that referenced this issue Sep 20, 2022
hsz added a commit that referenced this issue Sep 22, 2022
… execution (#1108)

* Do not move resource directories to the end of classpath (#1101)

* Do not move resource directories to the end of classpath (#1101)

- add integration test

* Do not move resource directories to the end of classpath (#1101)

- include in CHANGES.md

* Do not move resource directories to the end of classpath (#1101)

- cosmetics

* Bump jackson-databind from 2.13.3 to 2.13.4

Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.3 to 2.13.4.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump structure-intellij from 3.236 to 3.237

Bumps [structure-intellij](https://github.com/JetBrains/intellij-plugin-verifier) from 3.236 to 3.237.
- [Release notes](https://github.com/JetBrains/intellij-plugin-verifier/releases)
- [Commits](JetBrains/intellij-plugin-verifier@intellij-structure-3.236...intellij-structure-3.237)

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij.plugins:structure-intellij
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump structure-base from 3.236 to 3.237

Bumps [structure-base](https://github.com/JetBrains/intellij-plugin-verifier) from 3.236 to 3.237.
- [Release notes](https://github.com/JetBrains/intellij-plugin-verifier/releases)
- [Commits](JetBrains/intellij-plugin-verifier@intellij-structure-3.236...intellij-structure-3.237)

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij.plugins:structure-base
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump dd-plist from 1.24 to 1.25

Bumps [dd-plist](https://github.com/3breadt/dd-plist) from 1.24 to 1.25.
- [Release notes](https://github.com/3breadt/dd-plist/releases)
- [Commits](3breadt/dd-plist@v1.24.0...v1.25.0)

---
updated-dependencies:
- dependency-name: com.googlecode.plist:dd-plist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Integration Tests: Add missing entries to README file

* Invalidate instrumented classes bound to forms if GUI changed [IDEA-298989](https://youtrack.jetbrains.com/issue/IDEA-298989/Duplicate-method-name-getFont)

* Integration Tests: extend classpath test with JaCoCo integration

* build.gradle.kts: move configuration values to `gradle.properties` file

* Bump `javax.xml.bind:jaxb-api` dependency to `2.4.0-b180830.0359`

* IntelliJInstrumentCodeTask.kt: make sure `instrumentedClassPath` exists before replacing it with `compiledClassPath`

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakub Chrzanowski <jakub.chrzanowski@jetbrains.com>
hsz added a commit to 3flex/gradle-intellij-plugin that referenced this issue Sep 22, 2022
… execution (JetBrains#1108)

* Do not move resource directories to the end of classpath (JetBrains#1101)

* Do not move resource directories to the end of classpath (JetBrains#1101)

- add integration test

* Do not move resource directories to the end of classpath (JetBrains#1101)

- include in CHANGES.md

* Do not move resource directories to the end of classpath (JetBrains#1101)

- cosmetics

* Bump jackson-databind from 2.13.3 to 2.13.4

Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.3 to 2.13.4.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump structure-intellij from 3.236 to 3.237

Bumps [structure-intellij](https://github.com/JetBrains/intellij-plugin-verifier) from 3.236 to 3.237.
- [Release notes](https://github.com/JetBrains/intellij-plugin-verifier/releases)
- [Commits](JetBrains/intellij-plugin-verifier@intellij-structure-3.236...intellij-structure-3.237)

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij.plugins:structure-intellij
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump structure-base from 3.236 to 3.237

Bumps [structure-base](https://github.com/JetBrains/intellij-plugin-verifier) from 3.236 to 3.237.
- [Release notes](https://github.com/JetBrains/intellij-plugin-verifier/releases)
- [Commits](JetBrains/intellij-plugin-verifier@intellij-structure-3.236...intellij-structure-3.237)

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij.plugins:structure-base
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump dd-plist from 1.24 to 1.25

Bumps [dd-plist](https://github.com/3breadt/dd-plist) from 1.24 to 1.25.
- [Release notes](https://github.com/3breadt/dd-plist/releases)
- [Commits](3breadt/dd-plist@v1.24.0...v1.25.0)

---
updated-dependencies:
- dependency-name: com.googlecode.plist:dd-plist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Integration Tests: Add missing entries to README file

* Invalidate instrumented classes bound to forms if GUI changed [IDEA-298989](https://youtrack.jetbrains.com/issue/IDEA-298989/Duplicate-method-name-getFont)

* Integration Tests: extend classpath test with JaCoCo integration

* build.gradle.kts: move configuration values to `gradle.properties` file

* Bump `javax.xml.bind:jaxb-api` dependency to `2.4.0-b180830.0359`

* IntelliJInstrumentCodeTask.kt: make sure `instrumentedClassPath` exists before replacing it with `compiledClassPath`

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakub Chrzanowski <jakub.chrzanowski@jetbrains.com>
hsz added a commit to 3flex/gradle-intellij-plugin that referenced this issue Sep 27, 2022
… execution (JetBrains#1108)

* Do not move resource directories to the end of classpath (JetBrains#1101)

* Do not move resource directories to the end of classpath (JetBrains#1101)

- add integration test

* Do not move resource directories to the end of classpath (JetBrains#1101)

- include in CHANGES.md

* Do not move resource directories to the end of classpath (JetBrains#1101)

- cosmetics

* Bump jackson-databind from 2.13.3 to 2.13.4

Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.3 to 2.13.4.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump structure-intellij from 3.236 to 3.237

Bumps [structure-intellij](https://github.com/JetBrains/intellij-plugin-verifier) from 3.236 to 3.237.
- [Release notes](https://github.com/JetBrains/intellij-plugin-verifier/releases)
- [Commits](JetBrains/intellij-plugin-verifier@intellij-structure-3.236...intellij-structure-3.237)

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij.plugins:structure-intellij
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump structure-base from 3.236 to 3.237

Bumps [structure-base](https://github.com/JetBrains/intellij-plugin-verifier) from 3.236 to 3.237.
- [Release notes](https://github.com/JetBrains/intellij-plugin-verifier/releases)
- [Commits](JetBrains/intellij-plugin-verifier@intellij-structure-3.236...intellij-structure-3.237)

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij.plugins:structure-base
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump dd-plist from 1.24 to 1.25

Bumps [dd-plist](https://github.com/3breadt/dd-plist) from 1.24 to 1.25.
- [Release notes](https://github.com/3breadt/dd-plist/releases)
- [Commits](3breadt/dd-plist@v1.24.0...v1.25.0)

---
updated-dependencies:
- dependency-name: com.googlecode.plist:dd-plist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Integration Tests: Add missing entries to README file

* Invalidate instrumented classes bound to forms if GUI changed [IDEA-298989](https://youtrack.jetbrains.com/issue/IDEA-298989/Duplicate-method-name-getFont)

* Integration Tests: extend classpath test with JaCoCo integration

* build.gradle.kts: move configuration values to `gradle.properties` file

* Bump `javax.xml.bind:jaxb-api` dependency to `2.4.0-b180830.0359`

* IntelliJInstrumentCodeTask.kt: make sure `instrumentedClassPath` exists before replacing it with `compiledClassPath`

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakub Chrzanowski <jakub.chrzanowski@jetbrains.com>
hsz added a commit that referenced this issue Sep 27, 2022
… execution (#1108)

* Do not move resource directories to the end of classpath (#1101)

* Do not move resource directories to the end of classpath (#1101)

- add integration test

* Do not move resource directories to the end of classpath (#1101)

- include in CHANGES.md

* Do not move resource directories to the end of classpath (#1101)

- cosmetics

* Bump jackson-databind from 2.13.3 to 2.13.4

Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.3 to 2.13.4.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump structure-intellij from 3.236 to 3.237

Bumps [structure-intellij](https://github.com/JetBrains/intellij-plugin-verifier) from 3.236 to 3.237.
- [Release notes](https://github.com/JetBrains/intellij-plugin-verifier/releases)
- [Commits](JetBrains/intellij-plugin-verifier@intellij-structure-3.236...intellij-structure-3.237)

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij.plugins:structure-intellij
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump structure-base from 3.236 to 3.237

Bumps [structure-base](https://github.com/JetBrains/intellij-plugin-verifier) from 3.236 to 3.237.
- [Release notes](https://github.com/JetBrains/intellij-plugin-verifier/releases)
- [Commits](JetBrains/intellij-plugin-verifier@intellij-structure-3.236...intellij-structure-3.237)

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij.plugins:structure-base
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump dd-plist from 1.24 to 1.25

Bumps [dd-plist](https://github.com/3breadt/dd-plist) from 1.24 to 1.25.
- [Release notes](https://github.com/3breadt/dd-plist/releases)
- [Commits](3breadt/dd-plist@v1.24.0...v1.25.0)

---
updated-dependencies:
- dependency-name: com.googlecode.plist:dd-plist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Integration Tests: Add missing entries to README file

* Invalidate instrumented classes bound to forms if GUI changed [IDEA-298989](https://youtrack.jetbrains.com/issue/IDEA-298989/Duplicate-method-name-getFont)

* Integration Tests: extend classpath test with JaCoCo integration

* build.gradle.kts: move configuration values to `gradle.properties` file

* Bump `javax.xml.bind:jaxb-api` dependency to `2.4.0-b180830.0359`

* IntelliJInstrumentCodeTask.kt: make sure `instrumentedClassPath` exists before replacing it with `compiledClassPath`

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakub Chrzanowski <jakub.chrzanowski@jetbrains.com>
hsz added a commit that referenced this issue Sep 27, 2022
… execution (#1108)

* Do not move resource directories to the end of classpath (#1101)

* Do not move resource directories to the end of classpath (#1101)

- add integration test

* Do not move resource directories to the end of classpath (#1101)

- include in CHANGES.md

* Do not move resource directories to the end of classpath (#1101)

- cosmetics

* Bump jackson-databind from 2.13.3 to 2.13.4

Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.3 to 2.13.4.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump structure-intellij from 3.236 to 3.237

Bumps [structure-intellij](https://github.com/JetBrains/intellij-plugin-verifier) from 3.236 to 3.237.
- [Release notes](https://github.com/JetBrains/intellij-plugin-verifier/releases)
- [Commits](JetBrains/intellij-plugin-verifier@intellij-structure-3.236...intellij-structure-3.237)

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij.plugins:structure-intellij
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump structure-base from 3.236 to 3.237

Bumps [structure-base](https://github.com/JetBrains/intellij-plugin-verifier) from 3.236 to 3.237.
- [Release notes](https://github.com/JetBrains/intellij-plugin-verifier/releases)
- [Commits](JetBrains/intellij-plugin-verifier@intellij-structure-3.236...intellij-structure-3.237)

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij.plugins:structure-base
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump dd-plist from 1.24 to 1.25

Bumps [dd-plist](https://github.com/3breadt/dd-plist) from 1.24 to 1.25.
- [Release notes](https://github.com/3breadt/dd-plist/releases)
- [Commits](3breadt/dd-plist@v1.24.0...v1.25.0)

---
updated-dependencies:
- dependency-name: com.googlecode.plist:dd-plist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Integration Tests: Add missing entries to README file

* Invalidate instrumented classes bound to forms if GUI changed [IDEA-298989](https://youtrack.jetbrains.com/issue/IDEA-298989/Duplicate-method-name-getFont)

* Integration Tests: extend classpath test with JaCoCo integration

* build.gradle.kts: move configuration values to `gradle.properties` file

* Bump `javax.xml.bind:jaxb-api` dependency to `2.4.0-b180830.0359`

* IntelliJInstrumentCodeTask.kt: make sure `instrumentedClassPath` exists before replacing it with `compiledClassPath`

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakub Chrzanowski <jakub.chrzanowski@jetbrains.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants