Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

Unit testing a Sling Servlet

Avatar

Level 2

I'm trying to unit test my class that extends the SlingAllMethodsServlet class and having a hard time! I want to check the result of my doGet method (which has a void return type) I need to check what has been written into the PrintWriter does anybody have experience trying to do this?

1 Accepted Solution

Avatar

Correct answer by
Level 10

See this GEMS Session - it looks like it will help. 

From Unit Testing to Integration Test of an Experience Manager Application

Automated testing is indispensable for developing any application. This presentation walks through the various tools for testing Java code starting with the basics of unit testing up to functional and integration testing. Learn how to easily add tests in the most effective way to your code base, regardless of whether you want to test a simple utility method, some OSGi service, or an HTTP endpoint.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

See this GEMS Session - it looks like it will help. 

From Unit Testing to Integration Test of an Experience Manager Application

Automated testing is indispensable for developing any application. This presentation walks through the various tools for testing Java code starting with the basics of unit testing up to functional and integration testing. Learn how to easily add tests in the most effective way to your code base, regardless of whether you want to test a simple utility method, some OSGi service, or an HTTP endpoint.

Avatar

Level 2

Great thanks, looks like it will be exactly what I'm after! 🙂

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now