import com.airhacks.rulz.jaxrsclient.JAXRSClientProvider;
import org.junit.Test;

import javax.json.JsonObject;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import static org.assertj.core.api.Assertions.assertThat;

public class WorkspaceProcessorResourceIT {

    public JAXRSClientProvider provider = JAXRSClientProvider.buildWithURI("http://localhost:48080/rest/process");

    @Test
    public void shouldGetJavaWorkspace() {
        Response response = provider.addPath("/init/java").request(MediaType.APPLICATION_JSON).get();
        assertThat(response.getStatus()).isEqualTo(200);
        JsonObject result = response.readEntity(JsonObject.class);
        assertThat(result.getString("terminal")).isNotNull().contains("Welcome to Javalab");
    }
}

@@ -772,11 +772,775 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void shouldGetScalaWorkspace() %7B%0A        Response response = provider.addPath(%22/init/scala%22).request(MediaType.APPLICATION_JSON).get();%0A        assertThat(response.getStatus()).isEqualTo(200);%0A        JsonObject result = response.readEntity(JsonObject.class);%0A        assertThat(result.getString(%22terminal%22)).isNotNull().contains(%22Welcome to Javalab%22);%0A    %7D%0A%0A    @Test%0A    public void shouldGetGroovyWorkspace() %7B%0A        Response response = provider.addPath(%22/init/groovy%22).request(MediaType.APPLICATION_JSON).get();%0A        assertThat(response.getStatus()).isEqualTo(200);%0A        JsonObject result = response.readEntity(JsonObject.class);%0A        assertThat(result.getString(%22terminal%22)).isNotNull().contains(%22Welcome to Javalab%22);%0A    %7D
 %0A%7D%0A

test scala/groovy endpoint