From 4495c73482a9fb3bdb87a75816974602e833278e Mon Sep 17 00:00:00 2001 From: Mavlushechka Date: Tue, 4 Oct 2022 21:17:05 +0500 Subject: Create RequestMethod enum --- .../com/mavlushechka/a1qa/utils/JSONPlaceholderAPIManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/mavlushechka/a1qa/utils/JSONPlaceholderAPIManager.java') diff --git a/src/main/java/com/mavlushechka/a1qa/utils/JSONPlaceholderAPIManager.java b/src/main/java/com/mavlushechka/a1qa/utils/JSONPlaceholderAPIManager.java index 464c1af..54df569 100644 --- a/src/main/java/com/mavlushechka/a1qa/utils/JSONPlaceholderAPIManager.java +++ b/src/main/java/com/mavlushechka/a1qa/utils/JSONPlaceholderAPIManager.java @@ -1,6 +1,7 @@ package com.mavlushechka.a1qa.utils; import com.mavlushechka.a1qa.constants.Endpoint; +import com.mavlushechka.a1qa.constants.RequestMethod; import com.mavlushechka.a1qa.models.Post; import com.mavlushechka.a1qa.models.User; @@ -18,7 +19,7 @@ public class JSONPlaceholderAPIManager { return JSONParser.convertToObject(URLConnectionManager.get(postsSpec + "/" + id), Post.class); } - public static int getPostResponseCode(int id, String requestMethod) throws IOException { + public static int getPostResponseCode(int id, RequestMethod requestMethod) throws IOException { return URLConnectionManager.getResponseCode(postsSpec + "/" + id, requestMethod); } @@ -26,7 +27,7 @@ public class JSONPlaceholderAPIManager { return getObjects(postsSpec, Post.class); } - public static int getPostsResponseCode(String requestMethod) throws IOException { + public static int getPostsResponseCode(RequestMethod requestMethod) throws IOException { return URLConnectionManager.getResponseCode(postsSpec, requestMethod); } @@ -42,7 +43,7 @@ public class JSONPlaceholderAPIManager { return getObjects(usersSpec, User.class); } - public static int getUsersResponseCode(String requestMethod) throws IOException { + public static int getUsersResponseCode(RequestMethod requestMethod) throws IOException { return URLConnectionManager.getResponseCode(usersSpec, requestMethod); } -- cgit v1.2.3