Skip to content

Commit ec1324e

Browse files
authored
Merge pull request #10 from WebFuzzing/camelCase
Camel case
2 parents 759c53d + 10d1e75 commit ec1324e

19 files changed

Lines changed: 1367 additions & 1367 deletions

src/main/resources/wfc/schemas/auth.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: "Web Fuzzing Commons Authentication"
44
description: "Schema Definition for Web Fuzzing Commons Authentication"
55
type: object
66
properties:
7-
schema_version:
7+
schemaVersion:
88
type: string
99
description: "The schema version of WFC needed to use to validate and process this document."
1010
auth:

src/main/resources/wfc/schemas/report.yaml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,45 @@ description: "Schema Definition for Web Fuzzing Commons Reports"
55
type: object
66
properties:
77
# REQUIRED
8-
schema_version:
8+
schemaVersion:
99
type: string
1010
description: "The schema version of WFC needed to use to validate and process this document."
11-
tool_name:
11+
toolName:
1212
type: string
1313
description: "The name of the tool used to create the test cases reported in this document."
14-
tool_version:
14+
toolVersion:
1515
type: string
1616
description: "The version number of the used tool, e.g., 1.0.0."
17-
creation_time:
17+
creationTime:
1818
type: string
1919
format: date-time
2020
description: "The timestamp of when this report file was created."
2121
faults:
2222
$ref: "#/$defs/Faults"
2323
#### Unfortunately, there is no support for oneOf in jsonschema2pojo
24-
# problem_details:
24+
# problemDetails:
2525
# type: object
2626
# oneOf:
2727
# - $ref: "#/$defs/RESTReport"
2828
# # TODO GraphQL, RPC and Web
29-
problem_details:
29+
problemDetails:
3030
type: object
3131
properties:
3232
rest:
3333
$ref: "#/$defs/RESTReport"
3434
# TODO GraphQL, RPC and Web
3535
# expressing that only 1 should be present is possible, but super-verbose and convoluted
36-
total_tests:
36+
totalTests:
3737
type: integer
3838
minimum: 0
3939
description: "The total number of test cases generated by the tool."
40-
test_file_paths:
40+
testFilePaths:
4141
type: array
4242
items:
4343
$ref: "#/$defs/TestFilePath"
4444
uniqueItems: true
4545
description: "The list of relative paths (compared to this document) of all the generated test suite files."
46-
test_cases:
46+
testCases:
4747
description: "Information on each generated test case."
4848
type: array
4949
items:
@@ -55,7 +55,7 @@ properties:
5555
items:
5656
$ref: "#/$defs/Coverage"
5757

58-
required: ["schema_version","tool_name","tool_version","creation_time","faults","problem_details","total_tests","test_file_paths","test_cases"]
58+
required: ["schemaVersion","toolName","toolVersion","creationTime","faults","problemDetails","totalTests","testFilePaths","testCases"]
5959

6060
$defs:
6161
OperationId:
@@ -84,19 +84,19 @@ $defs:
8484
description: "Data-structure to represent which HTTP status code where covered on an endpoint by any of the generated tests."
8585
type: object
8686
properties:
87-
endpoint_id:
87+
endpointId:
8888
$ref: "#/$defs/OperationId"
89-
test_case_id:
89+
testCaseId:
9090
$ref: "#/$defs/TestCaseId"
91-
http_status:
91+
httpStatus:
9292
description: "As in a test case the same endpoint could be called more than once, here we report all of the
9393
obtained HTTP status codes"
9494
type: array
9595
items:
9696
$ref: "#/$defs/HttpStatus"
9797
minItems: 1
9898
uniqueItems: true
99-
required: ["endpoint_id","test_case_id","http_status"]
99+
required: ["endpointId","testCaseId","httpStatus"]
100100
HttpStatus:
101101
type: integer
102102
minimum: 0
@@ -106,85 +106,85 @@ $defs:
106106
in GraphQL and RPC) and which tests find faults in them."
107107
type: object
108108
properties:
109-
operation_id:
109+
operationId:
110110
$ref: "#/$defs/OperationId"
111-
test_case_id:
111+
testCaseId:
112112
$ref: "#/$defs/TestCaseId"
113-
fault_categories:
113+
faultCategories:
114114
type: array
115115
items:
116116
$ref: "#/$defs/FaultCategoryId"
117117
minItems: 1
118118
uniqueItems: true
119-
required: ["endpoint_id","test_case_id","fault_categories"]
119+
required: ["endpointId","testCaseId","faultCategories"]
120120

121121
RESTReport:
122122
type: object
123123
properties:
124-
total_http_calls:
124+
totalHttpCalls:
125125
description: "Total number of HTTP calls made in all the test cases. A test case could contain several HTTP calls, \
126126
e.g., a POST followed by a GET and then a DELETE."
127127
type: integer
128128
minimum: 0
129-
endpoint_ids:
129+
endpointIds:
130130
description: "Unique ids of all the endpoints in the tested API."
131131
type: array
132132
items:
133133
$ref: "#/$defs/OperationId"
134134
uniqueItems: true
135-
covered_http_status:
135+
coveredHttpStatus:
136136
description: "List of which HTTP status codes were covered, based on endpoints."
137137
type: array
138138
items:
139139
$ref: "#/$defs/CoveredEndpoint"
140-
required: ["total_http_calls","endpoint_ids","covered_http_status"]
140+
required: ["totalHttpCalls","endpointIds","coveredHttpStatus"]
141141

142142
TestCase:
143143
type: object
144144
properties:
145145
id:
146146
$ref: "#/$defs/TestCaseId"
147-
file_path:
147+
filePath:
148148
$ref: "#/$defs/TestFilePath"
149149
name:
150150
description: "The name of the test case, as it appears in the generated test file."
151151
type: string
152-
start_line:
152+
startLine:
153153
description: "The line number in the generated test suite file where the code of this test case starts."
154154
type: integer
155155
minimum: 0
156-
end_line:
156+
endLine:
157157
description: "The line number in the generated test suite file where the code of this test case ends."
158158
type: integer
159159
minimum: 0
160160

161161
Faults:
162162
type: object
163163
properties:
164-
total_number:
164+
totalNumber:
165165
description: "The total number of potential faults identified in the generated test suites. \
166166
Each fault is uniquely identified with its 'code' category and 'context'. \
167167
Note that different tests can detect the same fault, and a test case can detect several different faults."
168168
type: integer
169169
minimum: 0
170-
found_faults:
170+
foundFaults:
171171
description: "Information on all the identified potential faults."
172172
type: array
173173
items:
174174
$ref: "#/$defs/FoundFault"
175-
required: ["total_number","found_faults"]
175+
required: ["totalNumber","foundFaults"]
176176

177177
Coverage:
178178
type: object
179179
properties:
180-
tool_name:
180+
toolName:
181181
description: "The name of the tool used to collect and compute the coverage criteria."
182182
type: string
183183
criteria:
184184
type: array
185185
items:
186186
$ref: "#/$defs/CoverageCriterion"
187-
required: ["tool_name","criteria"]
187+
required: ["toolName","criteria"]
188188

189189
CoverageCriterion:
190190
type: object

web-report/src-e2e/App.test.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,34 +68,34 @@ describe('App test', () => {
6868
render(<App />);
6969
expect(screen.getByText(/Please wait, files are loading.../)).toBeInTheDocument();
7070
await waitFor(() => {
71-
expect(screen.getByTestId('header-creation-date')).toContainHTML(new Date(reportData.creation_time).toUTCString());
72-
expect(screen.getByTestId('header-tool-name-version')).toContainHTML(`${reportData.tool_name}`);
73-
expect(screen.getByTestId('header-tool-name-version')).toContainHTML(`${reportData.tool_version}`);
74-
expect(screen.getByTestId('header-schema-version')).toContainHTML(reportData.schema_version);
71+
expect(screen.getByTestId('header-creation-date')).toContainHTML(new Date(reportData.creationTime).toUTCString());
72+
expect(screen.getByTestId('header-tool-name-version')).toContainHTML(`${reportData.toolName}`);
73+
expect(screen.getByTestId('header-tool-name-version')).toContainHTML(`${reportData.toolVersion}`);
74+
expect(screen.getByTestId('header-schema-version')).toContainHTML(reportData.schemaVersion);
7575
});
7676
});
7777

7878
it('check rest report', async () => {
7979
render(<App />);
8080
expect(screen.getByText(/Please wait, files are loading.../)).toBeInTheDocument();
81-
const total = reportData.problem_details.rest.endpoint_ids.length;
82-
const total_http_calls = reportData.problem_details.rest.total_http_calls;
81+
const total = reportData.problemDetails.rest.endpointIds.length;
82+
const totalHttpCalls = reportData.problemDetails.rest.totalHttpCalls;
8383

8484
await waitFor(() => {
8585
expect(screen.getByTestId('rest-report-endpoint')).toContainHTML(`${total}`);
86-
expect(screen.getByTestId('rest-report-http-calls')).toContainHTML(`${total_http_calls}`);
86+
expect(screen.getByTestId('rest-report-http-calls')).toContainHTML(`${totalHttpCalls}`);
8787
});
8888

8989
});
9090

9191
it('check generated tests', async () => {
9292
render(<App />);
9393
expect(screen.getByText(/Please wait, files are loading.../)).toBeInTheDocument();
94-
const total_tests = reportData.total_tests;
95-
const total_test_files = reportData.test_file_paths.length;
94+
const totalTests = reportData.totalTests;
95+
const totalTestFiles = reportData.testFilePaths.length;
9696
await waitFor(() => {
97-
expect(screen.getByTestId('generated-tests-total-tests')).toContainHTML(`${total_tests}`);
98-
expect(screen.getByTestId('generated-tests-total-test-files')).toContainHTML(`${total_test_files}`);
97+
expect(screen.getByTestId('generated-tests-total-tests')).toContainHTML(`${totalTests}`);
98+
expect(screen.getByTestId('generated-tests-total-test-files')).toContainHTML(`${totalTestFiles}`);
9999
});
100100
});
101101

@@ -125,7 +125,7 @@ describe('App test', () => {
125125

126126
await waitFor(() => {
127127
// check if the endpoints are displayed
128-
reportData.problem_details.rest.endpoint_ids.forEach((endpoint: string) => {
128+
reportData.problemDetails.rest.endpointIds.forEach((endpoint: string) => {
129129
// const testId = convertEndpointToTestId(endpoint);
130130
expect(screen.getByTestId(endpoint)).toBeInTheDocument();
131131
});
@@ -135,11 +135,11 @@ describe('App test', () => {
135135
it('check faults component', async () => {
136136
render(<App />);
137137
expect(screen.getByText(/Please wait, files are loading.../)).toBeInTheDocument();
138-
const total_faults = reportData.faults.total_number;
139-
const faultCounts = getFaultCounts(reportData.faults.found_faults);
138+
const totalFaults = reportData.faults.totalNumber;
139+
const faultCounts = getFaultCounts(reportData.faults.foundFaults);
140140

141141
await waitFor(() => {
142-
expect(screen.getByTestId('faults-component-total-faults')).toContainHTML(`${total_faults}`);
142+
expect(screen.getByTestId('faults-component-total-faults')).toContainHTML(`${totalFaults}`);
143143
expect(screen.getByTestId('faults-component-fault-counts')).toContainHTML(faultCounts.length.toString());
144144
});
145145
});

0 commit comments

Comments
 (0)