Search in sources :

Example 1 with DriversLicense

use of org.springframework.test.context.junit4.orm.domain.DriversLicense in project spring-framework-debug by Joker-5.

the class HibernateSessionFlushingTests method findSam.

@Test
public void findSam() {
    Person sam = personService.findByName(SAM);
    assertThat(sam).as("Should be able to find Sam").isNotNull();
    DriversLicense driversLicense = sam.getDriversLicense();
    assertThat(driversLicense).as("Sam's driver's license should not be null").isNotNull();
    assertThat(driversLicense.getNumber()).as("Verifying Sam's driver's license number").isEqualTo(Long.valueOf(1234));
}
Also used : DriversLicense(org.springframework.test.context.junit4.orm.domain.DriversLicense) Person(org.springframework.test.context.junit4.orm.domain.Person) Test(org.junit.Test)

Example 2 with DriversLicense

use of org.springframework.test.context.junit4.orm.domain.DriversLicense in project spring-framework-5.2.9.RELEASE by somepeopleHavingDream.

the class HibernateSessionFlushingTests method findSam.

@Test
public void findSam() {
    Person sam = personService.findByName(SAM);
    assertThat(sam).as("Should be able to find Sam").isNotNull();
    DriversLicense driversLicense = sam.getDriversLicense();
    assertThat(driversLicense).as("Sam's driver's license should not be null").isNotNull();
    assertThat(driversLicense.getNumber()).as("Verifying Sam's driver's license number").isEqualTo(Long.valueOf(1234));
}
Also used : DriversLicense(org.springframework.test.context.junit4.orm.domain.DriversLicense) Person(org.springframework.test.context.junit4.orm.domain.Person) Test(org.junit.Test)

Example 3 with DriversLicense

use of org.springframework.test.context.junit4.orm.domain.DriversLicense in project today-infrastructure by TAKETODAY.

the class HibernateSessionFlushingTests method saveJuergenWithDriversLicense.

@Test
public void saveJuergenWithDriversLicense() {
    DriversLicense driversLicense = new DriversLicense(2L, 2222L);
    Person juergen = new Person(JUERGEN, driversLicense);
    int numRows = countRowsInTable("person");
    personService.save(juergen);
    assertThat(countRowsInTable("person")).as("Verifying number of rows in the 'person' table.").isEqualTo((numRows + 1));
    Assertions.assertThat(personService.findByName(JUERGEN)).as("Should be able to save and retrieve Juergen").isNotNull();
    assertThat(juergen.getId()).as("Juergen's ID should have been set").isNotNull();
}
Also used : DriversLicense(cn.taketoday.test.context.junit4.orm.domain.DriversLicense) Person(cn.taketoday.test.context.junit4.orm.domain.Person) Test(org.junit.Test)

Example 4 with DriversLicense

use of org.springframework.test.context.junit4.orm.domain.DriversLicense in project spring-framework by bluecrow1986.

the class HibernateSessionFlushingTests method findSam.

@Test
public void findSam() {
    Person sam = personService.findByName(SAM);
    assertThat(sam).as("Should be able to find Sam").isNotNull();
    DriversLicense driversLicense = sam.getDriversLicense();
    assertThat(driversLicense).as("Sam's driver's license should not be null").isNotNull();
    assertThat(driversLicense.getNumber()).as("Verifying Sam's driver's license number").isEqualTo(Long.valueOf(1234));
}
Also used : DriversLicense(org.springframework.test.context.junit4.orm.domain.DriversLicense) Person(org.springframework.test.context.junit4.orm.domain.Person) Test(org.junit.Test)

Example 5 with DriversLicense

use of org.springframework.test.context.junit4.orm.domain.DriversLicense in project spring-framework by spring-projects.

the class HibernateSessionFlushingTests method findSam.

@Test
public void findSam() {
    Person sam = personService.findByName(SAM);
    assertThat(sam).as("Should be able to find Sam").isNotNull();
    DriversLicense driversLicense = sam.getDriversLicense();
    assertThat(driversLicense).as("Sam's driver's license should not be null").isNotNull();
    assertThat(driversLicense.getNumber()).as("Verifying Sam's driver's license number").isEqualTo(Long.valueOf(1234));
}
Also used : DriversLicense(org.springframework.test.context.junit4.orm.domain.DriversLicense) Person(org.springframework.test.context.junit4.orm.domain.Person) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)12 DriversLicense (org.springframework.test.context.junit4.orm.domain.DriversLicense)8 Person (org.springframework.test.context.junit4.orm.domain.Person)8 DriversLicense (cn.taketoday.test.context.junit4.orm.domain.DriversLicense)4 Person (cn.taketoday.test.context.junit4.orm.domain.Person)4