From 5ce657997a983ce35b592e02e224c590d7c915e6 Mon Sep 17 00:00:00 2001 From: Sarthak160 Date: Sun, 18 Dec 2022 16:51:36 +0530 Subject: [PATCH] feat: keploy integrate Signed-off-by: Sarthak160 --- .gitignore | 186 +++++++++++++++ pom.xml | 211 ++++++++++-------- .../java/com/javachinna/config/AppConfig.java | 3 + .../controller/ProductResource.java | 13 ++ .../service/impl/ProductServiceImpl.java | 77 ++++--- src/main/resources/META-INF/persistence.xml | 10 +- src/main/webapp/WEB-INF/web.xml | 11 + src/test/e2e/keploy-tests/test-1.yaml | 38 ++++ src/test/e2e/keploy-tests/test-10.yaml | 38 ++++ src/test/e2e/keploy-tests/test-2.yaml | 41 ++++ src/test/e2e/keploy-tests/test-3.yaml | 41 ++++ src/test/e2e/keploy-tests/test-4.yaml | 41 ++++ src/test/e2e/keploy-tests/test-5.yaml | 41 ++++ src/test/e2e/keploy-tests/test-6.yaml | 38 ++++ src/test/e2e/keploy-tests/test-7.yaml | 40 ++++ src/test/e2e/keploy-tests/test-8.yaml | 38 ++++ src/test/e2e/keploy-tests/test-9.yaml | 40 ++++ src/test/e2e/mocks/test-2.yaml | 35 +++ src/test/e2e/mocks/test-3.yaml | 35 +++ src/test/e2e/mocks/test-4.yaml | 35 +++ src/test/e2e/mocks/test-5.yaml | 35 +++ src/test/e2e/mocks/test-7.yaml | 17 ++ src/test/e2e/mocks/test-9.yaml | 17 ++ 23 files changed, 948 insertions(+), 133 deletions(-) create mode 100644 .gitignore create mode 100644 src/test/e2e/keploy-tests/test-1.yaml create mode 100644 src/test/e2e/keploy-tests/test-10.yaml create mode 100644 src/test/e2e/keploy-tests/test-2.yaml create mode 100644 src/test/e2e/keploy-tests/test-3.yaml create mode 100644 src/test/e2e/keploy-tests/test-4.yaml create mode 100644 src/test/e2e/keploy-tests/test-5.yaml create mode 100644 src/test/e2e/keploy-tests/test-6.yaml create mode 100644 src/test/e2e/keploy-tests/test-7.yaml create mode 100644 src/test/e2e/keploy-tests/test-8.yaml create mode 100644 src/test/e2e/keploy-tests/test-9.yaml create mode 100644 src/test/e2e/mocks/test-2.yaml create mode 100644 src/test/e2e/mocks/test-3.yaml create mode 100644 src/test/e2e/mocks/test-4.yaml create mode 100644 src/test/e2e/mocks/test-5.yaml create mode 100644 src/test/e2e/mocks/test-7.yaml create mode 100644 src/test/e2e/mocks/test-9.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c0d0da2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,186 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/macos,linux,jetbrains,visualstudiocode +# Edit at https://www.toptal.com/developers/gitignore?templates=macos,linux,jetbrains,visualstudiocode + +### JetBrains ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/ +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules + *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### JetBrains Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# Support for Project snippet scope + +# End of https://www.toptal.com/developers/gitignore/api/macos,linux,jetbrains,visualstudiocode + +target/ +dependency-reduced-pom.xml + +pom.xml.versionsBackup +sdk.iml \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4161696..8e03c79 100644 --- a/pom.xml +++ b/pom.xml @@ -1,104 +1,123 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - 4.0.0 + 4.0.0 - com.javachinna - jersey-rest - war - 1.0-SNAPSHOT - jersey-rest + com.javachinna + jersey-rest + war + 1.0-SNAPSHOT + jersey-rest - - jersey-rest - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - true - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-war-plugin - - false - - - - + + ROOT + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + true + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.1 + + + - - - - org.glassfish.jersey - jersey-bom - ${jersey.version} - pom - import - - - + + + + org.glassfish.jersey + jersey-bom + ${jersey.version} + pom + import + + + - - - org.glassfish.jersey.containers - jersey-container-servlet-core - - - - - - org.glassfish.jersey.inject - jersey-hk2 - - - org.glassfish.jersey.media - jersey-media-json-binding - - - - org.glassfish.jersey.ext - jersey-bean-validation - + + + + javax.servlet + javax.servlet-api + 4.0.1 + - - - org.hibernate - hibernate-core - ${hibernate.version} - - - - org.hibernate - hibernate-c3p0 - ${hibernate.version} - - - - mysql - mysql-connector-java - 8.0.26 - - - org.projectlombok - lombok - 1.18.20 - provided - - - ch.qos.logback - logback-classic - 1.2.4 - - - - 5.5.4.Final - 2.34 - UTF-8 - + + jakarta.servlet + jakarta.servlet-api + 5.0.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.glassfish.jersey.containers + jersey-container-servlet-core + + + + + + org.glassfish.jersey.inject + jersey-hk2 + + + org.glassfish.jersey.media + jersey-media-json-binding + + + + org.glassfish.jersey.ext + jersey-bean-validation + + + io.keploy + keploy-sdk + 0.0.1-SNAPSHOT + + + + org.hibernate + hibernate-core + ${hibernate.version} + + + + org.hibernate + hibernate-c3p0 + ${hibernate.version} + + + + mysql + mysql-connector-java + 8.0.26 + + + org.projectlombok + lombok + 1.18.20 + provided + + + ch.qos.logback + logback-classic + 1.2.4 + + + + 5.5.4.Final + 2.34 + UTF-8 + diff --git a/src/main/java/com/javachinna/config/AppConfig.java b/src/main/java/com/javachinna/config/AppConfig.java index 761fb15..e5aa2f8 100644 --- a/src/main/java/com/javachinna/config/AppConfig.java +++ b/src/main/java/com/javachinna/config/AppConfig.java @@ -1,5 +1,6 @@ package com.javachinna.config; +import io.keploy.ksql.KDriver; import org.glassfish.hk2.utilities.binding.AbstractBinder; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.server.ServerProperties; @@ -9,6 +10,8 @@ import com.javachinna.service.ProductService; import com.javachinna.service.impl.ProductServiceImpl; +import java.sql.SQLException; + public class AppConfig extends ResourceConfig { public AppConfig() { diff --git a/src/main/java/com/javachinna/controller/ProductResource.java b/src/main/java/com/javachinna/controller/ProductResource.java index 0051335..2f2e9a5 100644 --- a/src/main/java/com/javachinna/controller/ProductResource.java +++ b/src/main/java/com/javachinna/controller/ProductResource.java @@ -1,5 +1,6 @@ package com.javachinna.controller; +import java.sql.SQLException; import java.util.List; import javax.inject.Inject; @@ -19,6 +20,7 @@ import com.javachinna.model.Product; import com.javachinna.service.ProductService; +import io.keploy.ksql.KDriver; import lombok.extern.slf4j.Slf4j; /** @@ -27,6 +29,17 @@ @Slf4j @Path("products") public class ProductResource { + static { + // Print statement + System.out.print( + "Static block can be printed without main method"); + try { + KDriver.WrapDriver(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + } + private ProductService productService; diff --git a/src/main/java/com/javachinna/service/impl/ProductServiceImpl.java b/src/main/java/com/javachinna/service/impl/ProductServiceImpl.java index 2e5025e..4e9b7f9 100644 --- a/src/main/java/com/javachinna/service/impl/ProductServiceImpl.java +++ b/src/main/java/com/javachinna/service/impl/ProductServiceImpl.java @@ -1,5 +1,6 @@ package com.javachinna.service.impl; +import java.sql.SQLException; import java.util.List; import java.util.Optional; @@ -7,40 +8,52 @@ import com.javachinna.model.Product; import com.javachinna.repo.ProductRepository; -import com.javachinna.service.ProductService;; +import com.javachinna.service.ProductService; +import io.keploy.ksql.KDriver; public class ProductServiceImpl implements ProductService { - private ProductRepository productRepository; - - @Inject - public ProductServiceImpl(ProductRepository productRepository) { - this.productRepository = productRepository; - } - - @Override - public Product save(Product product) { - return productRepository.save(product); - } - - @Override - public void deleteById(Long id) { - productRepository.deleteById(id); - } - - @Override - public Optional findById(Long id) { - return productRepository.findById(id); - } - - @Override - public List findAll() { - return productRepository.findAll(); - } - - @Override - public Product update(Product product) { - return productRepository.update(product); - } + private ProductRepository productRepository; + +// static { +// // Print statement +// System.out.print( +// "Static block can be printed without main method"); +// try { +// KDriver.WrapDriver(); +// } catch (SQLException e) { +// throw new RuntimeException(e); +// } +// } + + @Inject + public ProductServiceImpl(ProductRepository productRepository) { + this.productRepository = productRepository; + } + + @Override + public Product save(Product product) { + return productRepository.save(product); + } + + @Override + public void deleteById(Long id) { + productRepository.deleteById(id); + } + + @Override + public Optional findById(Long id) { + return productRepository.findById(id); + } + + @Override + public List findAll() { + return productRepository.findAll(); + } + + @Override + public Product update(Product product) { + return productRepository.update(product); + } } diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 794c0c2..f92d4f0 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -6,14 +6,14 @@ version="2.1"> - - - + + + - + - + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 1c05e5e..c195086 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -2,6 +2,17 @@ + + jersey-rest-crud + + + middleware + io.keploy.servlet.KeployMiddleware + + + middleware + /* + Jersey Web Application org.glassfish.jersey.servlet.ServletContainer diff --git a/src/test/e2e/keploy-tests/test-1.yaml b/src/test/e2e/keploy-tests/test-1.yaml new file mode 100644 index 0000000..ada6d6b --- /dev/null +++ b/src/test/e2e/keploy-tests/test-1.yaml @@ -0,0 +1,38 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-1 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/products + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "38" + content-type: application/json + host: localhost:8080 + postman-token: 481cbf4f-d1bb-4054-b405-8b29a2a593e4 + user-agent: PostmanRuntime/7.30.0 + body: |- + { + "name":"Fool", + "price": 10 + } + resp: + status_code: 200 + header: {} + body: Product added + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + assertions: + noise: [] + created: 1671358985 diff --git a/src/test/e2e/keploy-tests/test-10.yaml b/src/test/e2e/keploy-tests/test-10.yaml new file mode 100644 index 0000000..656931a --- /dev/null +++ b/src/test/e2e/keploy-tests/test-10.yaml @@ -0,0 +1,38 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-10 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/products + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "38" + content-type: application/json + host: localhost:8080 + postman-token: d62e0cfa-482f-4c62-8600-6788ed4de786 + user-agent: PostmanRuntime/7.30.0 + body: |- + { + "name":"Toy", + "price": 200 + } + resp: + status_code: 200 + header: {} + body: Product added + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + assertions: + noise: [] + created: 1671360715 diff --git a/src/test/e2e/keploy-tests/test-2.yaml b/src/test/e2e/keploy-tests/test-2.yaml new file mode 100644 index 0000000..c0a3c4d --- /dev/null +++ b/src/test/e2e/keploy-tests/test-2.yaml @@ -0,0 +1,41 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-2 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/products + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "38" + content-type: application/json + host: localhost:8080 + postman-token: d9250605-12f9-4163-b557-f6ac41cc387b + user-agent: PostmanRuntime/7.30.0 + body: |- + { + "name":"Fool", + "price": 10 + } + resp: + status_code: 200 + header: {} + body: Product added + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-2-0 + - test-2-1 + assertions: + noise: [] + created: 1671359001 diff --git a/src/test/e2e/keploy-tests/test-3.yaml b/src/test/e2e/keploy-tests/test-3.yaml new file mode 100644 index 0000000..2f410fd --- /dev/null +++ b/src/test/e2e/keploy-tests/test-3.yaml @@ -0,0 +1,41 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-3 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/products + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "38" + content-type: application/json + host: localhost:8080 + postman-token: 9ffd9002-c1ce-470d-aa12-0c8475b0b9e6 + user-agent: PostmanRuntime/7.30.0 + body: |- + { + "name":"Fool", + "price": 10 + } + resp: + status_code: 200 + header: {} + body: Product added + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-3-0 + - test-3-1 + assertions: + noise: [] + created: 1671359086 diff --git a/src/test/e2e/keploy-tests/test-4.yaml b/src/test/e2e/keploy-tests/test-4.yaml new file mode 100644 index 0000000..35424ac --- /dev/null +++ b/src/test/e2e/keploy-tests/test-4.yaml @@ -0,0 +1,41 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-4 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/products + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "38" + content-type: application/json + host: localhost:8080 + postman-token: a5bf2797-b2b0-4d45-9c82-6df85bfa811c + user-agent: PostmanRuntime/7.30.0 + body: |- + { + "name":"Ball", + "price": 10 + } + resp: + status_code: 200 + header: {} + body: Product added + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-4-0 + - test-4-1 + assertions: + noise: [] + created: 1671359101 diff --git a/src/test/e2e/keploy-tests/test-5.yaml b/src/test/e2e/keploy-tests/test-5.yaml new file mode 100644 index 0000000..cb2af82 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-5.yaml @@ -0,0 +1,41 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-5 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/products + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "39" + content-type: application/json + host: localhost:8080 + postman-token: e6c04831-b1a6-4c38-9732-fb1788489d1e + user-agent: PostmanRuntime/7.30.0 + body: |- + { + "name":"Doll", + "price": 200 + } + resp: + status_code: 200 + header: {} + body: Product added + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-5-0 + - test-5-1 + assertions: + noise: [] + created: 1671359144 diff --git a/src/test/e2e/keploy-tests/test-6.yaml b/src/test/e2e/keploy-tests/test-6.yaml new file mode 100644 index 0000000..a646ef3 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-6.yaml @@ -0,0 +1,38 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-6 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/products + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "39" + content-type: application/json + host: localhost:8080 + postman-token: 1dc3a3c7-5f12-4173-b052-34b0592b4285 + user-agent: PostmanRuntime/7.30.0 + body: |- + { + "name":"Ball", + "price": 200 + } + resp: + status_code: 200 + header: {} + body: Product added + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + assertions: + noise: [] + created: 1671359973 diff --git a/src/test/e2e/keploy-tests/test-7.yaml b/src/test/e2e/keploy-tests/test-7.yaml new file mode 100644 index 0000000..97ab3b2 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-7.yaml @@ -0,0 +1,40 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-7 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/products + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "39" + content-type: application/json + host: localhost:8080 + postman-token: f7f53f81-baa9-47ff-bd8a-d0863772baa8 + user-agent: PostmanRuntime/7.30.0 + body: |- + { + "name":"Ball", + "price": 200 + } + resp: + status_code: 200 + header: {} + body: Product added + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-7-0 + assertions: + noise: [] + created: 1671360261 diff --git a/src/test/e2e/keploy-tests/test-8.yaml b/src/test/e2e/keploy-tests/test-8.yaml new file mode 100644 index 0000000..fbef4f6 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-8.yaml @@ -0,0 +1,38 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-8 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/products + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "39" + content-type: application/json + host: localhost:8080 + postman-token: afee3c07-9c4e-4cc6-89e1-86dac28f02b3 + user-agent: PostmanRuntime/7.30.0 + body: |- + { + "name":"Call", + "price": 200 + } + resp: + status_code: 200 + header: {} + body: Product added + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + assertions: + noise: [] + created: 1671360372 diff --git a/src/test/e2e/keploy-tests/test-9.yaml b/src/test/e2e/keploy-tests/test-9.yaml new file mode 100644 index 0000000..ab53c2c --- /dev/null +++ b/src/test/e2e/keploy-tests/test-9.yaml @@ -0,0 +1,40 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-9 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/products + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "39" + content-type: application/json + host: localhost:8080 + postman-token: e2e92069-e408-4a48-b6db-5389b3b09304 + user-agent: PostmanRuntime/7.30.0 + body: |- + { + "name":"Doll", + "price": 200 + } + resp: + status_code: 200 + header: {} + body: Product added + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-9-0 + assertions: + noise: [] + created: 1671360401 diff --git a/src/test/e2e/mocks/test-2.yaml b/src/test/e2e/mocks/test-2.yaml new file mode 100644 index 0000000..90dfe13 --- /dev/null +++ b/src/test/e2e/mocks/test-2.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-2-0 +spec: + metadata: + getColumnCount: "1" + method: close() + type: TABLE + table: + cols: + - name: "1" + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`]' + int: 0 +--- +version: api.keploy.io/v1beta1 +kind: SQL +name: test-2-1 +spec: + metadata: + getColumnCount: "1" + method: close() + type: TABLE + table: + cols: + - name: "1" + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`]' + int: 0 diff --git a/src/test/e2e/mocks/test-3.yaml b/src/test/e2e/mocks/test-3.yaml new file mode 100644 index 0000000..50b71f2 --- /dev/null +++ b/src/test/e2e/mocks/test-3.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-3-0 +spec: + metadata: + getColumnCount: "1" + method: close() + type: TABLE + table: + cols: + - name: "1" + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`]' + int: 0 +--- +version: api.keploy.io/v1beta1 +kind: SQL +name: test-3-1 +spec: + metadata: + getColumnCount: "1" + method: close() + type: TABLE + table: + cols: + - name: "1" + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`]' + int: 0 diff --git a/src/test/e2e/mocks/test-4.yaml b/src/test/e2e/mocks/test-4.yaml new file mode 100644 index 0000000..102e63d --- /dev/null +++ b/src/test/e2e/mocks/test-4.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-4-0 +spec: + metadata: + getColumnCount: "1" + method: close() + type: TABLE + table: + cols: + - name: "1" + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`]' + int: 0 +--- +version: api.keploy.io/v1beta1 +kind: SQL +name: test-4-1 +spec: + metadata: + getColumnCount: "1" + method: close() + type: TABLE + table: + cols: + - name: "1" + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`]' + int: 0 diff --git a/src/test/e2e/mocks/test-5.yaml b/src/test/e2e/mocks/test-5.yaml new file mode 100644 index 0000000..e48ea3a --- /dev/null +++ b/src/test/e2e/mocks/test-5.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-5-0 +spec: + metadata: + getColumnCount: "1" + method: close() + type: TABLE + table: + cols: + - name: "1" + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`]' + int: 0 +--- +version: api.keploy.io/v1beta1 +kind: SQL +name: test-5-1 +spec: + metadata: + getColumnCount: "1" + method: close() + type: TABLE + table: + cols: + - name: "1" + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`]' + int: 0 diff --git a/src/test/e2e/mocks/test-7.yaml b/src/test/e2e/mocks/test-7.yaml new file mode 100644 index 0000000..e649b1e --- /dev/null +++ b/src/test/e2e/mocks/test-7.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-7-0 +spec: + metadata: + getColumnCount: "1" + method: close() + type: TABLE + table: + cols: + - name: "1" + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`]' + int: 0 diff --git a/src/test/e2e/mocks/test-9.yaml b/src/test/e2e/mocks/test-9.yaml new file mode 100644 index 0000000..40f83b1 --- /dev/null +++ b/src/test/e2e/mocks/test-9.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-9-0 +spec: + metadata: + getColumnCount: "1" + method: close() + type: TABLE + table: + cols: + - name: "1" + type: Long + precision: 0 + scale: 0 + rows: + - '[`3`]' + int: 0