Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit d8ab2f8

Browse files
Merge branch 'development' of https://github.com/hzi-braunschweig/SORMAS-Project into development
2 parents c696df3 + 496df0d commit d8ab2f8

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

sormas-backend/src/main/resources/sql/sormas_schema.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5538,4 +5538,9 @@ ALTER TABLE events ALTER COLUMN eventdesc DROP NOT NULL;
55385538

55395539
INSERT INTO schema_version (version_number, comment) VALUES (273, 'Drop not null constraint from event description #3223');
55405540

5541+
-- 2020-11-05 Drop not null constraint from event history description #3391
5542+
ALTER TABLE events_history ALTER COLUMN eventdesc DROP NOT NULL;
5543+
5544+
INSERT INTO schema_version (version_number, comment) VALUES (274, 'Drop not null constraint from event history description #3391');
5545+
55415546
-- *** Insert new sql commands BEFORE this line ***

sormas-backend/src/test/java/de/symeda/sormas/backend/event/EventFacadeEjbTest.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import java.util.List;
3030

3131
import org.hamcrest.Matchers;
32+
import org.jboss.weld.bean.builtin.FacadeInjectionPoint;
33+
import org.junit.Assert;
3234
import org.junit.Test;
3335

3436
import de.symeda.sormas.api.Disease;
@@ -127,6 +129,39 @@ public void testEventDeletion() {
127129
assertNull(getActionFacade().getByUuid(action.getUuid()));
128130
}
129131

132+
@Test
133+
public void testEventUpdate() {
134+
135+
RDCF rdcf = creator.createRDCF("Region", "District", "Community", "Facility");
136+
UserDto user = creator
137+
.createUser(rdcf.region.getUuid(), rdcf.district.getUuid(), rdcf.facility.getUuid(), "Surv", "Sup", UserRole.SURVEILLANCE_SUPERVISOR);
138+
UserDto admin = creator.createUser(rdcf.region.getUuid(), rdcf.district.getUuid(), rdcf.facility.getUuid(), "Ad", "Min", UserRole.ADMIN);
139+
EventDto event = creator.createEvent(
140+
EventStatus.SIGNAL,
141+
EventInvestigationStatus.PENDING,
142+
"Title",
143+
null,
144+
"First",
145+
"Name",
146+
"12345",
147+
TypeOfPlace.PUBLIC_PLACE,
148+
null,
149+
new Date(),
150+
user.toReference(),
151+
user.toReference(),
152+
Disease.EVD,
153+
rdcf.district);
154+
155+
final String testDescription = "testDescription";
156+
final Date startDate = DateHelper.subtractDays(new Date(), 1);
157+
event.setEventDesc(testDescription);
158+
event.setStartDate(startDate);
159+
160+
final EventDto updatedEvent = getEventFacade().saveEvent(event);
161+
Assert.assertEquals(testDescription, updatedEvent.getEventDesc());
162+
Assert.assertEquals(startDate, updatedEvent.getStartDate());
163+
}
164+
130165
@Test
131166
public void testGetIndexList() {
132167

0 commit comments

Comments
 (0)