Vet, Owner, Visit. The Visit "aggregate" is a little artificial
but it demonstrates a useful point about not holding on to
references of "parent" (reference data) objects, i.e. the Visit has
an Integer petId, instead of a Pet field. In principle this app is
now almost ready to migrate to multiple services if anyone wanted
to do that.
- remove custom xml view, use springboot builtin xml view
- remove oxm maven dependency
- remove json-simple maven dependency (seems not relevant anymore)
- update vetsXml test using xpath
- In the Jdbc implementation: pets belonging to a visit were not added.
- In the Jpa implementation: query variable was wrong.
- Test case: AbstractClinicServiceTests.shouldFindVisitsByPetId()
There seems to be a conflict between the following:
1) New MVC namespace syntax:
<mvc:content-negotiation use-not-acceptable="true">
<mvc:default-views>
<bean class="org.springframework.web.servlet.view.JstlView">
<property name="url" value="" />
</bean>
</mvc:default-views>
</mvc:content-negotiation>
2) Inside my Unit test:
ResultActions actions =
this.mockMvc.perform(get("/vets.xml").accept(MediaType.TEXT_XML));
actions.andDo(print()); // action is logged into the console
actions.andExpect(status().isOk());
Test in error with french default Locale:
org.junit.ComparisonFailure: expected:<[ne peut pas être vide]> but was:<[may not be empty]>
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at org.springframework.samples.petclinic.model.ValidatorTests.emptyFirstName(ValidatorTests.java:39)
- test didn't have the suffix "Tests" so it was not taken into account
when running Maven in the comand line
- the POM was not configured so it can find Spring config files placed
inside src/test/java