Skip to content

Conversation

@SirAnimesh
Copy link
Contributor

@SirAnimesh SirAnimesh commented Mar 6, 2025

Using spring-test to mock HttpServletRequest and HttpServletResponse interfaces, improves the mocks used and quality of tests. This PR compares out of the box tests with no mocks (#4).

Also see coverage improvements gained by using Mockito mocks instead of spring-test mocks in #5.

Test creation summary for module: com.diffblue.pov:java-ee-servlet
------------------------------------------------------------------
Total:                                              82 methods
46 tests created for:                               62 methods
19 partial tests created for:                       19 methods
                                                              
No tests created for:                               20 methods
    16 R011: Sandboxing policy violation                     
     3 R002: Missing observers                               
     1 R081: Exception in arrange section                    
                                                              
Diffblue tests cover 216 of 593 lines to cover (36.4%)
Manual tests cover 0 of 593 lines to cover (0.0%)

Baeldung • How to Mock HttpServletRequest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants