Browse Source

Added integration test for launcher template.

pull/13/head
Andrea Tarocchi 8 years ago committed by Andrea Tarocchi
parent
commit
48442ea7be
  1. 44
      pom.xml
  2. 54
      src/test/java/com/redhat/fuse/boosters/rest/http/HttpRequestKT.java

44
pom.xml

@ -18,6 +18,10 @@
<!-- versions of Maven plugins -->
<fmp.version>3.5.40</fmp.version>
<!-- version of Arquillian -->
<arquillian.cube.version>1.17.1</arquillian.cube.version>
<arquillian.version>1.4.0.Final</arquillian.version>
</properties>
<dependencyManagement>
@ -36,6 +40,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.arquillian.cube</groupId>
<artifactId>arquillian-cube-bom</artifactId>
<version>${arquillian.cube.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
@ -104,6 +115,28 @@
<artifactId>camel-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.arquillian.cube</groupId>
<artifactId>arquillian-cube-requirement</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.arquillian.cube</groupId>
<artifactId>arquillian-cube-openshift</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-osgi</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-standalone</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@ -127,6 +160,17 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<inherited>true</inherited>
<configuration>
<excludes>
<exclude>**/*KT.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>

54
src/test/java/com/redhat/fuse/boosters/rest/http/HttpRequestKT.java

@ -0,0 +1,54 @@
/*
* Copyright 2005-2016 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.redhat.fuse.boosters.rest.http;
import io.fabric8.kubernetes.api.model.v4_0.HasMetadata;
import io.fabric8.openshift.clnt.v4_0.OpenShiftClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@RunWith(Arquillian.class)
public class HttpRequestKT {
@ArquillianResource
OpenShiftClient client;
@Test
public void test_at_least_one_pod() throws Exception {
File template = new File(".openshiftio/application.yaml");
assertTrue(template.exists());
HashMap<String,String> templateParameters = new HashMap<String,String>(){
{put("SOURCE_REPOSITORY_URL","https://github.com/jboss-fuse/fuse-rest-http-booster");}
};
List<HasMetadata> resources = client.templates().load(template).process(templateParameters).getItems();
for(HasMetadata res : resources){
client.resource(res).createOrReplace();
}
assertEquals("fuse-rest-http-booster", client.buildConfigs().list().getItems().get(0).getMetadata().getName());
}
}
Loading…
Cancel
Save