-
-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,10 @@ public static void initEnv() { | |
} | ||
|
||
private Pair<Event, String> initEvent(List<TicketCategoryModification> categories) { | ||
return initEvent(categories, "display name"); | ||
} | ||
|
||
private Pair<Event,String> initEvent(List<TicketCategoryModification> categories, String displayName) { | ||
String organizationName = UUID.randomUUID().toString(); | ||
String username = UUID.randomUUID().toString(); | ||
String eventName = UUID.randomUUID().toString(); | ||
|
@@ -102,7 +106,7 @@ private Pair<Event, String> initEvent(List<TicketCategoryModification> categorie | |
userManager.insertUser(organization.getId(), username, "test", "test", "[email protected]"); | ||
|
||
EventModification em = new EventModification(null, "url", "url", "url", null, | ||
eventName, organization.getId(), | ||
eventName, displayName, organization.getId(), | ||
"muh location", "muh description", | ||
new DateTimeModification(LocalDate.now().plusDays(5), LocalTime.now()), | ||
new DateTimeModification(LocalDate.now().plusDays(5), LocalTime.now().plusHours(1)), | ||
|
@@ -183,4 +187,25 @@ public void testAlreadyMigratedEvent() { | |
assertEquals(AVAILABLE_SEATS, tickets.size());//<-- the migration has not been done | ||
assertTrue(tickets.stream().allMatch(t -> t.getCategoryId() == null)); | ||
} | ||
|
||
@Test | ||
public void testUpdateDisplayName() { | ||
List<TicketCategoryModification> categories = Collections.singletonList( | ||
new TicketCategoryModification(null, "default", AVAILABLE_SEATS, | ||
new DateTimeModification(LocalDate.now(), LocalTime.now()), | ||
new DateTimeModification(LocalDate.now(), LocalTime.now()), | ||
"desc", BigDecimal.TEN, false, "", false)); | ||
Event event = initEvent(categories, null).getKey(); | ||
|
||
dataMigrator.migrateEventsToCurrentVersion(); | ||
EventMigration eventMigration = eventMigrationRepository.loadEventMigration(event.getId()); | ||
assertNotNull(eventMigration); | ||
assertEquals(buildTimestamp, eventMigration.getBuildTimestamp().toString()); | ||
assertEquals(currentVersion, eventMigration.getCurrentVersion()); | ||
|
||
Event withDescription = eventRepository.findById(event.getId()); | ||
assertNotNull(withDescription.getDisplayName()); | ||
assertEquals(event.getShortName(), withDescription.getShortName()); | ||
assertEquals(event.getShortName(), withDescription.getDisplayName()); | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ public static Pair<Event, String> initEvent(List<TicketCategoryModification> cat | |
userManager.insertUser(organization.getId(), username, "test", "test", "[email protected]"); | ||
|
||
EventModification em = new EventModification(null, "url", "url", "url", null, | ||
eventName, organization.getId(), | ||
eventName, "event display name", organization.getId(), | ||
"muh location", "muh description", | ||
new DateTimeModification(LocalDate.now().plusDays(5), LocalTime.now()), | ||
new DateTimeModification(LocalDate.now().plusDays(5), LocalTime.now().plusHours(1)), | ||
|