use of org.pentaho.metadata.model.concept.Concept in project pentaho-kettle by pentaho.
the class ConceptUtilTest method testGetString.
@Test
public void testGetString() throws Exception {
final Concept concept = mock(Concept.class);
final String id = "id";
final String result = "result";
when(concept.getProperty(eq(id))).thenReturn(result);
final String string = ConceptUtil.getString(concept, id);
assertEquals(result, string);
}
use of org.pentaho.metadata.model.concept.Concept in project pentaho-kettle by pentaho.
the class ConceptUtilTest method testGetTableTypeConcept.
@Test
public void testGetTableTypeConcept() throws Exception {
final Concept concept = mock(Concept.class);
TableType tableType = ConceptUtil.getTableType(concept);
assertEquals(TableType.OTHER, tableType);
final TableType result = TableType.FACT;
when(concept.getProperty(eq(DefaultPropertyID.TABLE_TYPE.getId()))).thenReturn(result);
tableType = ConceptUtil.getTableType(concept);
assertEquals(result, tableType);
}
use of org.pentaho.metadata.model.concept.Concept in project pentaho-kettle by pentaho.
the class ConceptUtilTest method testGetName.
@Test
public void testGetName() throws Exception {
final Concept concept = mock(Concept.class);
final LocalizedString localizedString = mock(LocalizedString.class);
final String result = "result";
when(localizedString.getLocalizedString(eq(locale))).thenReturn(result);
when(concept.getProperty(anyString())).thenReturn(localizedString);
final String name = ConceptUtil.getName(concept, locale);
verify(localizedString, times(1)).getLocalizedString(eq(locale));
assertEquals(result, name);
}
use of org.pentaho.metadata.model.concept.Concept in project pentaho-kettle by pentaho.
the class ConceptUtilTest method testGetDescription.
@Test
public void testGetDescription() throws Exception {
final Concept concept = mock(Concept.class);
final LocalizedString localizedString = mock(LocalizedString.class);
final String result = "result";
when(localizedString.getLocalizedString(eq(locale))).thenReturn(result);
when(concept.getProperty(anyString())).thenReturn(localizedString);
final String description = ConceptUtil.getDescription(concept, locale);
verify(localizedString, times(1)).getLocalizedString(eq(locale));
assertEquals(result, description);
}
Aggregations