Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/platform/engine/TestDescriptor
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at com.intellij.rt.junit.JUnitStarter.getAgentClass(JUnitStarter.java:244)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:225)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: java.lang.ClassNotFoundException: org.junit.platform.engine.TestDescriptor
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 5 more
statement.executeUpdate("CREATE TABLE books (" +
"id INT AUTO_INCREMENT primary key NOT NULL, " +
"title VARCHAR(50) NOT NULL, " +
"author VARCHAR(50) NOT NULL, " +
"price FLOAT NOT NULL, " +
"quantity INT NOT NULL)");
statement.executeUpdate("INSERT INTO books (title, author, price, quantity) value ('Java for dummies', " +
"'Tan Ah Teck', 11.11, 11)");
public boolean areBooksMatch(List<String> booksFromApi) {
List<String> bookNames = driver.findElements(booksWrapper).stream().map(WebElement::getText).toList();
for (String bookName : booksFromApi) {
if (!bookNames.contains(bookName)) {
return false;
}
}
logger.info("Books are matched.");
return true;
}