Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
Add the proxy feature. The report path is customazible. Spring Boot T…
Browse files Browse the repository at this point in the history
…est autoconfiguration. (#60)

* Bump org.jetbrains:annotations from 24.0.1 to 24.1.0 (#58)

Bumps [org.jetbrains:annotations](https://github.com/JetBrains/java-annotations) from 24.0.1 to 24.1.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](JetBrains/java-annotations@24.0.1...24.1.0)

---
updated-dependencies:
- dependency-name: org.jetbrains:annotations
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump org.apache.maven.plugins:maven-project-info-reports-plugin (#59)

Bumps [org.apache.maven.plugins:maven-project-info-reports-plugin](https://github.com/apache/maven-project-info-reports-plugin) from 3.4.5 to 3.5.0.
- [Commits](apache/maven-project-info-reports-plugin@maven-project-info-reports-plugin-3.4.5...maven-project-info-reports-plugin-3.5.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-project-info-reports-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add the proxy feature

* The report path is customazible

* CLI builder

* Update ChangeLog

* Bump actions/setup-java from 3 to 4 (#62)

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update Maven plugin's groupId

* Bump mockito.version from 5.7.0 to 5.8.0 (#65)

Bumps `mockito.version` from 5.7.0 to 5.8.0.

Updates `org.mockito:mockito-core` from 5.7.0 to 5.8.0
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v5.7.0...v5.8.0)

Updates `org.mockito:mockito-junit-jupiter` from 5.7.0 to 5.8.0
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v5.7.0...v5.8.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
- dependency-name: org.mockito:mockito-junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix GitLab CI configuration

* Fix GitLab CI configuration

* Fix GitLab CI configuration

* Fix stderr integration test

* Fix style issue

* Fix GitLab CI configuration

* Spring Boot Test extension with autoconfiguration

* Rename cli-builder to command-line; add a Spring Boot integration test as #51 proposed (see GitHub).

* Fix GitLab CI configuration

* Fix style issues and import

* Add the spring-boot-test module with autoconfiguration

* Fix GitLab CI configuration

* Add unit-tests, remove unused imports

* Clean GitLab CI configuration

* Spring Boot Test Autoconfiguration

* Descrease complexity

* Increase code coverage

* Increase code coverage

* Increase code coverage

* Fix style issue

* Increase code coverage

* Increase code coverage

* Fix style issues

* Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.2 to 3.6.3 (#68)

Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.2 to 3.6.3.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](apache/maven-javadoc-plugin@maven-javadoc-plugin-3.6.2...maven-javadoc-plugin-3.6.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update documentation

* spring-boot-test: parameters documentation

* Add javadoc and readme to the command-line module

* Update reamde and javadoc

* Add readme and javadoc to Spring Boot Test autoconfiguration

* Update site

* Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.2.2 to 3.2.3 (#71)

Bumps [org.apache.maven.plugins:maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](apache/maven-surefire@surefire-3.2.2...surefire-3.2.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-failsafe-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.2 to 3.2.3 (#70)

Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](apache/maven-surefire@surefire-3.2.2...surefire-3.2.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github/codeql-action from 2 to 3 (#72)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Next version

* Update TOC in readme

* Fix TOC

* Update javadoc and release profile

* Bump org.apache.maven.plugins:maven-compiler-plugin (#74)

Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.11.0 to 3.12.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](apache/maven-compiler-plugin@maven-compiler-plugin-3.11.0...maven-compiler-plugin-3.12.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
vitalijr2 and dependabot[bot] authored Dec 20, 2023
1 parent 7a042d8 commit 88ad670
Show file tree
Hide file tree
Showing 131 changed files with 3,706 additions and 633 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -62,7 +62,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -75,6 +75,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/public/
/target/
/.flattened-pom.xml
target
.flattened-pom.xml

*~

Expand Down
58 changes: 41 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ include:
cache:
paths:
- .m2/repository
- target
- command-line/target
- maven-plugin/target
- spring-boot-test/target

stages:
- build
- test
- verify
- release
- deploy

build:
stage: build
script:
- ./mvnw $MAVEN_CLI_OPTS clean compile
except:
- tags
rules:
- if: $CI_COMMIT_TAG == null

test:
stage: test
Expand All @@ -31,51 +34,72 @@ test:
artifacts:
reports:
junit:
- target/surefire-reports/TEST-*.xml
- target/failsafe-reports/TEST-*.xml
- command-line/target/surefire-reports/TEST-*.xml
- command-line/target/failsafe-reports/TEST-*.xml
- maven-plugin/target/surefire-reports/TEST-*.xml
- maven-plugin/target/failsafe-reports/TEST-*.xml
- spring-boot-test/target/surefire-reports/TEST-*.xml
- spring-boot-test/target/failsafe-reports/TEST-*.xml
rules:
- if: $CI_COMMIT_TAG == null

sast:
stage: test
variables:
SAST_EXCLUDED_PATHS: jacoco-resources, prism.js

semgrep-sast:
rules:
- if: $CI_COMMIT_TAG == null

spotbugs-sast:
variables:
MAVEN_REPO_PATH: '.m2/repository'
MAVEN_REPO_PATH: '$CI_PROJECT_DIR/.m2/repository'
SAST_JAVA_VERSION: 17
before_script:
- rm -rf src/it
- rm -rf maven-plugin/src/it
- rm -rf spring-boot-test/src/it
rules:
- if: $CI_COMMIT_TAG == null

coverage:
stage: verify
script:
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions, "% covered" }' target/site/jacoco/jacoco.csv
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions, "% covered" }' command-line/target/site/jacoco/jacoco.csv maven-plugin/target/site/jacoco/jacoco.csv spring-boot-test/target/site/jacoco/jacoco.csv
coverage: '/(\d+\.?\d*) \% covered/'
rules:
- if: $CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH && $CI_COMMIT_TAG == null
- if: $CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH

codacy:
stage: verify
script:
- bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r target/site/jacoco/jacoco.xml
- bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r command-line/target/site/jacoco/jacoco.xml -r maven-plugin/target/site/jacoco/jacoco.xml -r spring-boot-test/target/site/jacoco/jacoco.xml
rules:
- if: $CODACY_PROJECT_TOKEN && $CI_COMMIT_TAG == null

release:
stage: deploy
stage: release
script:
- ./mvnw $MAVEN_CLI_OPTS -s ci_settings.xml -am deploy -ntp -Dchangelist= -Psources,javadocs,sign-and-deploy
only:
- tags
- ./mvnw $MAVEN_CLI_OPTS -s ci_settings.xml -am -ntp -DskipTests -Dchangelist= -Pjavadocs,release
rules:
- if: $CI_COMMIT_TAG
- if: $CI_DEFAULT_BRANCH != $CI_COMMIT_BRANCH
when: never
cache:
paths:
- target

pages:
stage: deploy
script:
- cp changelog.md src/site/markdown
- cp contributing.md src/site/markdown
- ./mvnw $MAVEN_CLI_OPTS verify site site:stage -Dchangelist= -Pjavadocs,site
- ./mvnw javadoc:aggregate -Dchangelist= -Pjavadocs
- ./mvnw $MAVEN_CLI_OPTS -pl . -Dchangelist= -Psite
artifacts:
paths:
- public
only:
- tags
rules:
- if: $CI_COMMIT_TAG
- if: $CI_DEFAULT_BRANCH != $CI_COMMIT_BRANCH
when: never
9 changes: 8 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.1.0 - 2023-12-20
### Added
- The proxy feature
- The report path
- Split Maven plugin and CLI builder modules
- The Spring Boot Test autoconfiguration

## 1.0.1 - 2023-11-08
### Fixed
- Environment variables, public and private, are added without handling quoting
Expand Down
122 changes: 122 additions & 0 deletions command-line/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2023 Vitalij Berdinskih
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>ijhttp-command-line</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
<plugin>
<artifactId>flatten-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
<plugin>
<artifactId>jacoco-maven-plugin</artifactId>
<groupId>org.jacoco</groupId>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<artifactId>annotations</artifactId>
<groupId>org.jetbrains</groupId>
</dependency>
<dependency>
<artifactId>commons-exec</artifactId>
<groupId>org.apache.commons</groupId>
</dependency>
<!-- test -->
<dependency>
<artifactId>junit-jupiter-api</artifactId>
<groupId>org.junit.jupiter</groupId>
</dependency>
<dependency>
<artifactId>junit-jupiter-engine</artifactId>
<groupId>org.junit.jupiter</groupId>
</dependency>
<dependency>
<artifactId>junit-jupiter-params</artifactId>
<groupId>org.junit.jupiter</groupId>
</dependency>
<dependency>
<artifactId>mockito-core</artifactId>
<groupId>org.mockito</groupId>
</dependency>
<dependency>
<artifactId>mockito-junit-jupiter</artifactId>
<groupId>org.mockito</groupId>
</dependency>
<dependency>
<artifactId>hamcrest</artifactId>
<groupId>org.hamcrest</groupId>
</dependency>
</dependencies>
<description>The builder-style component HttpClientCommandLine helps to prepare command line
to run Intellij HTTP Client CLI tool.
</description>
<modelVersion>4.0.0</modelVersion>
<name>ijhttp tools : Command Line</name>
<packaging>jar</packaging>
<parent>
<artifactId>ijhttp-parent</artifactId>
<groupId>uk.bot-by.ijhttp-tools</groupId>
<version>${revision}${changelist}${sha1}</version>
</parent>
<profiles>
<profile>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<links>
<link>
https://javadoc.io/doc/org.apache.commons/commons-exec/${commons-exec.version}
</link>
<link>
https://javadoc.io/doc/org.jetbrains/annotations/${jetbrains-annotations.version}
</link>
</links>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
</plugins>
</build>
<id>javadocs</id>
</profile>
</profiles>
</project>
23 changes: 23 additions & 0 deletions command-line/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# HTTP Client Command Line

[![Maven Central](https://img.shields.io/maven-central/v/uk.bot-by.ijhttp-tools/ijhttp-command-line)](https://search.maven.org/artifact/uk.bot-by.ijhttp-tools/ijhttp-command-line)
[![Javadoc](https://javadoc.io/badge2/uk.bot-by.ijhttp-tools/ijhttp-command-line/javadoc.svg)](https://javadoc.io/doc/uk.bot-by.ijhttp-tools/ijhttp-command-line)

The builder-style component [HttpClientCommandLine][component] helps to prepare command line
to run [Intellij HTTP Client CLI tool][cli-tool].

The minimal configuration contains HTTP files only:
```java
var commandLine = new HttpClientCommandLine();
var executor = new DefaultExecutor();
var orders = Path.of("orders.http").toFile();
var products = Path.of("products.http").toFile();
var checkout = Path.of("checkout.http").toFile();

commandLine.files(java.util.List.of(orders, products, checkout));
executor.execute(commandLine.getCommandLine());
```

[component]: src/main/java/uk/bot_by/ijhttp_tools/command_line/HttpClientCommandLine.java

[cli-tool]: https://www.jetbrains.com/help/idea/http-client-cli.html
Loading

0 comments on commit 88ad670

Please sign in to comment.