Skip to main content
formatting
Source Link
Bharat Mane
  • 6.8k
  • 11
  • 41
  • 69

CurrentlYCurrently, I am using different approach automate rest services.

  1. Coverting JsonConverting JSON schema / JsonJSON files to javaJava Classes with help JSONschema2Pojo. 2.Using
  2. Using Spring Rest Template to make requests and get Responses as Java Object. private TestRestTemplate rest = new TestRestTemplate(); ResponseEntity response = rest.getForEntity("URL", Request.class);

private TestRestTemplate rest = new TestRestTemplate(); ResponseEntity<ResponceObject> response = rest.getForEntity("URL", Request.class);

From here you can get http Headers as HttpHeaders headers = p.getHeaders(); 
ResponseHttpHeaders headers = p.getHeaders();

Response body as -
ResponceObject resBody = response.getbody();ResponceObject resBody = response.getbody();

On top of this if We can use cucumber. we can have a lot reusability of code.

This is more Object Oriented way. I strongly disagree creating manual JsonJSON files

More information can be found at. 
http://www.jsonschema2pojo.org/ &
http://www.baeldung.com/spring-boot-testresttemplate

I am thinking creatingto create sample git projectGit projects on this.

CurrentlY I am using different approach automate rest services.

  1. Coverting Json schema / Json files to java Classes with help JSONschema2Pojo. 2.Using Spring Rest Template to make requests and get Responses as Java Object. private TestRestTemplate rest = new TestRestTemplate(); ResponseEntity response = rest.getForEntity("URL", Request.class);

From here you can get http Headers as HttpHeaders headers = p.getHeaders(); Response body as ResponceObject resBody = response.getbody();

On top of this if We can use cucumber. we can have a lot reusability of code.

This is more Object Oriented way. I strongly disagree creating manual Json files

More information can be found at. http://www.jsonschema2pojo.org/ http://www.baeldung.com/spring-boot-testresttemplate

I am thinking creating sample git project on this.

Currently, I am using different approach automate rest services.

  1. Converting JSON schema / JSON files to Java Classes with help JSONschema2Pojo.
  2. Using Spring Rest Template to make requests and get Responses as Java Object.

private TestRestTemplate rest = new TestRestTemplate(); ResponseEntity<ResponceObject> response = rest.getForEntity("URL", Request.class);

From here you can get http Headers as 
HttpHeaders headers = p.getHeaders();

Response body as -
ResponceObject resBody = response.getbody();

On top of this if We can use cucumber. we can have a lot reusability of code.

This is more Object Oriented way. I strongly disagree creating manual JSON files

More information can be found at. 
jsonschema2pojo &
baeldung

I am thinking to create sample Git projects on this.

Source Link

CurrentlY I am using different approach automate rest services.

  1. Coverting Json schema / Json files to java Classes with help JSONschema2Pojo. 2.Using Spring Rest Template to make requests and get Responses as Java Object. private TestRestTemplate rest = new TestRestTemplate(); ResponseEntity response = rest.getForEntity("URL", Request.class);

From here you can get http Headers as HttpHeaders headers = p.getHeaders(); Response body as ResponceObject resBody = response.getbody();

On top of this if We can use cucumber. we can have a lot reusability of code.

This is more Object Oriented way. I strongly disagree creating manual Json files

More information can be found at. http://www.jsonschema2pojo.org/ http://www.baeldung.com/spring-boot-testresttemplate

I am thinking creating sample git project on this.