前提・実現したいこと
JWebUnit 'TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT'
でNullPointerがでます。
いくつか試しましたが、参考になる情報が少なく、解決に至っておりません。
考えられそうな要因があればお知恵をお貸しください。
発生している問題・エラーメッセージ
java.lang.NullPointerException at jwebunit.WebintegrationTest.setUpPlugin(WebintegrationTest.java:31) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) : : :
該当のソースコード
java
1@BeforeEach 2 void setUp() throws Exception { 3 tester =new WebTester(); 4 tester.setBaseUrl("http://localhost:8080/upload_image_db2"); 5 Locale.getDefault(); 6 7 } 8@BeforeEach 9 void setUpPlugin() throws Exception { 10 tester.setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT); // use HtmlUnit 11 tester.setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_WEBDRIVER); // use WebDriver 12 } 13
試したこと
http://chalapathi-bantupalli.blogspot.com/201
などを参考にpom.xmlを確認しましたが、
もしかしたら不備がある可能性があるので,該当箇所載せておきます。
pom.xml
<dependency> <groupId>net.sourceforge.jwebunit</groupId> <artifactId>jwebunit-core</artifactId> <version>3.3</version> </dependency> <dependency> <groupId>net.sourceforge.jwebunit</groupId> <artifactId>jwebunit-htmlunit-plugin</artifactId> <version>3.3</version> <scope>test</scope> </dependency> <dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit</artifactId> <version>2.35.0</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>htmlunit-driver</artifactId> <version>2.35.1</version> </dependency> <dependency> : : :
補足情報(FW/ツールのバージョンなど)
Eclipse
Maven 3.5.4
Junit 5.5.1
JWebUnit
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。