if (!StringUtils.equalsIgnoreCase(tagTypeEntity.getDisplayName(), request.getDisplayName()))
if (!StringUtils.equalsIgnoreCase(tagTypeEntity.getDisplayName(), request.getDisplayName()))
@Test public void testGetTagTypeByDisplayName() { // Create a tag type entity. tagTypeDaoTestHelper.createTagTypeEntity(TAG_TYPE, TAG_TYPE_DISPLAY_NAME, TAG_TYPE_ORDER, TAG_TYPE_DESCRIPTION); // Retrieve the tag type entity. TagTypeEntity resultTagTypeEntity = tagTypeDao.getTagTypeByDisplayName(TAG_TYPE_DISPLAY_NAME); // Validate the results. assertEquals(TAG_TYPE, resultTagTypeEntity.getCode()); assertEquals(TAG_TYPE_DISPLAY_NAME, resultTagTypeEntity.getDisplayName()); assertEquals(new Integer(1), resultTagTypeEntity.getOrderNumber()); }
@Test public void testGetTagTypeByKey() { // Create a tag type entity. tagTypeDaoTestHelper.createTagTypeEntity(TAG_TYPE, TAG_TYPE_DISPLAY_NAME, TAG_TYPE_ORDER, TAG_TYPE_DESCRIPTION); // Retrieve the tag type entity. TagTypeEntity resultTagTypeEntity = tagTypeDao.getTagTypeByKey(new TagTypeKey(TAG_TYPE)); // Validate the results. assertEquals(TAG_TYPE, resultTagTypeEntity.getCode()); assertEquals(TAG_TYPE_DISPLAY_NAME, resultTagTypeEntity.getDisplayName()); assertEquals(new Integer(1), resultTagTypeEntity.getOrderNumber()); }
/** * Creates the tag type registration from the persisted entity. * * @param tagTypeEntity the tag type registration entity * @param includeDisplayName specifies to include the display name field * @param includeTagTypeOrder specifies to include the tag type order field * @param includeDescription specifies to include the description field * * @return the tag type registration */ private TagType createTagTypeFromEntity(TagTypeEntity tagTypeEntity, boolean includeDisplayName, boolean includeTagTypeOrder, boolean includeDescription) { TagType tagType = new TagType(); TagTypeKey tagTypeKey = new TagTypeKey(); tagType.setTagTypeKey(tagTypeKey); tagTypeKey.setTagTypeCode(tagTypeEntity.getCode()); if (includeDisplayName) { tagType.setDisplayName(tagTypeEntity.getDisplayName()); } if (includeTagTypeOrder) { tagType.setTagTypeOrder(tagTypeEntity.getOrderNumber()); } if (includeDescription) { tagType.setDescription(tagTypeEntity.getDescription()); } return tagType; }
/** * Creates the tag type registration from the persisted entity. * * @param tagTypeEntity the tag type registration entity * @param includeDisplayName specifies to include the display name field * @param includeTagTypeOrder specifies to include the tag type order field * @param includeDescription specifies to include the description field * * @return the tag type registration */ private TagType createTagTypeFromEntity(TagTypeEntity tagTypeEntity, boolean includeDisplayName, boolean includeTagTypeOrder, boolean includeDescription) { TagType tagType = new TagType(); TagTypeKey tagTypeKey = new TagTypeKey(); tagType.setTagTypeKey(tagTypeKey); tagTypeKey.setTagTypeCode(tagTypeEntity.getCode()); if (includeDisplayName) { tagType.setDisplayName(tagTypeEntity.getDisplayName()); } if (includeTagTypeOrder) { tagType.setTagTypeOrder(tagTypeEntity.getOrderNumber()); } if (includeDescription) { tagType.setDescription(tagTypeEntity.getDescription()); } return tagType; }