Testcontainers timed out waiting for URL to be accessible | Mockserver Mac M1 compatibility

Exception looks like this: Suppose you want to start mockserver docker image on Mac M1. Probably you doing something like this: Most likely this error happens because of poor docker x86-64 image compatibility with the ARM (M1) CPU architecture. If you see carefully, then you can find out that some versions of mockserver images (including […]

READ MORE

JAAS / Kerberos / Digest stub with Mockito

You need to test the functionality of method X. It does the following things: Performs authentication using JAAS; If authentication is successful, it continues to work. It’s often problematic to set up a working authentication mechanism in a unit test environment. One solution to the problem is to set a stub on the login() method […]

READ MORE

REST endpoint stub in JUnit

Suppose you want to test method X. It requests data from a specific endpoint Y. In this article, we’ll talk about three things: how to start a REST server within a unit test; how to set up data transmission on Y; how to check the number of requests received on Y. For information on how […]

READ MORE