Skip to content

Commit

Permalink
Merge pull request #58 from rabestro/poc/automation
Browse files Browse the repository at this point in the history
Add counter increment and update conditions in HTTP requests
  • Loading branch information
Jegors Čemisovs authored Feb 24, 2024
2 parents c92bfb1 + 7e20b82 commit d5e841b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 7 deletions.
17 changes: 17 additions & 0 deletions http-client/poc/increase-counter.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@sut = actuator/translation-count

### Read Translation Counter
GET {{host}}/{{sut}}

> {%
const counter = parseInt(response.body.count + 5).toString();
client.global.set('counter', counter);
%}

### Set Translation Counter
POST {{host}}/{{sut}}
Content-Type: application/json

{
"count": {{counter}}
}
5 changes: 2 additions & 3 deletions http-yac/actuator/health.http
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# @disabled
GET {{host}}/actuator/health

?? status == 200
?? body status == UP
?? body components.diskSpace.status == UP
?? body components.diskSpace.details.total > 0
?? body components.diskSpace.details.free > 0
?? body components.diskSpace.details.total > 1
?? body components.diskSpace.details.free > 1
4 changes: 2 additions & 2 deletions http-yac/actuator/server-info.http
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
?? body os exists
?? body java exists
?? body java.version startsWith 17
?? body app.source-code endsWith pig-latin-rest
?? body app.source-code contains rabestro
?? body app["source-code"] endsWith pig-latin-rest
?? body app["source-code"] contains rabestro
?? body os.name == Linux
3 changes: 1 addition & 2 deletions http-yac/actuator/show-translation-counter.http
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# @disabled
{{host}}/actuator/translation-count

?? status == 200
?? body count isNumber
?? body count >= 0
?? body count > -1
17 changes: 17 additions & 0 deletions http-yac/poc/increase-counter.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@sut = actuator/translation-count

### Read Translation Counter
# @name translationCounter
GET {{host}}/{{sut}}

{{
translationCounter.count += 5
}}

### Set Translation Counter
# @ref translationCounter

POST {{host}}/{{sut}}
Content-Type: application/json

{{translationCounter}}

0 comments on commit d5e841b

Please sign in to comment.