Prior JPA 2.1, most JPA providers (Hibernate, EclipseLink, OpenJPA) would have a proprietary way to generate the database schema (Data Definition Language scripts) from Entities. In the JPA 2.1 specification (JSR 338) there is a new section called 9.4 Schema Generation introducing an API and some properties to generate a database schema in a standard and portable way. Properties in persistence.xml In the history of JPA specification, we … Continue reading Generating Database Schemas with JPA 2.1
After the announcement of the NoMock Movement I had to write another post about integration testing. Here it goes : how to test your nice RESTful URIs ? Use Case Often you hear that URIs have to be expressive… and you want to test that your URIs are nicely written. How do you do that ? Unit testing with mock frameworks such as Restito or … Continue reading Test your JAX-RS 2.0 Web Service URIs… Without Mocks
I would like to thank Arnaud Heritier who gave me plenty of tips and advices to write this blog. In fact if you want to endorse someone on Maven in LinkedIn, he is the man, not me ;o) If you use Maven in your projects you might wonder what “Let’s Turn Integration Tests with Maven into a First-Class Citizen” means. A bit of introduction on that. … Continue reading Let’s Turn Integration Tests with Maven to a First-Class Citizen
Everything started when Eve said ‘No‘ when God told her not to eat the fruit. Then my daughter said ‘No‘ when I told her to clean her room. Then we had a bunch of guys saying ‘No‘ to SQL. Then I read Is there such a thing as the NoMock movement?… And today I’m saying let’s launch the NoMock Movement ( ‘No‘ meaning Not Only of course … Continue reading Launching The NoMock Movement
A short blog about a topic I was discussing last week with a customer: testing SOAP Web Services. If you follow my blog you would know by now that I’m not a fan of unit testing in MOCK environments. Not because I don’t like it or I have religious believes that don’t allow me to use JUnit and Mockito. It’s just because with the work I do (mostly … Continue reading No, you don’t need to mock your SOAP Web Service to test it
I’m fed up with unit testing !
It’s 2012 and my first resolution of the year is to finally tell the truth about testing : unit testing is pretty much useless when your code runs inside a container. How do you unit test an EJB which relies on the container services (i.e transaction, injection, security…) ? Well, you mock the database access, you mock your security layer, you mock your dependencies, you mock your validation layer… to test what ? A bit of business logic. Yes. Unit test is interesting when you have complex business logic to test so you can have quick feedback. Otherwise, it’s a waste of time which doesn’t test your container services. So I’m not saying unit testing is completely useless, I’m saying that integration testing is also to be considered when you run your code inside a Java EE container. Continue reading WYTIWYR : What You Test Is What You Run