This post was written together with +Aslak Knutsen (@aslakknutsen).
JPA type converters provide an easy way to define how an entity
attribute gets persisted to the database. You can use them to implement
lots of different features, e.g. to encrypt your data as I showed in a
previous post: How to use a JPA Type Converter to encrypt your data
But writing the type converter is not enough. We also need to make sure, that it is working correctly.
In general, there are two ways to test a type
converter. We could write a unit test to check, if the conversion works
correctly. But a unit test performs a test of the isolated class without
putting it into the real execution environment. That means that we will
still not know, if the converter works in one of our applications. If
everything is set up correctly, the persistence provider will call the
converter before writing to and after reading from the database. So we
also need to check if the type converter gets called by the persistence
provider and if everything works fine under that condition. We need to
test the converter inside of the container we want to use for our
application.
We will have a look at how this can be done with Arquillian and its persistence extension.
Showing posts with label Arquillian. Show all posts
Showing posts with label Arquillian. Show all posts
JBoss Forge - Speedup your enterprise development - Part III Integration Tests with Arquillian
In this third part of the JBoss Forge series, I will show you how to search and install plugins to extend the JBoss Forge functionality. After that we will use Forge to setup Arquillian and create an integration test for our webservice.
If you are new to this series, make sure to check the first two parts.
In the first part, we installed JBoss Tools to get JBoss Forge eclipse integration. Then we created a Java EE project with the entities Book and Author and generated a web interface based on these entities.
In the second part, we created a RESTful webservice API for our entities.
If you are new to this series, make sure to check the first two parts.
In the first part, we installed JBoss Tools to get JBoss Forge eclipse integration. Then we created a Java EE project with the entities Book and Author and generated a web interface based on these entities.
In the second part, we created a RESTful webservice API for our entities.
- JBoss Forge - Speedup your enterprise development
- JBoss Forge - Speedup your enterprise development - Part II RESTful Webservices
- JBoss Forge - Speedup your enterprise development - Part III Integration Tests with Arquillian
Subscribe to:
Posts (Atom)