Skip to content

Commit

Permalink
Merge pull request #119 from ELEVATE-Project/submitForreviewvalid
Browse files Browse the repository at this point in the history
changes done
  • Loading branch information
subash-cs authored Dec 26, 2024
2 parents d13c9ff + 3acd6c2 commit 7923bd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion SanitySuiteSCP_API.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<include name="testGetProjectDetailsWithInValidProjectId"/>
<include name="testDeleteProjectWithValidProjectId"/>
<include name="testDeletingNotTheExistingOne"/>
<include name="testSubmitProjectForReviewValidPayload"/>
<include name="testZSubmitProjectForReviewValidPayload"/>
<include name="testSubmitProjectForReviewInvalidPayload"/>
</methods>
</class>
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/scp_project_details_payload.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
"objective": "Teachers will learn strategies to manage classrooms effectively",
"recommended_duration": { "number": "3", "duration": "months" },
"keywords": "Classroom Management, Teacher Training",
"recommended_for": ["teacher", "principal"],
"recommended_for": ["teachers", "principal"],
"languages": ["en", "hi"],
"learning_resources": [
{ "name": "Classroom Management Techniques", "url": "https://diksha.gov.in/play/content/123456" }
Expand Down Expand Up @@ -437,7 +437,7 @@
"objective": "Teachers will learn strategies to manage classrooms effectively",
"recommended_duration": { "number": "1", "duration": "month" },
"keywords": "Classroom Management, Teacher Training",
"recommended_for": ["teacher", "trainer"],
"recommended_for": ["teachers"],
"languages": ["en"],
"learning_resources": [
{ "name": "Digital Literacy Basics", "url": "https://diksha.gov.in/play/content/223344" }
Expand Down Expand Up @@ -482,7 +482,7 @@
"objective": "Teachers will learn strategies to manage classrooms effectively",
"recommended_duration": { "number": "3", "duration": "months" },
"keywords": "Classroom Management, Teacher Training",
"recommended_for": ["student"],
"recommended_for": ["teachers"],
"languages": ["en"],
"learning_resources": [],
"licenses": "cc_by_nc",
Expand Down Expand Up @@ -520,7 +520,7 @@
"objective": "Teachers will now learn advanced strategies to manage classrooms effectively",
"recommended_duration": { "number": "1", "duration": "month" },
"keywords": "Advanced Classroom Management, Teacher Training",
"recommended_for": ["teacher", "trainer"],
"recommended_for": ["teachers"],
"languages": ["en"],
"learning_resources": [
{ "name": "Digital Literacy Basics", "url": "https://diksha.gov.in/play/content/223344" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.shikshalokam.backend.MentorBase;
Expand Down Expand Up @@ -434,16 +435,18 @@ public void testDeletingNotTheExistingOne() {
logger.info("Ended calling the delete project API with a non-existing project id.");
}

@Test(description = "Verifies the functionality of submitting the created project to reviewer with valid payload")
public void testSubmitProjectForReviewValidPayload() {
@Test(priority = 12, description = "Verifies the functionality of submitting the created project to reviewer with valid payload")
public void testZSubmitProjectForReviewValidPayload() {
logger.info("Started calling the submit project for review API with valid project id");

// Generate random reviewer id from the list
Integer reviewerId = reviewerIds.get(0);

// Build the request payload with dynamic reviewer IDs
JSONObject requestPayload = new JSONObject();
requestPayload.put("reviewer_ids", List.of(reviewerId));
JSONArray reviewerArray = new JSONArray();
reviewerArray.add(reviewerId);
requestPayload.put("reviewer_ids", reviewerArray);
requestPayload.put("notes", "Note to the reviewer");

// Make the API call to submit the project
Expand Down Expand Up @@ -576,6 +579,7 @@ private Response submitProjectForReviewer(Integer id, JSONObject requestPayload)
// Make the POST request to submit the project for review
Response response = given()
.header("X-auth-token", "bearer " + X_AUTH_TOKEN)
.log().all()
.contentType(ContentType.JSON)
.body(requestPayload.toString())
.pathParam("id", id) // Correctly passing the path parameter "id"
Expand Down

0 comments on commit 7923bd3

Please sign in to comment.