testinggospels / camouflage

Camouflage is a backend mocking tool for HTTP, gRPC, Websockets and Thrift protocols, which helps you carry out your front end prototyping, unit testing, functional/performance testing in silos, in absence of one or more Microservices/APIs.
https://testinggospels.github.io/camouflage/
MIT License
278 stars 26 forks source link

Code example does not return expected value #99

Closed Ashwin2488 closed 3 years ago

Ashwin2488 commented 3 years ago

Describe the bug While trying to test the inbuilt example for code, the response is always empty. Similar issue is seen with inject example where the response is incomplete and look like below

{
    "phone":
}

To Reproduce Start the camouflage server and goto

http://localhost:8080/code/inject http://localhost:8080/code

Expected behavior It should return a valid JSON

Desktop (please complete the following information):

OS: MacOS Big Sur Version - 11.6

Node version: 14.17.5

shubhendumadhukar commented 3 years ago

Hey @Ashwin2488, Some of the helpers like, code, inject, pg and csv, require injection to be enabled. Injection is disabled by default and can be enabled by updating config.yml. Could you please confirm if you have enabled injection in your config.yml?

injection:
  enable: false
Ashwin2488 commented 3 years ago

Sorry my bad. Missed the documentation part which says enable injection to make code, inject helpers work.