CustomerServive Testing
CustomerServive Testing
CustomerServive Testing
Application Structure:
Build:
http://localhost:8081/h2
"custId":2,
"lname": "AKula",
"age": 26,
"address": {
"street": "Street1",
"city": "City1",
"zipCode": "123456",
"country": "India"
}
Adding:
Validations used:
In adding customer info:
From input :
lname: Akula
From input :
lname: Akula
http://localhost:8081/customerNames/ AGopi/akula
From input : fname or lame
http://localhost:8081/customerNames/ Raju/akula
5) Functionality: update customer address by customer id
Service url: http://localhost:8081/customerNames/ A Gopi/akula
Method name: PUT
Cust id : 2
"id": 1,
"street": "Streetupdatedio",
"city": "HYD",
"zipCode": "123456ui",
"country": "Indiau"
From post man tool use the url with get method as
http://localhost:8081/v2/api-docs
Complete documentation in json format as:
"swagger": "2.0",
"info": {
"version": "1.0",
"title": "CustomerService",
"contact": {
"url": "Infosys",
"email": "[email protected]"
},
"license": {
},
"host": "localhost:8081",
"basePath": "/",
"tags": [
"name": "customer-service-controller",
"description": "Customer Service Controller"
],
"paths": {
"/customer": {
"post": {
"tags": [
"customer-service-controller"
],
"operationId": "addCustomerUsingPOST",
"consumes": [
"application/json"
],
"produces": [
"*/*"
],
"parameters": [
"in": "body",
"name": "customer",
"description": "customer",
"required": true,
"schema": {
"$ref": "#/definitions/CustomerModel"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
},
"201": {
"description": "Created"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
}
},
"deprecated": false
},
"/customer/{id}": {
"get": {
"tags": [
"customer-service-controller"
],
"operationId": "getCustomerUsingGET",
"produces": [
"application/json"
],
"parameters": [
"name": "id",
"in": "path",
"description": "id",
"required": true,
"type": "integer",
"format": "int32"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/WildcardType"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
},
"deprecated": false
},
"/customerNames/{fname}/{lname}": {
"get": {
"tags": [
"customer-service-controller"
],
"operationId": "searchCustomerNameByUsingGET",
"produces": [
"application/json"
],
"parameters": [
"name": "fname",
"in": "path",
"description": "fname",
"required": true,
"type": "string"
},
"name": "lname",
"in": "path",
"description": "lname",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "object"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
},
"deprecated": false
},
"/customers": {
"get": {
"tags": [
"customer-service-controller"
],
"operationId": "getAllCustomersUsingGET",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "object"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
},
"deprecated": false
},
"/updateAddress/{id}": {
"put": {
"tags": [
"customer-service-controller"
],
"description": "Based on given customer id and address, address is updated for the
given customer id",
"operationId": "updateLivingAddressUsingPUT",
"consumes": [
"application/json"
],
"produces": [
"*/*"
],
"parameters": [
"in": "body",
"name": "address",
"description": "address",
"required": true,
"schema": {
"$ref": "#/definitions/AddressModel"
},
"name": "id",
"in": "path",
"description": "id",
"required": true,
"type": "integer",
"format": "int32"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
},
"201": {
"description": "Created"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
},
"deprecated": false
},
"definitions": {
"AddressModel": {
"type": "object",
"properties": {
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int32"
},
"street": {
"type": "string"
},
"zipCode": {
"type": "string"
},
"title": "AddressModel"
},
"CustomerModel": {
"type": "object",
"properties": {
"address": {
"$ref": "#/definitions/AddressModel"
},
"age": {
"type": "integer",
"format": "int32"
},
"custId": {
"type": "integer",
"format": "int32"
},
"fname": {
"type": "string"
},
"lname": {
"type": "string"
},
"title": "CustomerModel"
},
"Optional«CustomerModel»": {
"type": "object",
"properties": {
"present": {
"type": "boolean"
}
},
"title": "Optional«CustomerModel»"
},
"WildcardType": {
"type": "object",
"properties": {
"present": {
"type": "boolean"
},
"title": "WildcardType"