use of org.jboss.tools.openshift.internal.ui.wizard.newapp.ResourceDetailsContentProvider.ResourceProperty in project jbosstools-openshift by jbosstools.
the class ResourceDetailsContentProviderTest method shouldReturnResourcePropertyGivenBuildConfigBuildStrategyExists.
@Test
public void shouldReturnResourcePropertyGivenBuildConfigBuildStrategyExists() {
// given
IBuildConfig bc = createBuildConfig("42", null, null, null, null, null, null, createSourceBuildStrategy("42"));
// when
Object[] children = contentProvider.getChildren(bc);
// then
ResourceProperty property = getResourceProperty(ResourceDetailsContentProvider.LABEL_STRATEGY, children);
assertThat(property).isNotNull();
assertThat(property.isUnknownValue()).isFalse();
}
use of org.jboss.tools.openshift.internal.ui.wizard.newapp.ResourceDetailsContentProvider.ResourceProperty in project jbosstools-openshift by jbosstools.
the class ResourceDetailsLabelProviderTest method getStyledTextForResourcePropertyWithoutParams.
@Test
public void getStyledTextForResourcePropertyWithoutParams() {
ResourceProperty resourceProperty = mock(ResourceProperty.class);
when(resourceProperty.getProperty()).thenReturn("prop1");
when(resourceProperty.getValue()).thenReturn("property value");
assertEquals("Prop1: property value", labelsProvider.getStyledText(resourceProperty).toString());
}
use of org.jboss.tools.openshift.internal.ui.wizard.newapp.ResourceDetailsContentProvider.ResourceProperty in project jbosstools-openshift by jbosstools.
the class ResourceDetailsLabelProviderTest method getStyledTextForResourcePropertyWithParams.
@Test
public void getStyledTextForResourcePropertyWithParams() {
ResourceProperty resourceProperty = mock(ResourceProperty.class);
when(resourceProperty.getProperty()).thenReturn("Prop");
when(resourceProperty.getValue()).thenReturn("surname ${surname}");
assertEquals("Prop: surname Bocharov", labelsProvider.getStyledText(resourceProperty).toString());
}
use of org.jboss.tools.openshift.internal.ui.wizard.newapp.ResourceDetailsContentProvider.ResourceProperty in project jbosstools-openshift by jbosstools.
the class ResourceDetailsLabelProviderTest method getStyledTextForResourcePropertyWithParamsInMap.
@Test
public void getStyledTextForResourcePropertyWithParamsInMap() {
ResourceProperty resourceProperty = mock(ResourceProperty.class);
when(resourceProperty.getProperty()).thenReturn("Prop");
Map<String, String> params = new HashMap<>();
params.put("${name}", "is name");
params.put("surname", "${surname}");
when(resourceProperty.getValue()).thenReturn(params);
assertEquals("Prop: Dmitrii=is name,surname=Bocharov", labelsProvider.getStyledText(resourceProperty).toString());
}
use of org.jboss.tools.openshift.internal.ui.wizard.newapp.ResourceDetailsContentProvider.ResourceProperty in project jbosstools-openshift by jbosstools.
the class ResourceDetailsLabelProviderTest method getStyledTextWithNotProvidedLabel.
@Test
public void getStyledTextWithNotProvidedLabel() {
ResourceProperty resourceProperty = mock(ResourceProperty.class);
when(resourceProperty.getProperty()).thenReturn("prop1");
when(resourceProperty.isUnknownValue()).thenReturn(false);
when(resourceProperty.getValue()).thenReturn("");
assertEquals("Prop1: (Not Provided)", labelsProvider.getStyledText(resourceProperty).toString());
}
Aggregations