Skip to content

Commit

Permalink
Merge pull request #469 from authorjapps/fix_mock_server_json_issue
Browse files Browse the repository at this point in the history
fix mock server issue
  • Loading branch information
authorjapps authored Dec 28, 2020
2 parents be572f9 + 468c2ba commit 1a81fdd
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
1 change: 1 addition & 0 deletions http-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<version>2.19.1</version>
<configuration>
<includes>
<include>org.jsmart.zerocode.testhelp.tests.MockServerTest</include>
<include>org.jsmart.zerocode.zerocodejavaexec.pojo.OrderTest</include>
<include>org.jsmart.zerocode.testhelp.tests.HelloWorldCherryPickSuite</include>
<include>org.jsmart.zerocode.testhelp.tests.helloworldjavaexec.HelloWorldJavaApiAsProtocolTest</include>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.jsmart.zerocode.testhelp.tests;


import org.jsmart.zerocode.testhelp.localserver.RunMeFirstLocalMockRESTServer;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;


public class MockServerTest {
private RunMeFirstLocalMockRESTServer mockRESTServer;

@Before
public void start(){
mockRESTServer = new RunMeFirstLocalMockRESTServer(RunMeFirstLocalMockRESTServer.PORT);
mockRESTServer.start();
}

@After
public void stop(){
mockRESTServer.stop();
}

@Test
public void testMockServerRunning(){
Assert.assertTrue(mockRESTServer.isRunning());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"apis": [
{
"name": "Sample_POST_Employee_Create",
"method": "POST",
"operation": "POST",
"url": "/api/v1/google-uk/employees",
"ignoreBody": true,
"response": {
Expand All @@ -24,7 +24,7 @@
},
{
"name": "sample POST with matching body",
"method": "POST",
"operation": "POST",
"url": "/api/v1/employees",
"ignoreBody": false,
"body": {
Expand All @@ -41,7 +41,7 @@
},
{
"name": "sample GET for Emma Norton",
"method": "GET",
"operation": "GET",
"url": "/api/v1/employees/39001",
"response": {
"status": 200,
Expand All @@ -55,7 +55,7 @@
},
{
"name": "Sample_Get_Employee_by_Id",
"method": "GET",
"operation": "GET",
"url": "/api/v1/google-uk/employees/999",
"response": {
"status": 200,
Expand All @@ -75,7 +75,7 @@
},
{
"name": "Screening - sample POST with matching body",
"method": "POST",
"operation": "POST",
"url": "/api/v1/employees/screening",
"ignoreBody": false,
"body": {
Expand All @@ -94,7 +94,7 @@
},
{
"name": "Screening - sample GET",
"method": "GET",
"operation": "GET",
"url": "/api/v1/employees/screening/SCRUNIQUEID5003",
"response": {
"status": 200,
Expand All @@ -110,7 +110,7 @@
},
{
"name": "Sample_Get_Created_Employee_by_Id",
"method": "GET",
"operation": "GET",
"url": "/api/v1/google-uk/employees/1000",
"response": {
"status": 200,
Expand All @@ -130,7 +130,7 @@
},
{
"name": "sample_get_api",
"method": "GET",
"operation": "GET",
"url": "/api/v1/google-uk/employees/UK1001",
"response": {
"status": 200,
Expand All @@ -150,7 +150,7 @@
},
{
"name": "bare_string_get",
"method": "GET",
"operation": "GET",
"url": "/api/v1/google-uk/employees/101",
"response": {
"status": 200,
Expand All @@ -159,7 +159,7 @@
},
{
"name": "Sample_Get_Full_Employee_by_Id",
"method": "GET",
"operation": "GET",
"url": "/api/v1/employees/emp1001",
"response": {
"status": 200,
Expand All @@ -185,7 +185,7 @@
},
{
"name": "Sample_Get_Address_by_emp_id",
"method": "GET",
"operation": "GET",
"url": "/api/v1/addresses/empoyee/emp1001",
"response": {
"status": 200,
Expand All @@ -210,7 +210,7 @@
},
{
"name": "Mock GET employee details including DOB",
"method": "GET",
"operation": "GET",
"url": "/api/v1/google-uk/employees/UK-LON-1002",
"response": {
"status": 200,
Expand Down

0 comments on commit 1a81fdd

Please sign in to comment.