|
|
|
|
@ -1,14 +1,14 @@ |
|
|
|
|
package de.kreth.vaadin.clubhelper.vaadinclubhelper.dao; |
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals; |
|
|
|
|
|
|
|
|
|
import java.time.ZoneId; |
|
|
|
|
import java.time.ZonedDateTime; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import org.hibernate.query.Query; |
|
|
|
|
import org.junit.Ignore; |
|
|
|
|
import org.junit.Test; |
|
|
|
|
import org.junit.jupiter.api.Disabled; |
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
import org.junit.runner.RunWith; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
|
|
|
|
@ -21,7 +21,7 @@ import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubEventBuilder; |
|
|
|
|
@RunWith(SpringRunner.class) |
|
|
|
|
@DataJpaTest |
|
|
|
|
@EnableAutoConfiguration |
|
|
|
|
@Ignore |
|
|
|
|
@Disabled |
|
|
|
|
public class ClubEventDaoTest extends AbstractDatabaseTest { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
@ -34,20 +34,16 @@ public class ClubEventDaoTest extends AbstractDatabaseTest { |
|
|
|
|
public void storeEvent() { |
|
|
|
|
dao.save(creteEvent()); |
|
|
|
|
|
|
|
|
|
Query<ClubEvent> query = session.createNamedQuery("ClubEvent.findAll", |
|
|
|
|
ClubEvent.class); |
|
|
|
|
Query<ClubEvent> query = session.createNamedQuery("ClubEvent.findAll", ClubEvent.class); |
|
|
|
|
List<ClubEvent> result = query.list(); |
|
|
|
|
assertEquals(1, result.size()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ClubEvent creteEvent() { |
|
|
|
|
ClubEvent ev = ClubEventBuilder.builder().withId("id").withAllDay(true) |
|
|
|
|
.withCaption("caption").withDescription("description") |
|
|
|
|
.withStart(ZonedDateTime.of(2018, 8, 13, 0, 0, 0, 0, |
|
|
|
|
ZoneId.systemDefault())) |
|
|
|
|
.withEnd(ZonedDateTime.of(2018, 8, 13, 0, 0, 0, 0, |
|
|
|
|
ZoneId.systemDefault())) |
|
|
|
|
.withiCalUID("iCalUID") |
|
|
|
|
ClubEvent ev = ClubEventBuilder.builder().withId("id").withAllDay(true).withCaption("caption") |
|
|
|
|
.withDescription("description") |
|
|
|
|
.withStart(ZonedDateTime.of(2018, 8, 13, 0, 0, 0, 0, ZoneId.systemDefault())) |
|
|
|
|
.withEnd(ZonedDateTime.of(2018, 8, 13, 0, 0, 0, 0, ZoneId.systemDefault())).withiCalUID("iCalUID") |
|
|
|
|
.withOrganizerDisplayName("organizerDisplayName").build(); |
|
|
|
|
return ev; |
|
|
|
|
} |
|
|
|
|
|