2025 init

This commit is contained in:
Romain Lefeuvre
2025-11-18 14:43:08 +01:00
commit 7155dd77be
39 changed files with 1134 additions and 0 deletions

11
exercises/mocks.md Normal file
View File

@@ -0,0 +1,11 @@
# 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.