Config Editor: Unit Test Coverage EditorParameterPersistence Servlet

Description

test coverage for EditorParameterPersistence is corrently too low.

in the latest release of aem/sling-mock 1.1 a good support for testing servlets with request/response mocking was added, this should make it easy.

example: https://github.com/wcm-io/wcm-io/blob/master/wcm/parsys/src/test/java/io/wcm/wcm/parsys/componentinfo/impl/ParsysComponentsServletTest.java

Activity

Show:
Igor Sechyn
October 9, 2014, 8:25 AM

done.

Stefan Seifert
October 8, 2014, 12:43 PM
Edited

thanks, two last remarks on this class:

  • you can remove the method sanityCheck - if the mandatory osgi references cannot be set, the servlet will not be started at all - the code is not reachable

  • please provide a unit test for the code path around getLockedParameterNames as well

Igor Sechyn
October 8, 2014, 11:34 AM

I have refactored the test for EditorParameterPersistence to use aem/sling mocks. currently testing the right values conversion from the request parameters to persistence data, by capturing the argument of the parameterPersistence service.

Fixed

Assignee

Unassigned

Reporter

Stefan Seifert

Labels

None

Components

Fix versions

Priority

Trivial