Skip to content

fix running test in maven#4

Open
virtuoushub wants to merge 3 commits intostardogventures:typescript-axios-new-versionfrom
virtuoushub:chore/fix-test-in-maven
Open

fix running test in maven#4
virtuoushub wants to merge 3 commits intostardogventures:typescript-axios-new-versionfrom
virtuoushub:chore/fix-test-in-maven

Conversation

@virtuoushub
Copy link

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

Peter Colapietro added 3 commits January 13, 2022 11:03
```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

Development

Successfully merging this pull request may close these issues.

1 participant