Mock final classes with Mockito

One of the standard Mockito related questions I’ve come across is online is “Can we mock final classes with Mockito?”. The answer to this question since Mockito 2 was introduced is “Yes, we can.”. Example code This is the test I would like to be able to run: @ExtendWith(MockitoExtension.class) class PersonTest { @Mock PinProvider pinProvider; @Test public void shouldCreatePersonWithCorrectPin() { …

Using Mockito with JUnit 5

Since version 2.16.3 Mockito has official support for Junit5. Using Mockito with JUnit now is even easier than before. Previously I kept forgetting what rule I was supposed to use for injecting the mocks, and how I set the strictness again? Plus the extra field in each test class! Mockito with JUnit 5 example The newly introduced extension is not part of …

Install HTTPS certificates in Amazon Lightsail

The intention of this post is to explain how you can install HTTPS certificates on your Amazon Lightsail WordPress site.  Amazon Lightsail uses Bitnami containers. All the information about how to setup things in Bitnami is the same for Amazon Lightsail as well. I did these steps for my blog that uses a Lightsail WordPress container. It is actually a pre-configured …