@Test public void customTermsOnlyUseTheLabel() throws XWikiException { ListProperty prop = mock(ListProperty.class); when(prop.getName()).thenReturn("omim_id"); Disorder d = new PhenoTipsDisorder(prop, "Sickness"); Assert.assertEquals("", d.getId()); Assert.assertEquals("Sickness", d.getName()); Assert.assertEquals("Sickness", d.getValue()); JSONObject json = d.toJSON(); Assert.assertFalse(json.has("id")); Assert.assertEquals("Sickness", json.getString("label")); }
@Override public String getValue() { if (StringUtils.isEmpty(getId())) { return getName(); } String id = StringUtils.removeStart(getId(), MIM_PREFIX); return id; }
PhenoTipsDisorder extends AbstractPhenoTipsVocabularyProperty implements Disorder { @Override public String getValue() { if (StringUtils.isEmpty(getId())) { return getName(); } String id = StringUtils.removeStart(getId(), MIM_PREFIX); return id; } }
PhenoTipsDisorder extends AbstractPhenoTipsVocabularyProperty implements Disorder { @Override public String getValue() { if (StringUtils.isEmpty(getId())) { return getName(); } String id = StringUtils.removeStart(getId(), MIM_PREFIX); return id; } PhenoTipsDisorder(ListProperty property, String value);  PhenoTipsDisorder(JSONObject json); }
PhenoTipsDisorder extends AbstractPhenoTipsVocabularyProperty implements Disorder { @Override public String getValue() { if (StringUtils.isEmpty(getId())) { return getName(); } String id = StringUtils.removeStart(getId(), MIM_PREFIX); return id; } PhenoTipsDisorder(ListProperty property, String value);  PhenoTipsDisorder(JSONObject json); @Override String getValue(); }
PhenoTipsDisorder extends AbstractPhenoTipsVocabularyProperty implements Disorder { @Override public String getValue() { if (StringUtils.isEmpty(getId())) { return getName(); } String id = StringUtils.removeStart(getId(), MIM_PREFIX); return id; } PhenoTipsDisorder(ListProperty property, String value);  PhenoTipsDisorder(JSONObject json); @Override String getValue();  }