-1

When I am trying to launch my Spring application using VSCode's Extension Pack for Java which has

import static org.assertj.core.api.Assertions.catchException;

in one of the tests, I get build failed with the following message:

The import org.assertj.core.api.Assertions.catchException cannot be resolved

However, when I press Proceed, the app works normally. I have

testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.22.0'

in my gradle.build file and it also works fine if I compile it with gradle build. How can I fix it?

Wiktor
  • 71
  • 1
  • 9

2 Answers2

0

Try to right-click the build.gradle file of your project and select Reload Project

Sheng Chen
  • 1,012
  • 4
  • 18
0

I got it working by cleaning the java language server cache. Was the first option provided by VSCode itself to fix the issue.