Skip to content

Cyclens/TestMovieAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

This project is used to test Splunk movie API with Rest-Assured and TestNG.

Prerequisite

  1. Apache Maven.
  2. REST Assured v3.1.0.

Test Properties

  1. Sort the JSON response body by genre_ids and id;
  2. Test for duplicate images;
  3. Test the validation of poster_path links;
  4. Test the number of movies whose sum of "genre_ids" > 400 being no more than 7;
  5. Test for palindrome in titles;
  6. Test for titles to see if one contain the other;
  7. Test if the title and original title are match for each movie.

How to Perform the Test

  1. Initial the TestMovieAPI.java class as:
TestMovieAPI test = new TestMovieAPI();
  1. Post new data onto the server by:
String movieName = "Superman";
Map<String, String> movie = new HashMap<>();
movie.put("name", movieName);
movie.put("description", "the best movie ever made");
test.testPost(movieName, movie);
  1. Perform the test based on the requirements and get the JSON body of the response
String body = test.testGet();
  1. Print out the Json after sorting with genre_ids and id
System.out.println("The sorted body of response: " + test.sortJson(body));
  1. Check if there are movies using the same poster
System.out.println("There are movies using the same poster: " + test.checkDups(body));
  1. Check if all poster_path links are valid
System.out.println("All poster_path links are valid: " + test.checkValidPath(body));
  1. Check if the number of movies whose sum of "genre_ids" > 400 should be no more than 7
System.out.println("There are " + test.CheckGenIds(body) + " movies whose sum of genre_ids > 400");
  1. heck if there is at least one movie in the database whose title has a palindrome in it
System.out.println("At least one movie whose title has a palindrome: " + test.checkPalindrome(body));
  1. Check if there are at least two movies in the database whose title contain the title of another movie
System.out.println("There are " + test.checkOverlap(body) + " movies whos title contain the title of another movie\n");
  1. Check if the title of each movie match its original title
System.out.println("The title and original_title are match: " + test.checkOriginalTitle(body));
  1. Check if the response code is 200
test.basicPingTest();

About

Splunk Movie API Testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages