Skip to content

Commit

Permalink
#31022 Setting host Id in Url Map events
Browse files Browse the repository at this point in the history
  • Loading branch information
freddyDOTCMS committed Jan 9, 2025
1 parent 3dbb005 commit d3302a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public CollectorPayloadBean collect(final CollectorContextMap collectorContextMa

if (Objects.nonNull(site)) {
collectorPayloadBean.put(SITE_NAME, site.getHostname());
collectorPayloadBean.put(SITE_ID, site.getIdentifier());
}
return collectorPayloadBean;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public void testPageDetailCollector() throws DotDataException, UnknownHostExcept
final Map<String, Object> expectedDataMap = Map.of(
Collector.EVENT_TYPE, EventType.PAGE_REQUEST.getType(),
Collector.SITE_NAME, testSite.getHostname(),
Collector.SITE_ID, testSite.getIdentifier(),
Collector.LANGUAGE, language.getIsoCode(),
Collector.URL, TEST_URL_MAP_DETAIL_PAGE_URL,
Collector.OBJECT, Map.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.dotmarketing.util.UtilMethods;
import com.dotmarketing.util.WebKeys;
import com.liferay.portal.model.User;
import graphql.AssertException;
import io.vavr.control.Try;

import javax.servlet.http.HttpServletRequest;
Expand Down Expand Up @@ -325,6 +326,8 @@ public static void validateExpectedEntries(final Map<String, Object> expectedDat
assertEquals("Collected value must be equal to expected value for key: " + key,
expectedValue, collectedValue);
}
} else {
throw new AssertException("Expected key in the Collected value: " + key);
}
}
}
Expand Down

0 comments on commit d3302a2

Please sign in to comment.