Last active
July 11, 2018 13:59
-
-
Save safebear/17cdd5e96c4585d862797f32dfaf4ef5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.safebear.tasklist.model; | |
import org.assertj.core.api.Assertions; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager; | |
import org.springframework.test.context.junit4.SpringRunner; | |
import java.time.LocalDate; | |
@org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest | |
@RunWith(SpringRunner.class) | |
public class DataJpaTest { | |
@Autowired | |
private TestEntityManager tem; | |
@Test | |
public void mapping(){ | |
LocalDate localDate = LocalDate.now(); | |
Task task = this.tem.persistFlushFind(new Task(null, "Mop the floors", localDate, false)); | |
Assertions.assertThat(task.getId()).isNotNull(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment