Tag: H2

Using H2 as in memory database for unit/component tests instead of MySQL

h2 database

So following my recent post regarding the creation of a component test framework – let’s take a closer look in the use case of using H2 as a lightweight in memory database instead of MySQL, for your unit/component tests. Benefits of using H2 instead of MySQL It makes a lot of sense to use H2 in the context of component tests instead of MySQL: You can create and destroy a DB/table/data on the fly – once the tests are done the DB disappears. Compare this to having to rollback manually every change …

Creating a component test framework

component tests

If you have been reading Martin Fowler’s canonical article on the test pyramid, you know that there is a mystical layer that hides between those braod unit tests (the base of the pyramid) and the integration tests layer (near the top). This layer is called: component tests. This article is about the following : What are component tests? Why should you care, and how to implement them properly? What are component tests and why should you care? Basically component tests are the the part that theoretically should allow you to isolate a …