Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vitalijr2/ijhttp-demo

IntelliJ HTTP Client Demo
https://github.com/vitalijr2/ijhttp-demo

api-testing api-testing-tool developer-tools http-client-cli ijhttp integration-testing

Last synced: about 2 months ago
JSON representation

IntelliJ HTTP Client Demo

Awesome Lists containing this project

README

        

# IntelliJ HTTP Client Demo

This is a demo project to show using of [IntelliJ HTTP Client][ijhttp] CLI.
Further reading about [HTTP Client][http-client] and [specification][spec].

## How to run IntelliJ HTTP Client...

### ... on Maven project ...

There are two options: run it with `exec-maven-plugin` and `ijhttp-maven-plugin`.
Both require to install or download **IntelliJ HTTP Client CLI**.
I use `download-maven-plugin` to download it.

#### … with Spring Boot Test

Run Maven build

```bash
./mvnw
```

You need `ijhttp` in your **PATH**. You can customize it in `src/test/resources/application.yaml`.

#### … with `exec-maven-plugin`

```bash
./mvnw -Pdownload-ijhttp,spring-boot,exec
```

#### … with `ijhttp-maven-plugin`

```bash
./mvnw -Pdownload-ijhttp,spring-boot,maven-plugin
```

## ... on GitLab CI

There is `.gitlab-ci.yml` who downloads and unpacks `ijhttp` them runs it.

```yaml
http-test:
stage: test
script:
- microdnf install unzip
- curl -f -s -L -o ijhttp.zip https://jb.gg/ijhttp/latest
- unzip -nq ijhttp.zip -d target
- rm ijhttp.zip
- mvn $MAVEN_CLI_OPTS verify -Pspring-boot,maven-plugin
```

Example:
![GitLab Pipeline](gitlab-ci.png)

Another option use a Docker image but remember that you need to build the jar before this task.

```yaml
http-test-on-docker-image:
image:
name: jetbrains/intellij-http-client:latest
entrypoint: [""]
stage: integration-test
before_script:
- java -jar target/ijhttp-demo.jar &
- while ! nc -z localhost 8080