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

fix running test in maven #4

Open
wants to merge 3 commits into
base: typescript-axios-new-version
Choose a base branch
from

Conversation

virtuoushub
Copy link

needed to make these changes to get ./mvnw test to work locally.

```log
Running TestSuite
java.lang.RuntimeException: java.io.IOException: Can not attach to current VM
	at mockit.internal.startup.AgentLoader.attachToRunningVM(AgentLoader.java:150)
	at mockit.internal.startup.AgentLoader.loadAgent(AgentLoader.java:60)
	at mockit.internal.startup.Startup.initializeIfPossible(Startup.java:200)
	at mockit.integration.testng.TestNGRunnerDecorator.onExecutionStart(TestNGRunnerDecorator.java:348)
	at org.testng.TestNG.runExecutionListeners(TestNG.java:1055)
	at org.testng.TestNG.run(TestNG.java:1002)
	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132)
	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:193)
	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94)
	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: java.io.IOException: Can not attach to current VM
	at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.<init>(HotSpotVirtualMachine.java:75)
	at jdk.attach/sun.tools.attach.VirtualMachineImpl.<init>(VirtualMachineImpl.java:56)
	at jdk.attach/sun.tools.attach.AttachProviderImpl.attachVirtualMachine(AttachProviderImpl.java:58)
	at jdk.attach/com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:207)
	at mockit.internal.startup.AgentLoader.attachToRunningVM(AgentLoader.java:144)
	... 12 more
```
```log
java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct
```
```
Underlying exception : java.lang.UnsupportedOperationException: Cannot define class using reflection
	at io.swagger.codegen.languages.ScalaCodegenTest.shouldCallFormatIdentifierOnGetModelName(ScalaCodegenTest.java:27)
Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection
	at io.swagger.codegen.languages.ScalaCodegenTest.shouldCallFormatIdentifierOnGetModelName(ScalaCodegenTest.java:27)
Caused by: java.lang.IllegalArgumentException: Unknown Java version: 11
	at io.swagger.codegen.languages.ScalaCodegenTest.shouldCallFormatIdentifierOnGetModelName(ScalaCodegenTest.java:27)

shouldCallFormatIdentifierOnToEnumName(io.swagger.codegen.languages.ScalaCodegenTest)  Time elapsed: 0.195 sec  <<< FAILURE!
org.mockito.exceptions.base.MockitoException:

Mockito cannot mock this class: class io.swagger.codegen.languages.ScalaClientCodegen.

Mockito can only mock non-private & non-final classes.
If you're not sure why you're getting this error, please report to the mailing list.
```

see also: https://dev.to/scottshipp/how-to-fix-a-mockito-cannot-mock-this-class-exception-in-a-spring-boot-app-457e
virtuoushub pushed a commit to virtuoushub/swagger-codegen that referenced this pull request Jan 13, 2022
…ch23348/update-axios

[ch23348] Adds 'as const' to HTTP methods; for Axios upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant