0

zats with springboot - getting null pointer exception

asked 2020-04-17 07:49:09 +0800

wastemails gravatar image wastemails
30

Getting error while testing zats with spring boot security, anybody please helpout.

org.zkoss.zats.ZatsException at org.zkoss.zats.mimic.impl.EmulatorClient.connect(EmulatorClient.java:168) at org.zkoss.zats.junit.AutoClient.connect(AutoClient.java:39)

Caused by: java.lang.NullPointerException at org.zkoss.zats.mimic.impl.DefaultDesktopAgent.getId(DefaultDesktopAgent.java:44) at org.zkoss.zats.mimic.impl.EmulatorClient.connect(EmulatorClient.java:147)

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2020-04-17 14:26:34 +0800

cor3000 gravatar image cor3000
5173 2 7
ZK Team

updated 2020-04-27 10:04:05 +0800

As most NPE don't mean anything by themselves and depend on the scenario leading to it, I can't give a concrete reason.

Looking into the source code gives some indication: https://github.com/zkoss/zats/blob/master/zats-mimic/src/main/java/org/zkoss/zats/mimic/impl/EmulatorClient.java#L145-L147

Are you trying to open a NON-zul page? i.e. a page that can't be tested with ZATS

A working ZATS test case with spring security enabled is provided in this example test case SecurePageTest

It shows how a non-ZUL page containing a login form can be submitted by directly using a HttpUrlConnection. https://github.com/zkoss/zkspringboot/blob/master/zkspringboot-demos/zkspringboot-security-demo/src/test/java/org/zkoss/zkspringboot/security/SecurePageTest.java#L57-L82

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2020-04-17 07:49:09 +0800

Seen: 5 times

Last updated: Apr 27

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More