package io.openshift.boosters;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.swarm.Swarm;
import org.wildfly.swarm.arquillian.CreateSwarm;
import org.wildfly.swarm.arquillian.DefaultDeployment;

/**
 * @author Heiko Braun
 */
@RunWith(Arquillian.class)
@DefaultDeployment
public class GreetingServiceTest {

    @CreateSwarm
    public static Swarm newContainer() throws Exception {
        return new Swarm().withConfig(GreetingServiceTest.class.getClassLoader().getResource("project-defaults.yml"));
    }

    @Test
    @RunAsClient
    public void testResource() {
        Client client = ClientBuilder.newClient();
        WebTarget target = client.target("http://localhost:8080")
                .path("api")
                .path("greeting");

        Response response = target.request(MediaType.APPLICATION_JSON).get();
        Assert.assertEquals(200, response.getStatus());
        Assert.assertTrue(response.readEntity(String.class).contains("Hello World from a ConfigMap!"));
    }

}

@@ -1332,10 +1332,551 @@
 %0A    %7D%0A%0A
+    @Test%0A    @RunAsClient%0A    public void testResourceWithParam() %7B%0A        Client client = ClientBuilder.newClient();%0A        WebTarget target = client.target(%22http://localhost:8080%22)%0A                .path(%22api%22)%0A                .path(%22greeting%22)%0A                .queryParam(%22name%22, %22Peter%22);%0A%0A        Response response = target.request(MediaType.APPLICATION_JSON).get();%0A        Assert.assertEquals(200, response.getStatus());%0A        Assert.assertTrue(response.readEntity(String.class).contains(%22Hello Peter from a ConfigMap!%22));%0A    %7D%0A%0A
 %7D%0A

add a Swarm test with parameter (#8)