Skip to content

Commit

Permalink
feat: [add-circuit-breaker-to-api] Adds test for command builder with…
Browse files Browse the repository at this point in the history
… circuitBreakerConfig
  • Loading branch information
xadil committed May 5, 2024
1 parent 7cc1727 commit 66134af
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/helpers/buildSpecGenCommandWithOptions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,23 @@ describe("Build spec gen command test", () => {
`${baseCommand} --additional-properties=serviceName=test-service-name,withCircuitBreaker=true,dataSourceName=RESTDataSource`
);
});

test("should create command for circuit breaker with external circuit breaker config", () => {
const options = {
withCircuitBreaker: "--withCircuitBreaker",
circuitBreakerConfig:
"@app/circuit-breakers/CircuitBreakerConfig#getServiceCircuitBreaker",
};
const result = buildSpecGenCommandWithOptions(
pathToSwaggerJar,
pathToTemplate,
pathToSpecFile,
codeOutputFolder,
"test-service-name",
options
);
expect(result).toBe(
`${baseCommand} --additional-properties=serviceName=test-service-name,withCircuitBreaker=true,circuitBreakerImportString=@app/circuit-breakers/CircuitBreakerConfig,circuitBreakerConfigFn="getServiceCircuitBreaker",dataSourceName=RESTDataSource`
);
});
});

0 comments on commit 66134af

Please sign in to comment.