use of org.finra.herd.model.api.xml.TagChild in project herd by FINRAOS.
the class TagServiceTest method testGetTagsUpperCaseParameters.
@Test
public void testGetTagsUpperCaseParameters() {
// Create and persist a tag type entity.
TagTypeEntity tagTypeEntity = tagTypeDaoTestHelper.createTagTypeEntity(TAG_TYPE, TAG_TYPE_DISPLAY_NAME, TAG_TYPE_ORDER, TAG_TYPE_DESCRIPTION);
// Create and persist two tag entities for the same tag type.
tagDaoTestHelper.createTagEntity(tagTypeEntity, TAG_CODE, TAG_DISPLAY_NAME, TAG_SEARCH_SCORE_MULTIPLIER, TAG_DESCRIPTION);
tagDaoTestHelper.createTagEntity(tagTypeEntity, TAG_CODE_2, TAG_TYPE_DISPLAY_NAME_2, TAG_SEARCH_SCORE_MULTIPLIER_2, TAG_DESCRIPTION);
// Retrieve a list of tag keys using uppercase input parameters.
TagListResponse resultTagKeys = tagService.getTags(TAG_TYPE.toUpperCase(), NO_PARENT_TAG_CODE);
// Validate the returned object.
assertNotNull(resultTagKeys);
assertEquals(Arrays.asList(new TagChild(new TagKey(TAG_TYPE, TAG_CODE), TAG_HAS_NO_CHILDREN), new TagChild(new TagKey(TAG_TYPE, TAG_CODE_2), TAG_HAS_NO_CHILDREN)), resultTagKeys.getTagChildren());
}
use of org.finra.herd.model.api.xml.TagChild in project herd by FINRAOS.
the class TagServiceTest method testGetTagsTrimParameters.
@Test
public void testGetTagsTrimParameters() {
// Create and persist a tag type entity.
TagTypeEntity tagTypeEntity = tagTypeDaoTestHelper.createTagTypeEntity(TAG_TYPE, TAG_TYPE_DISPLAY_NAME, TAG_TYPE_ORDER, TAG_TYPE_DESCRIPTION);
// Create and persist two tag entities for the same tag type.
tagDaoTestHelper.createTagEntity(tagTypeEntity, TAG_CODE, TAG_DISPLAY_NAME, TAG_SEARCH_SCORE_MULTIPLIER, TAG_DESCRIPTION);
tagDaoTestHelper.createTagEntity(tagTypeEntity, TAG_CODE_2, TAG_TYPE_DISPLAY_NAME_2, TAG_SEARCH_SCORE_MULTIPLIER_2, TAG_DESCRIPTION_2);
// Retrieve a list of tag keys using input parameters with leading and trailing empty spaces.
TagListResponse resultTagKeys = tagService.getTags(addWhitespace(TAG_TYPE), NO_PARENT_TAG_CODE);
// Validate the returned object.
assertNotNull(resultTagKeys);
assertEquals(Arrays.asList(new TagChild(new TagKey(TAG_TYPE, TAG_CODE), TAG_HAS_NO_CHILDREN), new TagChild(new TagKey(TAG_TYPE, TAG_CODE_2), TAG_HAS_NO_CHILDREN)), resultTagKeys.getTagChildren());
}
use of org.finra.herd.model.api.xml.TagChild in project herd by FINRAOS.
the class TagServiceTest method testGetTagsLowerCaseParameters.
@Test
public void testGetTagsLowerCaseParameters() {
// Create and persist a tag type entity.
TagTypeEntity tagTypeEntity = tagTypeDaoTestHelper.createTagTypeEntity(TAG_TYPE, TAG_TYPE_DISPLAY_NAME, TAG_TYPE_ORDER, TAG_TYPE_DESCRIPTION);
// Create and persist two tag entities for the same tag type.
tagDaoTestHelper.createTagEntity(tagTypeEntity, TAG_CODE, TAG_DISPLAY_NAME, TAG_SEARCH_SCORE_MULTIPLIER, TAG_DESCRIPTION);
tagDaoTestHelper.createTagEntity(tagTypeEntity, TAG_CODE_2, TAG_TYPE_DISPLAY_NAME_2, TAG_DESCRIPTION_2);
// Retrieve a list of tag keys using lowercase input parameters.
TagListResponse resultTagKeys = tagService.getTags(addWhitespace(TAG_TYPE), NO_PARENT_TAG_CODE);
// Validate the returned object.
assertNotNull(resultTagKeys);
assertEquals(Arrays.asList(new TagChild(new TagKey(TAG_TYPE, TAG_CODE), TAG_HAS_NO_CHILDREN), new TagChild(new TagKey(TAG_TYPE, TAG_CODE_2), TAG_HAS_NO_CHILDREN)), resultTagKeys.getTagChildren());
}
Aggregations