Skip to content

Commit

Permalink
#25785 fix test 22.03.9
Browse files Browse the repository at this point in the history
  • Loading branch information
erickgonzalez committed Aug 16, 2023
1 parent bbd34c0 commit a8362c8
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -970,16 +970,19 @@ public void whenPublishAndExpireDatesAreInTheFutureAndTimeMachineIsAfterBoth() {
public void test_find_multilingual_contentlet_getContentletSuccessfully() throws DotSecurityException, DotDataException {
final Host host = new SiteDataGen().nextPersisted();
final long spanishLangId = TestDataUtils.getSpanishLanguage().getId();
Contentlet contentlet = TestDataUtils.getGenericContentContent(true,1,host);
Contentlet contentletNewLang = APILocator.getContentletAPI().checkout(contentlet.getInode(),user,false);
final int sessionLanguage = 1;
final Contentlet contentlet = TestDataUtils.getGenericContentContent(true, sessionLanguage, host);
final Contentlet contentletNewLang = APILocator.getContentletAPI().checkout(contentlet.getInode(), user, false);
contentletNewLang.setLanguageId(spanishLangId);
APILocator.getContentletAPI().checkin(contentletNewLang,user,false);

Contentlet contentletFound = ContentUtils.find(contentlet.getIdentifier(),user,false,1);

assertEquals(contentlet.getInode(),contentletFound.getInode());
assertEquals(contentlet.getLanguageId(),contentletFound.getLanguageId());

APILocator.getContentletAPI().checkin(contentletNewLang, user, false);
final boolean workingVersion = Boolean.TRUE;
final Contentlet contentletFound = ContentUtils.find(contentlet.getIdentifier(), user, workingVersion,
sessionLanguage);

assertEquals("Contentlet created with session language must match the one retrieved via the API",
contentlet.getInode(), contentletFound.getInode());
assertEquals("Contentlet created with session language and the one retrieved via the API must have the same " +
"language ID", contentlet.getLanguageId(), contentletFound.getLanguageId());
}

/**
Expand Down

0 comments on commit a8362c8

Please sign in to comment.