Skip to content

Commit

Permalink
Added bru-collections.
Browse files Browse the repository at this point in the history
  • Loading branch information
INDRA KUMAR R committed Oct 22, 2024
1 parent 56f3b31 commit 7666a38
Show file tree
Hide file tree
Showing 9 changed files with 261 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## What is being fixed - and why?

Description of problem / issue.

Statement of why it needs fixing.

Alternatively - link to an issue in this project.

## What has changed?

Summary of changes and how they resolve the issue.
42 changes: 42 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "main" ]
paths-ignore:
- '*.md'
pull_request:
branches: [ "main" ]
paths-ignore:
- '*.md'

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Run Linter
run: ./gradlew spotlessCheck
- name: Run Build
run: ./gradlew build
- name: Run Acceptance Test
run: ./scripts/acceptance.sh --skip-build
15 changes: 15 additions & 0 deletions bru-collections/tw-joe/Get Price plans with limit.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Get Price plans with limit
type: http
seq: 4
}

get {
url: http://localhost:8080/price-plans/recommend/smart-meter-{{METER_ID}}
body: none
auth: none
}

params:query {
limit: 2
}
11 changes: 11 additions & 0 deletions bru-collections/tw-joe/Get Price plans.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: Get Price plans
type: http
seq: 3
}

get {
url: http://localhost:8080/price-plans/compare-all/smart-meter-{{METER_ID}}
body: none
auth: none
}
11 changes: 11 additions & 0 deletions bru-collections/tw-joe/Get Total Cost.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: Get the Total cost
type: http
seq: 2
}

get {
url: http://localhost:8080/readings/read/total-cost/smart-meter-{{METER_ID}}
body: none
auth: none
}
11 changes: 11 additions & 0 deletions bru-collections/tw-joe/Get the Readings.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: Get the Readings
type: http
seq: 2
}

get {
url: http://localhost:8080/readings/read/smart-meter-{{METER_ID}}
body: none
auth: none
}
23 changes: 23 additions & 0 deletions bru-collections/tw-joe/Store the Reading.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
meta {
name: Store the Reading
type: http
seq: 1
}

post {
url: http://localhost:8080/readings/store
body: json
auth: none
}

body:json {
{
"smartMeterId": "smart-meter-{{METER_ID}}",
"electricityReadings": [
{
"time": "{{TIME}}",
"reading": "{{READING}}"
}
]
}
}
9 changes: 9 additions & 0 deletions bru-collections/tw-joe/bruno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": "1",
"name": "TW-JOE",
"type": "collection",
"ignore": [
"node_modules",
".git"
]
}
128 changes: 128 additions & 0 deletions bru-collections/tw-joe/response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
[
{
"iterationIndex": 0,
"summary": {
"totalRequests": 1,
"passedRequests": 1,
"failedRequests": 0,
"totalAssertions": 0,
"passedAssertions": 0,
"failedAssertions": 0,
"totalTests": 0,
"passedTests": 0,
"failedTests": 0
},
"results": [
{
"test": {
"filename": "Get the Readings.bru"
},
"request": {
"method": "GET",
"url": "http://localhost:8080/readings/read/smart-meter-1",
"headers": {}
},
"response": {
"status": 200,
"statusText": "",
"headers": {
"content-type": "application/json",
"transfer-encoding": "chunked",
"date": "Wed, 09 Oct 2024 10:52:20 GMT",
"keep-alive": "timeout=60",
"connection": "keep-alive"
},
"data": [
{
"time": "2024-10-09T10:49:05.066356Z",
"reading": 0.4602
},
{
"time": "2024-10-09T10:49:15.066356Z",
"reading": 0.7948
},
{
"time": "2024-10-09T10:49:25.066356Z",
"reading": 1.1288
},
{
"time": "2024-10-09T10:49:35.066356Z",
"reading": 0.693
},
{
"time": "2024-10-09T10:49:45.066356Z",
"reading": 1.3067
},
{
"time": "2024-10-09T10:49:55.066356Z",
"reading": 0.2352
},
{
"time": "2024-10-09T10:50:05.066356Z",
"reading": 0.0247
},
{
"time": "2024-10-09T10:50:15.066356Z",
"reading": 1.5714
},
{
"time": "2024-10-09T10:50:25.066356Z",
"reading": 1.3678
},
{
"time": "2024-10-09T10:50:35.066356Z",
"reading": 1.8501
},
{
"time": "2024-10-09T10:50:45.066356Z",
"reading": 0.6316
},
{
"time": "2024-10-09T10:50:55.066356Z",
"reading": 1.1308
},
{
"time": "2024-10-09T10:51:05.066356Z",
"reading": 0.0577
},
{
"time": "2024-10-09T10:51:15.066356Z",
"reading": 1.4548
},
{
"time": "2024-10-09T10:51:25.066356Z",
"reading": 1.8669
},
{
"time": "2024-10-09T10:51:35.066356Z",
"reading": 1.182
},
{
"time": "2024-10-09T10:51:45.066356Z",
"reading": 0.896
},
{
"time": "2024-10-09T10:51:55.066356Z",
"reading": 0.7743
},
{
"time": "2024-10-09T10:52:05.066356Z",
"reading": 0.2552
},
{
"time": "2024-10-09T10:52:15.066356Z",
"reading": 0.7704
}
],
"responseTime": 130
},
"error": null,
"assertionResults": [],
"testResults": [],
"runtime": 0.133265292,
"suitename": "Get the Readings",
"iterationIndex": 0
}
]
}
]

0 comments on commit 7666a38

Please sign in to comment.