@Test
public void testToDXPVariant() throws PortalException {

	Boolean control = RandomTestUtil.randomBoolean();
	Locale locale = LocaleUtil.ENGLISH;
	String segmentsExperienceKey = RandomTestUtil.randomString();
	String segmentsExperienceName = RandomTestUtil.randomString();
	double split = RandomTestUtil.randomDouble();
	SegmentsExperimentRel segmentsExperimentRel =
		_createSegmentsExperimentRel(
			control, locale, segmentsExperienceKey, segmentsExperienceName,
			split);
	DXPVariant dxpVariant = DXPVariantUtil.toDXPVariant(
		locale, segmentsExperimentRel);
	Assert.assertEquals(Integer.valueOf(0), dxpVariant.getChanges());
	Assert.assertEquals(
		segmentsExperimentRel.isControl(), dxpVariant.isControl());
	Assert.assertEquals(
		segmentsExperimentRel.getSegmentsExperienceKey(),
		dxpVariant.getDXPVariantId());
	Assert.assertEquals(
		segmentsExperimentRel.getName(locale),
		dxpVariant.getDXPVariantName());
	Assert.assertEquals(
		segmentsExperimentRel.getSplit(),
		dxpVariant.getTrafficSplit() / 100, 0.001);
}