Skip to content

Commit 262df6a

Browse files
committed
added new test
1 parent 3a69c58 commit 262df6a

4 files changed

Lines changed: 112 additions & 1 deletion

File tree

src/test/java/com/webfuzzing/overlayjvm/OverlayJVM_V1_1_0_custom_Test.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public static Stream<Data> overlayProvider() {
1515

1616
return Stream.of(
1717
getDataFromName("query-examples", 0),
18-
getDataFromName("array",2)
18+
getDataFromName("array",2),
19+
getDataFromName("named-examples",0)
1920
);
2021
}
2122

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Simple API
4+
version: 1.0.0
5+
servers:
6+
- url: https://api.example.com/v1
7+
paths:
8+
/api:
9+
post:
10+
parameters:
11+
- name: x
12+
in: query
13+
schema:
14+
type: string
15+
- name: y
16+
in: query
17+
schema:
18+
type: string
19+
requestBody:
20+
required: true
21+
content:
22+
application/json:
23+
schema:
24+
type: object
25+
properties:
26+
id:
27+
type: string
28+
name:
29+
type: string
30+
responses:
31+
'200':
32+
description: Successful response
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
overlay: 1.1.0
2+
info:
3+
title: Add Examples to API
4+
version: 1.0.0
5+
actions:
6+
- target: '$.paths["/api"].post.parameters[?(@.name=="y")]'
7+
description: Add foo example to query parameter y
8+
update:
9+
examples:
10+
foo:
11+
value: Foo
12+
13+
- target: '$.paths["/api"].post.parameters[?(@.name=="x")]'
14+
description: Add bar example to query parameter x
15+
update:
16+
examples:
17+
bar:
18+
value: Bar
19+
20+
- target: '$.paths["/api"].post.parameters[?(@.name=="y")]'
21+
description: Add bar example to query parameter y
22+
update:
23+
examples:
24+
bar:
25+
value: Bar
26+
27+
- target: '$.paths["/api"].post.requestBody.content["application/json"]'
28+
update:
29+
examples:
30+
bar:
31+
value:
32+
id: "bar-id-123"
33+
name: "Bar Name Example"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Simple API
4+
version: 1.0.0
5+
servers:
6+
- url: https://api.example.com/v1
7+
paths:
8+
/api:
9+
post:
10+
parameters:
11+
- name: x
12+
in: query
13+
schema:
14+
type: string
15+
examples:
16+
bar:
17+
value: Bar
18+
- name: y
19+
in: query
20+
schema:
21+
type: string
22+
examples:
23+
bar:
24+
value: Bar
25+
foo:
26+
value: Foo
27+
requestBody:
28+
required: true
29+
content:
30+
application/json:
31+
schema:
32+
type: object
33+
properties:
34+
id:
35+
type: string
36+
name:
37+
type: string
38+
examples:
39+
bar:
40+
value:
41+
id: "bar-id-123"
42+
name: "Bar Name Example"
43+
responses:
44+
'200':
45+
description: Successful response

0 commit comments

Comments
 (0)