diff --git a/pom.xml b/pom.xml index 097ca565..5dbafd8f 100644 --- a/pom.xml +++ b/pom.xml @@ -30,20 +30,17 @@ - - - - - - - io.keploy keploy-sdk - 1.1.1 + 1.2.2 - + + org.mariadb.jdbc + mariadb-java-client + 2.7.1 + org.springframework.boot spring-boot-starter-data-jpa @@ -91,6 +88,12 @@ 1.18.24 provided + + + com.oracle.database.jdbc + ojdbc5 + 11.2.0.4 + diff --git a/src/main/java/com/example/demo/controller/EmployeeController.java b/src/main/java/com/example/demo/controller/EmployeeController.java index 829573a2..e88fa7e4 100644 --- a/src/main/java/com/example/demo/controller/EmployeeController.java +++ b/src/main/java/com/example/demo/controller/EmployeeController.java @@ -7,8 +7,11 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; import java.time.Instant; - +import java.util.HashMap; +import java.util.List; +import java.util.Map; @RestController @RequestMapping("/api/") @@ -17,6 +20,12 @@ public class EmployeeController { @Autowired private EmployeeRepository employeeRepository; + //get employees + @GetMapping("employees") + public List getAllEmployee() { + return this.employeeRepository.findAll(); + } + //get employee by id @GetMapping("employees/{id}") public ResponseEntity getEmployeeById(@PathVariable(value = "id") Long employeeId) throws ResourceNotFoundException { @@ -30,4 +39,27 @@ public Employee createEmployee(@RequestBody Employee employee) { employee.setTimestamp(Instant.now().getEpochSecond()); return this.employeeRepository.save(employee); } -} + + //update employee + @PutMapping("employees/{id}") + public ResponseEntity updateEmployee(@PathVariable(value = "id") Long employeeId, @Valid @RequestBody Employee employeeDetails) throws ResourceNotFoundException { + + Employee employee = employeeRepository.findById(employeeId).orElseThrow(() -> new ResourceNotFoundException("Employee not found for this id :: " + employeeId)); + employee.setEmail(employeeDetails.getEmail()); + employee.setFirstName(employeeDetails.getFirstName()); + employee.setLastName(employeeDetails.getLastName()); + employee.setTimestamp(Instant.now().getEpochSecond()); + return ResponseEntity.ok(this.employeeRepository.save(employee)); + } + + //delete employee + @DeleteMapping("employees/{id}") + public Map deleteEmployee(@PathVariable(value = "id") Long employeeId) throws ResourceNotFoundException { + Employee employee = employeeRepository.findById(employeeId).orElseThrow(() -> new ResourceNotFoundException("Employee not found for this id :: " + employeeId)); + this.employeeRepository.delete(employee); + Map response = new HashMap<>(); + response.put("deleted", Boolean.TRUE); + + return response; + } +} \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 29b0a2f3..8dfd91cb 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.datasource.url=jdbc:postgresql://localhost:5439/keploy-test spring.datasource.username=keploy-user spring.datasource.password=keploy -spring.jpa.show-sql=true +#spring.jpa.show-sql=true #spring.datasource.driverClassName=io.keploy.ksql.KDriver spring.jpa.properties.hibernate.format_sql=true ## Hibernate Properties @@ -11,8 +11,8 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.hibernate.ddl-auto=update # in order to populate some initial data for testing mark it as true. -spring.jpa.defer-datasource-initialization=true -spring.sql.init.mode=always +#spring.jpa.defer-datasource-initialization=true +#spring.sql.init.mode=always server.port=8080 logging.level.root=INFO \ No newline at end of file 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 00000000..55bbc7d1 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-1.yaml @@ -0,0 +1,37 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-1 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "101" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"Sam\",\n \"lastName\": \"Tyson\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":1,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896801}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-1-0 + assertions: + noise: + - body.timestamp + - body.id + created: 1671896802 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 00000000..4a4de0cf --- /dev/null +++ b/src/test/e2e/keploy-tests/test-10.yaml @@ -0,0 +1,36 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-10 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "103" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"Trent\",\n \"lastName\": \"Boult\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":8,"firstName":"Trent","lastName":"Boult","email":"mt@gmail.com","timestamp":1671974006}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-10-0 + assertions: + noise: + - body.timestamp + created: 1671974006 diff --git a/src/test/e2e/keploy-tests/test-11.yaml b/src/test/e2e/keploy-tests/test-11.yaml new file mode 100644 index 00000000..7d43cc1b --- /dev/null +++ b/src/test/e2e/keploy-tests/test-11.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-11 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "103" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "" + resp: + status_code: 200 + header: {} + body: '[{"id":1,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896801},{"id":2,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896805},{"id":3,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897026},{"id":4,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897029},{"id":5,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897896},{"id":6,"firstName":"Tom","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671898758},{"id":7,"firstName":"mom","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671901970},{"id":8,"firstName":"Trent","lastName":"Boult","email":"mt@gmail.com","timestamp":1671974006}]' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-11-0 + assertions: + noise: [] + created: 1671974030 diff --git a/src/test/e2e/keploy-tests/test-12.yaml b/src/test/e2e/keploy-tests/test-12.yaml new file mode 100644 index 00000000..4caa1e4a --- /dev/null +++ b/src/test/e2e/keploy-tests/test-12.yaml @@ -0,0 +1,36 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-12 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "103" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"Harry\",\n \"lastName\": \"Brook\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":9,"firstName":"Harry","lastName":"Brook","email":"mt@gmail.com","timestamp":1671974094}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-12-0 + assertions: + noise: + - body.timestamp + created: 1671974094 diff --git a/src/test/e2e/keploy-tests/test-13.yaml b/src/test/e2e/keploy-tests/test-13.yaml new file mode 100644 index 00000000..858bbd94 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-13.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-13 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: /api/employees/6 + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "103" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "" + resp: + status_code: 200 + header: {} + body: '{"id":6,"firstName":"Tom","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671898758}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-13-0 + assertions: + noise: [] + created: 1671974113 diff --git a/src/test/e2e/keploy-tests/test-14.yaml b/src/test/e2e/keploy-tests/test-14.yaml new file mode 100644 index 00000000..8a3c40a5 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-14.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-14 +spec: + metadata: {} + req: + method: DELETE + proto_major: 1 + proto_minor: 1 + url: /api/employees/6 + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "103" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "" + resp: + status_code: 200 + header: {} + body: '{"deleted":true}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-14-0 + assertions: + noise: [] + created: 1671974119 diff --git a/src/test/e2e/keploy-tests/test-15.yaml b/src/test/e2e/keploy-tests/test-15.yaml new file mode 100644 index 00000000..a0ca51d8 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-15.yaml @@ -0,0 +1,36 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-15 +spec: + metadata: {} + req: + method: PUT + proto_major: 1 + proto_minor: 1 + url: /api/employees/9 + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "103" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"Barry\",\n \"lastName\": \"Brook\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":9,"firstName":"Barry","lastName":"Brook","email":"mt@gmail.com","timestamp":1671974135}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-15-0 + assertions: + noise: + - body.timestamp + created: 1671974135 diff --git a/src/test/e2e/keploy-tests/test-16.yaml b/src/test/e2e/keploy-tests/test-16.yaml new file mode 100644 index 00000000..8de47699 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-16.yaml @@ -0,0 +1,36 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-16 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "103" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"David\",\n \"lastName\": \"Brook\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":12,"firstName":"David","lastName":"Brook","email":"mt@gmail.com","timestamp":1672041591}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-16-0 + assertions: + noise: + - body.timestamp + created: 1672041623 diff --git a/src/test/e2e/keploy-tests/test-17.yaml b/src/test/e2e/keploy-tests/test-17.yaml new file mode 100644 index 00000000..81d95e76 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-17.yaml @@ -0,0 +1,36 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-17 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "103" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"David\",\n \"lastName\": \"Brook\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":13,"firstName":"David","lastName":"Brook","email":"mt@gmail.com","timestamp":1672042234}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-17-0 + assertions: + noise: + - body.timestamp + created: 1672042234 diff --git a/src/test/e2e/keploy-tests/test-18.yaml b/src/test/e2e/keploy-tests/test-18.yaml new file mode 100644 index 00000000..cdb00216 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-18.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-18 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "103" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "" + resp: + status_code: 200 + header: {} + body: '[{"id":1,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896801},{"id":2,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896805},{"id":3,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897026},{"id":4,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897029},{"id":5,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897896},{"id":7,"firstName":"mom","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671901970},{"id":8,"firstName":"Trent","lastName":"Boult","email":"mt@gmail.com","timestamp":1671974006},{"id":9,"firstName":"Barry","lastName":"Brook","email":"mt@gmail.com","timestamp":1671974135},{"id":10,"firstName":"David","lastName":"Brook","email":"mt@gmail.com","timestamp":1672041183},{"id":11,"firstName":"David","lastName":"Brook","email":"mt@gmail.com","timestamp":1672041330},{"id":12,"firstName":"David","lastName":"Brook","email":"mt@gmail.com","timestamp":1672041591},{"id":13,"firstName":"David","lastName":"Brook","email":"mt@gmail.com","timestamp":1672042234}]' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-18-0 + assertions: + noise: [] + created: 1672042256 diff --git a/src/test/e2e/keploy-tests/test-19.yaml b/src/test/e2e/keploy-tests/test-19.yaml new file mode 100644 index 00000000..79e794bd --- /dev/null +++ b/src/test/e2e/keploy-tests/test-19.yaml @@ -0,0 +1,36 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-19 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "104" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"David\",\n \"lastName\": \"Warner\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":14,"firstName":"David","lastName":"Warner","email":"mt@gmail.com","timestamp":1672042895}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-19-0 + assertions: + noise: + - body.timestamp + created: 1672042895 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 00000000..97c3c1a7 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-2.yaml @@ -0,0 +1,37 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-2 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "101" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"Sam\",\n \"lastName\": \"Tyson\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":3,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897026}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-2-0 + assertions: + noise: + - body.timestamp + - body.id + created: 1671897026 diff --git a/src/test/e2e/keploy-tests/test-20.yaml b/src/test/e2e/keploy-tests/test-20.yaml new file mode 100644 index 00000000..ee2a2632 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-20.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-20 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "104" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "" + resp: + status_code: 200 + header: {} + body: '[{"id":1,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896801},{"id":2,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896805},{"id":3,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897026},{"id":4,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897029},{"id":5,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897896},{"id":7,"firstName":"mom","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671901970},{"id":8,"firstName":"Trent","lastName":"Boult","email":"mt@gmail.com","timestamp":1671974006},{"id":9,"firstName":"Barry","lastName":"Brook","email":"mt@gmail.com","timestamp":1671974135},{"id":10,"firstName":"David","lastName":"Brook","email":"mt@gmail.com","timestamp":1672041183},{"id":11,"firstName":"David","lastName":"Brook","email":"mt@gmail.com","timestamp":1672041330},{"id":12,"firstName":"David","lastName":"Brook","email":"mt@gmail.com","timestamp":1672041591},{"id":13,"firstName":"David","lastName":"Brook","email":"mt@gmail.com","timestamp":1672042234},{"id":14,"firstName":"David","lastName":"Warner","email":"mt@gmail.com","timestamp":1672042895}]' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-20-0 + assertions: + noise: [] + created: 1672042913 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 00000000..a7c8c319 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-3.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-3 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "101" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "" + resp: + status_code: 200 + header: {} + body: '[{"id":1,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896801},{"id":2,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896805},{"id":3,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897026},{"id":4,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897029}]' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-3-0 + assertions: + noise: [] + created: 1671897170 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 00000000..ed1c9e37 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-4.yaml @@ -0,0 +1,36 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-4 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "101" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"Sam\",\n \"lastName\": \"Tyson\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":5,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897896}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-4-0 + assertions: + noise: + - body.timestamp + created: 1671897896 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 00000000..0e8d32e7 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-5.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-5 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "101" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "" + resp: + status_code: 200 + header: {} + body: '[{"id":1,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896801},{"id":2,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896805},{"id":3,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897026},{"id":4,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897029},{"id":5,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897896}]' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-5-0 + assertions: + noise: [] + created: 1671897903 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 00000000..a4924333 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-6.yaml @@ -0,0 +1,36 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-6 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "101" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"Tom\",\n \"lastName\": \"Tyson\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":6,"firstName":"Tom","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671898758}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-6-0 + assertions: + noise: + - body.timestamp + created: 1671898758 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 00000000..fbcab14f --- /dev/null +++ b/src/test/e2e/keploy-tests/test-7.yaml @@ -0,0 +1,35 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-7 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "101" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "" + resp: + status_code: 200 + header: {} + body: '[{"id":1,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896801},{"id":2,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896805},{"id":3,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897026},{"id":4,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897029},{"id":5,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897896},{"id":6,"firstName":"Tom","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671898758}]' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-7-0 + assertions: + noise: [] + created: 1671898762 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 00000000..01e0e189 --- /dev/null +++ b/src/test/e2e/keploy-tests/test-8.yaml @@ -0,0 +1,33 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-8 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "" + resp: + status_code: 200 + header: {} + body: '[{"id":1,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896801},{"id":2,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671896805},{"id":3,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897026},{"id":4,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897029},{"id":5,"firstName":"Sam","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671897896},{"id":6,"firstName":"Tom","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671898758}]' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-8-0 + assertions: + noise: [] + created: 1671899064 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 00000000..0124bd9b --- /dev/null +++ b/src/test/e2e/keploy-tests/test-9.yaml @@ -0,0 +1,36 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-9 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: /api/employees + header: + accept: '*/*' + accept-encoding: gzip, deflate, br + cache-control: no-cache + connection: keep-alive + content-length: "101" + content-type: application/json + host: localhost:8080 + user-agent: PostmanRuntime/7.29.2 + body: "{\n \"firstName\": \"mom\",\n \"lastName\": \"Tyson\", \n \"email\": \"mt@gmail.com\",\n \"timestamp\":1\n}" + resp: + status_code: 200 + header: {} + body: '{"id":7,"firstName":"mom","lastName":"Tyson","email":"mt@gmail.com","timestamp":1671901970}' + status_message: OK + proto_major: 1 + proto_minor: 1 + objects: + - type: error + data: H4sIAAAAAAAA/wEAAP//AAAAAAAAAAA= + mocks: + - test-9-0 + assertions: + noise: + - body.timestamp + created: 1671901970 diff --git a/src/test/e2e/mocks/test-1.yaml b/src/test/e2e/mocks/test-1.yaml new file mode 100644 index 00000000..fe4d4049 --- /dev/null +++ b/src/test/e2e/mocks/test-1.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-1-0 +spec: + metadata: + getColumnCount: "5" + method: close() + type: TABLE + table: + cols: + - name: id + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`]' + int: 0 diff --git a/src/test/e2e/mocks/test-10.yaml b/src/test/e2e/mocks/test-10.yaml new file mode 100644 index 00000000..eeec2991 --- /dev/null +++ b/src/test/e2e/mocks/test-10.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-10-0 +spec: + metadata: + getColumnCount: "5" + method: close() + type: TABLE + table: + cols: + - name: id + type: Long + precision: 0 + scale: 0 + rows: + - '[`8`]' + int: 0 diff --git a/src/test/e2e/mocks/test-11.yaml b/src/test/e2e/mocks/test-11.yaml new file mode 100644 index 00000000..867fe566 --- /dev/null +++ b/src/test/e2e/mocks/test-11.yaml @@ -0,0 +1,40 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-11-0 +spec: + metadata: + SQL-Query: select employee0_.id as id1_0_, employee0_.email as email2_0_, employee0_.first_name as first_na3_0_, employee0_.last_name as last_nam4_0_, employee0_.timestamp as timestam5_0_ from employees employee0_ + method: next() + type: TABLE + table: + cols: + - name: id1_0_ + type: Long + precision: 0 + scale: 0 + - name: email2_0_ + type: String + precision: 0 + scale: 0 + - name: first_na3_0_ + type: String + precision: 0 + scale: 0 + - name: last_nam4_0_ + type: String + precision: 0 + scale: 0 + - name: timestam5_0_ + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896801`]' + - '[`2`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896805`]' + - '[`3`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897026`]' + - '[`4`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897029`]' + - '[`5`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897896`]' + - '[`6`|`mt@gmail.com`|`Tom`|`Tyson`|`1671898758`]' + - '[`7`|`mt@gmail.com`|`mom`|`Tyson`|`1671901970`]' + - '[`8`|`mt@gmail.com`|`Trent`|`Boult`|`1671974006`]' + int: 0 diff --git a/src/test/e2e/mocks/test-12.yaml b/src/test/e2e/mocks/test-12.yaml new file mode 100644 index 00000000..e59d973c --- /dev/null +++ b/src/test/e2e/mocks/test-12.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-12-0 +spec: + metadata: + getColumnCount: "5" + method: close() + type: TABLE + table: + cols: + - name: id + type: Long + precision: 0 + scale: 0 + rows: + - '[`9`]' + int: 0 diff --git a/src/test/e2e/mocks/test-13.yaml b/src/test/e2e/mocks/test-13.yaml new file mode 100644 index 00000000..9614a1cb --- /dev/null +++ b/src/test/e2e/mocks/test-13.yaml @@ -0,0 +1,29 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-13-0 +spec: + metadata: + SQL-Query: select employee0_.id as id1_0_0_, employee0_.email as email2_0_0_, employee0_.first_name as first_na3_0_0_, employee0_.last_name as last_nam4_0_0_, employee0_.timestamp as timestam5_0_0_ from employees employee0_ where employee0_.id=? + method: next() + type: TABLE + table: + cols: + - name: email2_0_0_ + type: String + precision: 0 + scale: 0 + - name: first_na3_0_0_ + type: String + precision: 0 + scale: 0 + - name: last_nam4_0_0_ + type: String + precision: 0 + scale: 0 + - name: timestam5_0_0_ + type: Long + precision: 0 + scale: 0 + rows: + - '[`mt@gmail.com`|`Tom`|`Tyson`|`1671898758`]' + int: 0 diff --git a/src/test/e2e/mocks/test-14.yaml b/src/test/e2e/mocks/test-14.yaml new file mode 100644 index 00000000..2a528d2c --- /dev/null +++ b/src/test/e2e/mocks/test-14.yaml @@ -0,0 +1,29 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-14-0 +spec: + metadata: + SQL-Query: select employee0_.id as id1_0_0_, employee0_.email as email2_0_0_, employee0_.first_name as first_na3_0_0_, employee0_.last_name as last_nam4_0_0_, employee0_.timestamp as timestam5_0_0_ from employees employee0_ where employee0_.id=? + method: next() + type: TABLE + table: + cols: + - name: email2_0_0_ + type: String + precision: 0 + scale: 0 + - name: first_na3_0_0_ + type: String + precision: 0 + scale: 0 + - name: last_nam4_0_0_ + type: String + precision: 0 + scale: 0 + - name: timestam5_0_0_ + type: Long + precision: 0 + scale: 0 + rows: + - '[`mt@gmail.com`|`Tom`|`Tyson`|`1671898758`]' + int: 0 diff --git a/src/test/e2e/mocks/test-15.yaml b/src/test/e2e/mocks/test-15.yaml new file mode 100644 index 00000000..52faf4ce --- /dev/null +++ b/src/test/e2e/mocks/test-15.yaml @@ -0,0 +1,29 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-15-0 +spec: + metadata: + SQL-Query: select employee0_.id as id1_0_0_, employee0_.email as email2_0_0_, employee0_.first_name as first_na3_0_0_, employee0_.last_name as last_nam4_0_0_, employee0_.timestamp as timestam5_0_0_ from employees employee0_ where employee0_.id=? + method: next() + type: TABLE + table: + cols: + - name: email2_0_0_ + type: String + precision: 0 + scale: 0 + - name: first_na3_0_0_ + type: String + precision: 0 + scale: 0 + - name: last_nam4_0_0_ + type: String + precision: 0 + scale: 0 + - name: timestam5_0_0_ + type: Long + precision: 0 + scale: 0 + rows: + - '[`mt@gmail.com`|`Harry`|`Brook`|`1671974094`]' + int: 0 diff --git a/src/test/e2e/mocks/test-16.yaml b/src/test/e2e/mocks/test-16.yaml new file mode 100644 index 00000000..e10399a7 --- /dev/null +++ b/src/test/e2e/mocks/test-16.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-16-0 +spec: + metadata: + getColumnCount: "5" + method: close() + type: TABLE + table: + cols: + - name: id + type: Long + precision: 1 + scale: 5 + rows: + - '[`12`]' + int: 0 diff --git a/src/test/e2e/mocks/test-17.yaml b/src/test/e2e/mocks/test-17.yaml new file mode 100644 index 00000000..2d078506 --- /dev/null +++ b/src/test/e2e/mocks/test-17.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-17-0 +spec: + metadata: + getColumnCount: "5" + method: close() + type: TABLE + table: + cols: + - name: id + type: Long + precision: 0 + scale: 0 + rows: + - '[`13`]' + int: 0 diff --git a/src/test/e2e/mocks/test-18.yaml b/src/test/e2e/mocks/test-18.yaml new file mode 100644 index 00000000..dbd737a1 --- /dev/null +++ b/src/test/e2e/mocks/test-18.yaml @@ -0,0 +1,44 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-18-0 +spec: + metadata: + SQL-Query: select employee0_.id as id1_0_, employee0_.email as email2_0_, employee0_.first_name as first_na3_0_, employee0_.last_name as last_nam4_0_, employee0_.timestamp as timestam5_0_ from employees employee0_ + method: next() + type: TABLE + table: + cols: + - name: id1_0_ + type: Long + precision: 0 + scale: 0 + - name: email2_0_ + type: String + precision: 0 + scale: 0 + - name: first_na3_0_ + type: String + precision: 0 + scale: 0 + - name: last_nam4_0_ + type: String + precision: 0 + scale: 0 + - name: timestam5_0_ + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896801`]' + - '[`2`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896805`]' + - '[`3`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897026`]' + - '[`4`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897029`]' + - '[`5`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897896`]' + - '[`7`|`mt@gmail.com`|`mom`|`Tyson`|`1671901970`]' + - '[`8`|`mt@gmail.com`|`Trent`|`Boult`|`1671974006`]' + - '[`9`|`mt@gmail.com`|`Barry`|`Brook`|`1671974135`]' + - '[`10`|`mt@gmail.com`|`David`|`Brook`|`1672041183`]' + - '[`11`|`mt@gmail.com`|`David`|`Brook`|`1672041330`]' + - '[`12`|`mt@gmail.com`|`David`|`Brook`|`1672041591`]' + - '[`13`|`mt@gmail.com`|`David`|`Brook`|`1672042234`]' + int: 0 diff --git a/src/test/e2e/mocks/test-19.yaml b/src/test/e2e/mocks/test-19.yaml new file mode 100644 index 00000000..f1e3c860 --- /dev/null +++ b/src/test/e2e/mocks/test-19.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-19-0 +spec: + metadata: + getColumnCount: "5" + method: close() + type: TABLE + table: + cols: + - name: id + type: Long + precision: 5 + scale: 7 + rows: + - '[`14`]' + int: 1 diff --git a/src/test/e2e/mocks/test-2.yaml b/src/test/e2e/mocks/test-2.yaml new file mode 100644 index 00000000..916f30c5 --- /dev/null +++ b/src/test/e2e/mocks/test-2.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-2-0 +spec: + metadata: + getColumnCount: "5" + method: close() + type: TABLE + table: + cols: + - name: id + type: Long + precision: 0 + scale: 0 + rows: + - '[`3`]' + int: 0 diff --git a/src/test/e2e/mocks/test-20.yaml b/src/test/e2e/mocks/test-20.yaml new file mode 100644 index 00000000..a9439ed3 --- /dev/null +++ b/src/test/e2e/mocks/test-20.yaml @@ -0,0 +1,45 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-20-0 +spec: + metadata: + SQL-Query: select employee0_.id as id1_0_, employee0_.email as email2_0_, employee0_.first_name as first_na3_0_, employee0_.last_name as last_nam4_0_, employee0_.timestamp as timestam5_0_ from employees employee0_ + method: next() + type: TABLE + table: + cols: + - name: id1_0_ + type: Long + precision: 5 + scale: 7 + - name: email2_0_ + type: String + precision: 5 + scale: 7 + - name: first_na3_0_ + type: String + precision: 5 + scale: 7 + - name: last_nam4_0_ + type: String + precision: 5 + scale: 7 + - name: timestam5_0_ + type: Long + precision: 5 + scale: 7 + rows: + - '[`1`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896801`]' + - '[`2`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896805`]' + - '[`3`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897026`]' + - '[`4`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897029`]' + - '[`5`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897896`]' + - '[`7`|`mt@gmail.com`|`mom`|`Tyson`|`1671901970`]' + - '[`8`|`mt@gmail.com`|`Trent`|`Boult`|`1671974006`]' + - '[`9`|`mt@gmail.com`|`Barry`|`Brook`|`1671974135`]' + - '[`10`|`mt@gmail.com`|`David`|`Brook`|`1672041183`]' + - '[`11`|`mt@gmail.com`|`David`|`Brook`|`1672041330`]' + - '[`12`|`mt@gmail.com`|`David`|`Brook`|`1672041591`]' + - '[`13`|`mt@gmail.com`|`David`|`Brook`|`1672042234`]' + - '[`14`|`mt@gmail.com`|`David`|`Warner`|`1672042895`]' + 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 00000000..e65eb997 --- /dev/null +++ b/src/test/e2e/mocks/test-3.yaml @@ -0,0 +1,36 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-3-0 +spec: + metadata: + SQL-Query: select employee0_.id as id1_0_, employee0_.email as email2_0_, employee0_.first_name as first_na3_0_, employee0_.last_name as last_nam4_0_, employee0_.timestamp as timestam5_0_ from employees employee0_ + method: next() + type: TABLE + table: + cols: + - name: id1_0_ + type: Long + precision: 0 + scale: 0 + - name: email2_0_ + type: String + precision: 0 + scale: 0 + - name: first_na3_0_ + type: String + precision: 0 + scale: 0 + - name: last_nam4_0_ + type: String + precision: 0 + scale: 0 + - name: timestam5_0_ + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896801`]' + - '[`2`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896805`]' + - '[`3`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897026`]' + - '[`4`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897029`]' + 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 00000000..9d0914ff --- /dev/null +++ b/src/test/e2e/mocks/test-4.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-4-0 +spec: + metadata: + getColumnCount: "5" + method: close() + type: TABLE + table: + cols: + - name: id + type: Long + precision: 0 + scale: 0 + rows: + - '[`5`]' + 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 00000000..2f2818b9 --- /dev/null +++ b/src/test/e2e/mocks/test-5.yaml @@ -0,0 +1,37 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-5-0 +spec: + metadata: + SQL-Query: select employee0_.id as id1_0_, employee0_.email as email2_0_, employee0_.first_name as first_na3_0_, employee0_.last_name as last_nam4_0_, employee0_.timestamp as timestam5_0_ from employees employee0_ + method: next() + type: TABLE + table: + cols: + - name: id1_0_ + type: Long + precision: 0 + scale: 0 + - name: email2_0_ + type: String + precision: 0 + scale: 0 + - name: first_na3_0_ + type: String + precision: 0 + scale: 0 + - name: last_nam4_0_ + type: String + precision: 0 + scale: 0 + - name: timestam5_0_ + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896801`]' + - '[`2`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896805`]' + - '[`3`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897026`]' + - '[`4`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897029`]' + - '[`5`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897896`]' + int: 0 diff --git a/src/test/e2e/mocks/test-6.yaml b/src/test/e2e/mocks/test-6.yaml new file mode 100644 index 00000000..ff6c8b8a --- /dev/null +++ b/src/test/e2e/mocks/test-6.yaml @@ -0,0 +1,17 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-6-0 +spec: + metadata: + getColumnCount: "5" + method: close() + type: TABLE + table: + cols: + - name: id + type: Long + precision: 0 + scale: 0 + rows: + - '[`6`]' + 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 00000000..2f5fbdf7 --- /dev/null +++ b/src/test/e2e/mocks/test-7.yaml @@ -0,0 +1,38 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-7-0 +spec: + metadata: + SQL-Query: select employee0_.id as id1_0_, employee0_.email as email2_0_, employee0_.first_name as first_na3_0_, employee0_.last_name as last_nam4_0_, employee0_.timestamp as timestam5_0_ from employees employee0_ + method: next() + type: TABLE + table: + cols: + - name: id1_0_ + type: Long + precision: 0 + scale: 0 + - name: email2_0_ + type: String + precision: 0 + scale: 0 + - name: first_na3_0_ + type: String + precision: 0 + scale: 0 + - name: last_nam4_0_ + type: String + precision: 0 + scale: 0 + - name: timestam5_0_ + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896801`]' + - '[`2`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896805`]' + - '[`3`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897026`]' + - '[`4`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897029`]' + - '[`5`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897896`]' + - '[`6`|`mt@gmail.com`|`Tom`|`Tyson`|`1671898758`]' + int: 0 diff --git a/src/test/e2e/mocks/test-8.yaml b/src/test/e2e/mocks/test-8.yaml new file mode 100644 index 00000000..9ca867cd --- /dev/null +++ b/src/test/e2e/mocks/test-8.yaml @@ -0,0 +1,38 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: test-8-0 +spec: + metadata: + SQL-Query: select employee0_.id as id1_0_, employee0_.email as email2_0_, employee0_.first_name as first_na3_0_, employee0_.last_name as last_nam4_0_, employee0_.timestamp as timestam5_0_ from employees employee0_ + method: next() + type: TABLE + table: + cols: + - name: id1_0_ + type: Long + precision: 0 + scale: 0 + - name: email2_0_ + type: String + precision: 0 + scale: 0 + - name: first_na3_0_ + type: String + precision: 0 + scale: 0 + - name: last_nam4_0_ + type: String + precision: 0 + scale: 0 + - name: timestam5_0_ + type: Long + precision: 0 + scale: 0 + rows: + - '[`1`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896801`]' + - '[`2`|`mt@gmail.com`|`Sam`|`Tyson`|`1671896805`]' + - '[`3`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897026`]' + - '[`4`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897029`]' + - '[`5`|`mt@gmail.com`|`Sam`|`Tyson`|`1671897896`]' + - '[`6`|`mt@gmail.com`|`Tom`|`Tyson`|`1671898758`]' + 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 00000000..a858da2e --- /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: "5" + method: close() + type: TABLE + table: + cols: + - name: id + type: Long + precision: 0 + scale: 0 + rows: + - '[`7`]' + int: 0 diff --git a/target/classes/application.properties b/target/classes/application.properties index 29b0a2f3..8dfd91cb 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -1,7 +1,7 @@ spring.datasource.url=jdbc:postgresql://localhost:5439/keploy-test spring.datasource.username=keploy-user spring.datasource.password=keploy -spring.jpa.show-sql=true +#spring.jpa.show-sql=true #spring.datasource.driverClassName=io.keploy.ksql.KDriver spring.jpa.properties.hibernate.format_sql=true ## Hibernate Properties @@ -11,8 +11,8 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.hibernate.ddl-auto=update # in order to populate some initial data for testing mark it as true. -spring.jpa.defer-datasource-initialization=true -spring.sql.init.mode=always +#spring.jpa.defer-datasource-initialization=true +#spring.sql.init.mode=always server.port=8080 logging.level.root=INFO \ No newline at end of file