Forked from lordofthejars/HelloWorldTemplateTest.java
Last active
November 14, 2017 16:31
-
-
Save jwendell/44e6e83b8bc3123b3fa43bb95efbc338 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Template | |
metadata: | |
name: hello | |
parameters: | |
- name: RESPONSE | |
value: "Hello from Arquillian" | |
required: false | |
objects: | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-openshift-service | |
spec: | |
ports: | |
- name: hello-openshift-service | |
port: 8080 | |
protocol: TCP | |
targetPort: 8080 | |
selector: | |
name: hello-openshift-service | |
- apiVersion: v1 | |
kind: Pod | |
metadata: | |
labels: | |
name: hello-openshift-service | |
name: hello-openshift | |
spec: | |
containers: | |
- image: openshift/hello-openshift | |
imagePullPolicy: IfNotPresent | |
name: hello-openshift | |
ports: | |
- containerPort: 8080 | |
protocol: TCP | |
env: | |
- name: RESPONSE | |
value: ${RESPONSE} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(ArquillianConditionalRunner.class) | |
@RequiresOpenshift | |
@Template(url = "https://gist.githubusercontent.com/lordofthejars/81cf2db55145873c9242719efe1c3f24/raw/27188fae3ebc1375f0645ac1a22cb3fe6980ca36/hello-template.yaml") | |
public class HelloWorldTemplateTest { | |
@Named("hello-openshift-service") | |
@PortForward | |
@ArquillianResource | |
URL url; | |
@Test | |
public void should_show_hello_world() throws IOException { | |
assertThat(url).isNotNull(); | |
OkHttpClient okHttpClient = new OkHttpClient(); | |
Request request = new Request.Builder().get().url(url).build(); | |
Response response = okHttpClient.newCall(request).execute(); | |
assertThat(response).isNotNull(); | |
assertThat(response.code()).isEqualTo(200); | |
assertThat(response.body().string()).isEqualTo("Hello OpenShift!\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment