forked from DevFW-CICD/spring-petclinic
migrated all dates to joda time
This commit is contained in:
parent
c4b5a98ac8
commit
d88b565d28
13 changed files with 63 additions and 38 deletions
|
|
@ -4,8 +4,8 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.samples.petclinic.repository.OwnerRepository;
|
||||
|
|
@ -124,7 +124,7 @@ public abstract class AbstractPetRepositoryTests {
|
|||
pet.setName("bowser");
|
||||
Collection<PetType> types = this.petRepository.findPetTypes();
|
||||
pet.setType(EntityUtils.getById(types, PetType.class, 2));
|
||||
pet.setBirthDate(new Date());
|
||||
pet.setBirthDate(new DateTime());
|
||||
o6.addPet(pet);
|
||||
assertEquals(found + 1, o6.getPets().size());
|
||||
// both storePet and storeOwner are necessary to cover all ORM tools
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.samples.petclinic.Pet;
|
||||
|
|
@ -55,14 +56,14 @@ public class VisitsAtomViewTest {
|
|||
bello.setType(dog);
|
||||
Visit belloVisit = new Visit();
|
||||
belloVisit.setPet(bello);
|
||||
belloVisit.setDate(new Date(2009, 0, 1));
|
||||
belloVisit.setDate(new DateTime(2009, 1, 1,1,1));
|
||||
belloVisit.setDescription("Bello visit");
|
||||
Pet wodan = new Pet();
|
||||
wodan.setName("Wodan");
|
||||
wodan.setType(dog);
|
||||
Visit wodanVisit = new Visit();
|
||||
wodanVisit.setPet(wodan);
|
||||
wodanVisit.setDate(new Date(2009, 0, 2));
|
||||
wodanVisit.setDate(new DateTime(2009, 1, 2,1,1));
|
||||
wodanVisit.setDescription("Wodan visit");
|
||||
List<Visit> visits = new ArrayList<Visit>();
|
||||
visits.add(belloVisit);
|
||||
|
|
@ -80,7 +81,7 @@ public class VisitsAtomViewTest {
|
|||
|
||||
assertNotNull("No id set", feed.getId());
|
||||
assertNotNull("No title set", feed.getTitle());
|
||||
assertEquals("Invalid update set", new Date(2009, 0, 2), feed.getUpdated());
|
||||
assertEquals("Invalid update set", new DateTime(2009, 1, 2,1,1).toDate(), feed.getUpdated());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue