Browse Source

Merge branch 'master' into redhat

pull/31/head
Andrea Tarocchi 7 years ago
parent
commit
c4e9627532
  1. 2
      .openshiftio/application.yaml
  2. 13
      pom.xml
  3. 27
      src/test/java/com/redhat/fuse/boosters/rest/http/HttpRequestKT.java

2
.openshiftio/application.yaml

@ -23,7 +23,7 @@ parameters:
- name: ARTIFACT_COPY_ARGS
description: Syntax to be used to copy uberjar files to the target directory
displayName: Copy Args
value: '*-exec.jar'
value: '*.jar'
required: true
- name: GITHUB_WEBHOOK_SECRET
description: A secret string used to configure the GitHub webhook.

13
pom.xml

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@ -18,6 +20,7 @@
<!-- version of Arquillian -->
<arquillian.cube.version>1.17.1</arquillian.cube.version>
<arquillian.version>1.4.0.Final</arquillian.version>
<openshift-client.version>4.0.7</openshift-client.version>
</properties>
<dependencyManagement>
@ -131,6 +134,11 @@
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-client</artifactId>
<version>${openshift-client.version}</version>
</dependency>
</dependencies>
<build>
@ -160,9 +168,6 @@
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${fuse.bom.version}</version>
<configuration>
<classifier>exec</classifier>
</configuration>
<executions>
<execution>
<goals>

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

@ -16,19 +16,21 @@
package com.redhat.fuse.boosters.rest.http;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.openshift.client.OpenShiftClient;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.util.Collections;
import java.util.List;
import java.util.Map;
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;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.openshift.client.OpenShiftClient;
@RunWith(Arquillian.class)
public class HttpRequestKT {
@ -37,15 +39,14 @@ public class HttpRequestKT {
OpenShiftClient client;
@Test
public void templateTest() throws Exception {
public void templateTest() {
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");}
};
Map<String, String> templateParameters = Collections.singletonMap("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){
for (HasMetadata res : resources) {
client.resource(res).createOrReplace();
}

Loading…
Cancel
Save