From d0434f6da3e0acfcde4eb118c4b304ddfda3ce37 Mon Sep 17 00:00:00 2001 From: saimanaswini-k Date: Mon, 9 Sep 2024 11:33:30 +0530 Subject: [PATCH] Feat : Code cleanup for deprecated APIs --- service/app/util/RequestInterceptor.java | 2 +- .../CourseControllerTest.java | 82 +++++++++---------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/service/app/util/RequestInterceptor.java b/service/app/util/RequestInterceptor.java index 0069d18ce..c70bd1012 100644 --- a/service/app/util/RequestInterceptor.java +++ b/service/app/util/RequestInterceptor.java @@ -41,7 +41,7 @@ private RequestInterceptor() {} apiHeaderIgnoreMap.put("/v1/course/batch/search", var); apiHeaderIgnoreMap.put("/v1/cache/clear", var); apiHeaderIgnoreMap.put("/private/v1/course/batch/create", var); - apiHeaderIgnoreMap.put("/v1/course/create", var); + //apiHeaderIgnoreMap.put("/v1/course/create", var); apiHeaderIgnoreMap.put("/v2/user/courses/list", var); apiHeaderIgnoreMap.put("/v1/collection/summary", var); } diff --git a/service/test/controllers/coursemanagement/CourseControllerTest.java b/service/test/controllers/coursemanagement/CourseControllerTest.java index 0a57c3e3e..e9a9af304 100644 --- a/service/test/controllers/coursemanagement/CourseControllerTest.java +++ b/service/test/controllers/coursemanagement/CourseControllerTest.java @@ -24,56 +24,56 @@ "sun.security.ssl.*", "javax.net.ssl.*", "javax.crypto.*"}) public class CourseControllerTest extends BaseApplicationTest { - String COURSE_CREATE_URL = "/v1/course/create"; + //String COURSE_CREATE_URL = "/v1/course/create"; @Before public void before() { setup(ACTOR_NAMES.COURSE_MANAGEMENT_ACTOR, DummyActor.class); } - @Test - public void testCourseCreateSuccess() { - Http.RequestBuilder req = - new Http.RequestBuilder() - .uri(COURSE_CREATE_URL) - .bodyJson(createCourseRequest("application/vnd.ekstep.content-collection", "Course")) - .method("POST"); - Result result = Helpers.route(application, req); - Assert.assertEquals(200, result.status()); - } + //@Test + //public void testCourseCreateSuccess() { + // Http.RequestBuilder req = + // new Http.RequestBuilder() + // .uri(COURSE_CREATE_URL) + // .bodyJson(createCourseRequest("application/vnd.ekstep.content-collection", "Course")) + // .method("POST"); + // Result result = Helpers.route(application, req); + // Assert.assertEquals(200, result.status()); + //} - @Test - public void testCourseCreateWithInvalidRequest() { - Http.RequestBuilder req = - new Http.RequestBuilder() - .uri(COURSE_CREATE_URL) - .bodyJson(createCourseInvalidRequest()) - .method("POST"); - Result result = Helpers.route(application, req); - Assert.assertEquals(400, result.status()); - } + //@Test + //public void testCourseCreateWithInvalidRequest() { + // Http.RequestBuilder req = + // new Http.RequestBuilder() + // .uri(COURSE_CREATE_URL) + // .bodyJson(createCourseInvalidRequest()) + // .method("POST"); + // Result result = Helpers.route(application, req); + // Assert.assertEquals(400, result.status()); + //} - @Test - public void testCourseCreateWithInvalidContentType() { - Http.RequestBuilder req = - new Http.RequestBuilder() - .uri(COURSE_CREATE_URL) - .bodyJson(createCourseRequest("application/vnd.ekstep.content-collection", "InvalidContent")) - .method("POST"); - Result result = Helpers.route(application, req); - Assert.assertEquals(400, result.status()); - } + //@Test + //public void testCourseCreateWithInvalidContentType() { + // Http.RequestBuilder req = + // new Http.RequestBuilder() + // .uri(COURSE_CREATE_URL) + // .bodyJson(createCourseRequest("application/vnd.ekstep.content-collection", "InvalidContent")) + // .method("POST"); + // Result result = Helpers.route(application, req); + // Assert.assertEquals(400, result.status()); + //} - @Test - public void testCourseCreateWithInvalidMimeType() { - Http.RequestBuilder req = - new Http.RequestBuilder() - .uri(COURSE_CREATE_URL) - .bodyJson(createCourseRequest("application/InvalidCollection", "Course")) - .method("POST"); - Result result = Helpers.route(application, req); - Assert.assertEquals(400, result.status()); - } + //@Test + //public void testCourseCreateWithInvalidMimeType() { + // Http.RequestBuilder req = + // new Http.RequestBuilder() + // .uri(COURSE_CREATE_URL) + // .bodyJson(createCourseRequest("application/InvalidCollection", "Course")) + // .method("POST"); + // Result result = Helpers.route(application, req); + // Assert.assertEquals(400, result.status()); + //} private JsonNode createCourseRequest(String mimeType, String contentType) { Map courseMap = new HashMap<>();