From 7666a383f6f08cf8451f9e513ec6ebfc46e51341 Mon Sep 17 00:00:00 2001 From: INDRA KUMAR R Date: Tue, 22 Oct 2024 17:48:18 +0530 Subject: [PATCH] Added bru-collections. --- .github/pull_request_template.md | 11 ++ .github/workflows/gradle.yml | 42 ++++++ .../tw-joe/Get Price plans with limit.bru | 15 ++ bru-collections/tw-joe/Get Price plans.bru | 11 ++ bru-collections/tw-joe/Get Total Cost.bru | 11 ++ bru-collections/tw-joe/Get the Readings.bru | 11 ++ bru-collections/tw-joe/Store the Reading.bru | 23 ++++ bru-collections/tw-joe/bruno.json | 9 ++ bru-collections/tw-joe/response.json | 128 ++++++++++++++++++ 9 files changed, 261 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/gradle.yml create mode 100644 bru-collections/tw-joe/Get Price plans with limit.bru create mode 100644 bru-collections/tw-joe/Get Price plans.bru create mode 100644 bru-collections/tw-joe/Get Total Cost.bru create mode 100644 bru-collections/tw-joe/Get the Readings.bru create mode 100644 bru-collections/tw-joe/Store the Reading.bru create mode 100644 bru-collections/tw-joe/bruno.json create mode 100644 bru-collections/tw-joe/response.json diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..0456d71 --- /dev/null +++ b/.github/pull_request_template.md @@ -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. diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..4bad0fc --- /dev/null +++ b/.github/workflows/gradle.yml @@ -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 \ No newline at end of file diff --git a/bru-collections/tw-joe/Get Price plans with limit.bru b/bru-collections/tw-joe/Get Price plans with limit.bru new file mode 100644 index 0000000..31f9319 --- /dev/null +++ b/bru-collections/tw-joe/Get Price plans with limit.bru @@ -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 +} diff --git a/bru-collections/tw-joe/Get Price plans.bru b/bru-collections/tw-joe/Get Price plans.bru new file mode 100644 index 0000000..241e38b --- /dev/null +++ b/bru-collections/tw-joe/Get Price plans.bru @@ -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 +} diff --git a/bru-collections/tw-joe/Get Total Cost.bru b/bru-collections/tw-joe/Get Total Cost.bru new file mode 100644 index 0000000..32dbc91 --- /dev/null +++ b/bru-collections/tw-joe/Get Total Cost.bru @@ -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 +} diff --git a/bru-collections/tw-joe/Get the Readings.bru b/bru-collections/tw-joe/Get the Readings.bru new file mode 100644 index 0000000..8b315d2 --- /dev/null +++ b/bru-collections/tw-joe/Get the Readings.bru @@ -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 +} diff --git a/bru-collections/tw-joe/Store the Reading.bru b/bru-collections/tw-joe/Store the Reading.bru new file mode 100644 index 0000000..391b75f --- /dev/null +++ b/bru-collections/tw-joe/Store the Reading.bru @@ -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}}" + } + ] + } +} diff --git a/bru-collections/tw-joe/bruno.json b/bru-collections/tw-joe/bruno.json new file mode 100644 index 0000000..daed206 --- /dev/null +++ b/bru-collections/tw-joe/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "TW-JOE", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/bru-collections/tw-joe/response.json b/bru-collections/tw-joe/response.json new file mode 100644 index 0000000..b24202a --- /dev/null +++ b/bru-collections/tw-joe/response.json @@ -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 + } + ] + } +] \ No newline at end of file