use of com.openshift.restclient.model.IBuildConfig in project jbosstools-openshift by jbosstools.
the class ResourceDetailsLabelProviderTest method getStyledTextForResourceWithParams.
@Test
public void getStyledTextForResourceWithParams() {
IBuildConfig buildConfig = mock(IBuildConfig.class);
when(buildConfig.getKind()).thenReturn(ResourceKind.BUILD_CONFIG);
when(buildConfig.getName()).thenReturn("named by ${name} ${surname}");
assertEquals(ResourceKind.BUILD_CONFIG + " named by Dmitrii Bocharov", labelsProvider.getStyledText(buildConfig).toString());
}
use of com.openshift.restclient.model.IBuildConfig in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method testGetEapOpenshiftProfile.
@Test
public void testGetEapOpenshiftProfile() {
DockerImageURI image = mock(DockerImageURI.class);
when(image.getName()).thenReturn("super-puper-eap-name");
ISourceBuildStrategy buildStrategy = mock(ISourceBuildStrategy.class);
when(buildStrategy.getImage()).thenReturn(image);
IBuildConfig buildConfig = (IBuildConfig) connection.getResources(ResourceKind.BUILD_CONFIG, ResourceMocks.PROJECT2.getName()).get(1);
when(buildConfig.getBuildStrategy()).thenReturn(buildStrategy);
assertEquals("openshift3.eap", this.model.getProfileId());
}
use of com.openshift.restclient.model.IBuildConfig in project jbosstools-openshift by jbosstools.
the class WebhookUtilTest method testEmptyWebHooks.
@Test
public void testEmptyWebHooks() {
IBuildConfig buildConfig = givenBuildConfigWithTriggers();
List<IWebhookTrigger> webHooks = WebhookUtil.getWebHooks(buildConfig);
assertNotNull(webHooks);
assertEquals(0, webHooks.size());
}
use of com.openshift.restclient.model.IBuildConfig in project jbosstools-openshift by jbosstools.
the class WebhookUtilTest method testGetWebHooks.
@Test
public void testGetWebHooks() {
IBuildConfig buildConfig = givenBuildConfigWithTriggers(genericTrigger(), imageChangeTrigger(), githubTrigger());
List<IWebhookTrigger> webHooks = WebhookUtil.getWebHooks(buildConfig);
assertEquals(2, webHooks.size());
assertNotNull(webHooks);
assertEquals(BuildTriggerType.GENERIC, webHooks.get(0).getType());
assertEquals(BuildTriggerType.GITHUB, webHooks.get(1).getType());
}
use of com.openshift.restclient.model.IBuildConfig in project jbosstools-openshift by jbosstools.
the class OpenshiftEapProfileDetector method getBuildConfig.
private IBuildConfig getBuildConfig(IConnection connection, IResource resource) {
if (resource == null || resource.getProject() == null || !(connection instanceof Connection)) {
return null;
}
Connection connectionInstance = (Connection) connection;
List<IBuildConfig> buildConfigs = connectionInstance.getResources(ResourceKind.BUILD_CONFIG, resource.getProject().getName());
if (buildConfigs == null) {
return null;
}
return ResourceUtils.getBuildConfigFor(resource, buildConfigs);
}
Aggregations