use of org.apache.unomi.api.PropertyType in project unomi by apache.
the class CopyPropertiesActionIT method initializePropertyType.
private void initializePropertyType() {
Metadata metadata = new Metadata();
metadata.setSystemTags(new HashSet<>(Arrays.asList("urlParameters")));
metadata.setId(ARRAY_PARAM_NAME);
metadata.setName("Array parameter");
PropertyType propertyType1 = new PropertyType();
propertyType1.setItemId(ARRAY_PARAM_NAME);
propertyType1.setMetadata(metadata);
propertyType1.setTarget("profiles");
propertyType1.setValueTypeId("string");
propertyType1.setMultivalued(true);
Metadata metadata2 = new Metadata();
metadata2.setSystemTags(new HashSet<>(Arrays.asList("urlParameters")));
metadata2.setId(SINGLE_PARAM_NAME);
metadata2.setName("Single parameters");
PropertyType propertyType2 = new PropertyType();
propertyType2.setItemId(SINGLE_PARAM_NAME);
propertyType2.setMetadata(metadata2);
propertyType2.setTarget("profiles");
propertyType2.setValueTypeId("string");
propertyType2.setMultivalued(false);
profileService.setPropertyType(propertyType1);
profileService.setPropertyType(propertyType2);
}
use of org.apache.unomi.api.PropertyType in project unomi by apache.
the class CopyPropertiesActionIT method initializePropertyTypeWithMapping.
private void initializePropertyTypeWithMapping() {
Metadata metadata = new Metadata();
metadata.setId(MAPPED_PROPERTY);
metadata.setName("single parameter");
PropertyType propertyType1 = new PropertyType();
propertyType1.setItemId(MAPPED_PROPERTY);
propertyType1.setMetadata(metadata);
propertyType1.setTarget("profiles");
propertyType1.setValueTypeId("string");
propertyType1.setMultivalued(false);
propertyType1.setAutomaticMappingsFrom(new HashSet<>(Arrays.asList(PROPERTY_TO_MAP)));
profileService.setPropertyType(propertyType1);
}
use of org.apache.unomi.api.PropertyType in project unomi by apache.
the class CopyPropertiesActionIT method initializePropertyTypeWithDifferentSystemTag.
private void initializePropertyTypeWithDifferentSystemTag() {
Metadata metadata = new Metadata();
metadata.setSystemTags(new HashSet<>(Arrays.asList("shouldBeAbsent")));
metadata.setId(ARRAY_PARAM_NAME);
metadata.setName("Array parameter");
PropertyType propertyType1 = new PropertyType();
propertyType1.setItemId(ARRAY_PARAM_NAME);
propertyType1.setMetadata(metadata);
propertyType1.setTarget("profiles");
propertyType1.setValueTypeId("string");
propertyType1.setMultivalued(true);
profileService.setPropertyType(propertyType1);
}
use of org.apache.unomi.api.PropertyType in project unomi by apache.
the class PatchIT method testOverride.
@Test
public void testOverride() throws IOException, InterruptedException {
PropertyType gender = profileService.getPropertyType("gender");
try {
Patch patch = CustomObjectMapper.getObjectMapper().readValue(bundleContext.getBundle().getResource("patch2.json"), Patch.class);
PropertyType newGender = (PropertyType) patchService.patch(patch);
Assert.assertEquals("foo", newGender.getDefaultValue());
profileService.refresh();
newGender = profileService.getPropertyType("gender");
Assert.assertEquals("foo", newGender.getDefaultValue());
} finally {
profileService.setPropertyType(gender);
}
}
use of org.apache.unomi.api.PropertyType in project unomi by apache.
the class CDPPropertyInterface method tags.
@GraphQLField
default Set<String> tags() {
final PropertyType type = getType();
if (type == null) {
return null;
}
final Metadata meta = type.getMetadata();
return meta != null ? meta.getTags() : null;
}
Aggregations