A more modern way to write Sling Servlets will be to write it with the OSGI DS 1.4 (R7) annotations. For instance, a Sling Servlet registered by resource types can utilise this annotation @SlingServletResourceType.
Writing unit tests for @SlingServletResourceType is very simple. Utilising the AEM Mocks JUnit library, First, you would need to instantiate the Sling Servlet object. Thereafter, you would need to pass in the Sling request and response (wcm.testing.io) mock objects to the doGet() method. Finally, you can start your assertion tests.