Files
VV-ISTIC-TP3/exercises/mocks.md
Romain Lefeuvre 7155dd77be 2025 init
2025-11-18 14:43:08 +01:00

12 lines
577 B
Markdown

# Mocks to the rescue
The classes `SSLSocket`, `TLSProtocol` and `TLSSocketFactory` are included in the `sockets` package of the [`tp3-ssl`](../code/tp3-ssl) project.
The test class `TLSSocketFactoryTest` tests `TLSSocketFactory` and manually builds stubs and mocks for SSLSocket objects.
Rewrite these tests with the help of Mockito.
The initial tests fail to completely test the `TLSSockeetFactory`. In fact, if we *entirely* remove the code inside the body of `prepareSocket` no test case fails.
Propose a solution to this problem in your new Mockito-based test cases.