@@ -128,6 +128,11 @@ describe('GeneratorService', () => {
128128 command : `java -jar "/path/to/4.2.1.jar" generate ${ appendix . join ( ' ' ) } ` ,
129129 } ) ;
130130
131+ const cmdWithCustomJar = ( name : string , customJar : string , appendix : string [ ] ) => ( {
132+ name,
133+ command : `java -cp "/path/to/4.2.1.jar:${ customJar } " org.openapitools.codegen.OpenAPIGenerator generate ${ appendix . join ( ' ' ) } ` ,
134+ } ) ;
135+
131136 describe . each ( [
132137 [ 'foo.json' , [
133138 cmd ( '[angular] abc/app/pet.yaml' , [
@@ -183,6 +188,18 @@ describe('GeneratorService', () => {
183188 '--some-bool' ,
184189 ] ) ,
185190 ] ] ,
191+ [ 'bar.json' , [
192+ cmdWithCustomJar ( '[bar] api/cat.yaml' , '../some/custom.jar' , [
193+ `--input-spec="${ cwd } /api/cat.yaml"` ,
194+ `--output="bar/cat"` ,
195+ '--some-bool' ,
196+ ] ) ,
197+ cmdWithCustomJar ( '[bar] api/bird.json' , '../some/custom.jar' , [
198+ `--input-spec="${ cwd } /api/bird.json"` ,
199+ `--output="bar/bird"` ,
200+ '--some-bool' ,
201+ ] ) ,
202+ ] , '../some/custom.jar' ] ,
186203 [ 'none.json' , [ ] ] ,
187204 [ 'also-none.json' , [ ] ] ,
188205 [ 'no-glob.json' , [
@@ -200,13 +217,13 @@ describe('GeneratorService', () => {
200217 `--ext="json"` ,
201218 ] ) ,
202219 ] ] ,
203- ] ) ( '%s' , ( filePath , expectedCommands ) => {
220+ ] ) ( '%s' , ( filePath , expectedCommands , customGenerator ) => {
204221
205222 let returnValue : boolean
206223
207224 beforeEach ( async ( ) => {
208225 configGet . mockImplementation ( ( path , defaultValue ) => config [ filePath ] || defaultValue )
209- returnValue = await fixture . generate ( )
226+ returnValue = await fixture . generate ( customGenerator )
210227 } )
211228
212229 it ( 'calls the config get well' , ( ) => {
0 commit comments