Skip to content

earv1/curl-to-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

curl-to-java

CircleCI  codebeat badge  License: MIT

Generate Java requests and tests from curls.

How to Use

  • Download the latest release.
  • Add your curls in resources/curls.txt.
  • Run gradle run.

Requirements

Java 9+

How does it work

Curl to Java works by generating taking a curl request, and generating Java code with tests out of it.

Specifically, it performs the following steps.

  1. Transform curl request into generated restTemplate request.
  2. Run generated Java code and get json response.
  3. Generate more code, specifically tests from json response.
  4. Run all the code together and see if the tests pass.

Features

  1. Transforms a curl into a Java http request.
  2. Generates tests to make sure the response is the same each time.
  3. Can customise generated code with templates.