Skip to content

functional test cases #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: release-2.0.0
Choose a base branch
from
Open

Conversation

kirtisagarksj
Copy link
Contributor

No description provided.

"errmsg": "Role of the user is required"
"err": "INVALID_USER_DATA",
"status": "INVALID_USER_DATA",
"errmsg": "Given User Data doesn't exist in our records. Please provide a valid one"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kirtisagarksj this test is for empty role , so it should throw role error.

@@ -80,7 +80,7 @@ public void testDeleteUserNoteSuccess(
@CitrusTest
public void testDeleteUserNoteFailureWithInvalidNoteId() {
getTestCase().setName(TEST_DELETE_USER_NOTE_FAILURE_WITH_INVALID_NOTEID);
beforeTest();
//beforeTest();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why beforeTest(); is commented.

@kirtisagarksj
Copy link
Contributor Author

kirtisagarksj commented Oct 21, 2018 via email

@Test(dataProvider = "addUserToOrgFailureDataProvider")
@CitrusParameters({"testName"})
@Test(dataProvider = "addUserToOrgDataProvider")
@CitrusParameters({"testName", "getUserId", "httpStatus"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getUserId is used for which purpose

@@ -1,5 +1,6 @@
{
"request": {
"organisationId": "${organisationId}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we always send "organisationId": "${organisationId}" is added in request.

@@ -5,10 +5,10 @@
"params": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why user not found will be internal error.

Kirti Jenamoni and others added 2 commits October 22, 2018 18:53
import org.sunbird.integration.test.common.BaseCitrusTestRunner;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import javax.ws.rs.core.MediaType;

public class AddUserToOrgTest extends BaseCitrusTestRunner {

public static final String TEST_ADD_USER_TO_ORG_FAILURE_WITH_EMPTY_ROLE_ARRAY =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constant name and value don't correspond.

@CitrusTest
public void testAddUserToOrgFailure(String testName) {
public void testAddUserToOrgFailure(String testName, boolean getUserId, HttpStatus httpStatus) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test name and data provider name mismatch.

@@ -32,7 +32,7 @@ private String getBlockUserUrl() {

return new Object[][] {
new Object[] {TEST_BLOCK_USER_FAILURE_WITHOUT_ACCESS_TOKEN, false, HttpStatus.UNAUTHORIZED},
new Object[] {TEST_BLOCK_USER_FAILURE_WITH_INVALID_USERID, true, HttpStatus.NOT_FOUND},
new Object[] {TEST_BLOCK_USER_FAILURE_WITH_INVALID_USERID, true, HttpStatus.INTERNAL_SERVER_ERROR},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does invalid user ID result in internal server error?

@@ -92,7 +92,7 @@ public void testGetBlockUserByUserIdFailure() {
}

private void blockUser() {
UserUtil.blockUser(this, TEMPLATE_DIR_BLOCK, TEST_BA_BLOCK_USER_SUCCESS_WITH_VALID_USERID);
UserUtil.blockUser(this, TEMPLATE_DIR, "testGetUserByUserIdFailureWithBlockedUser");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why failure request templates passed to block user method?

@@ -42,15 +42,15 @@ private String getUnblockUserUrl() {

return new Object[][] {
new Object[] {TEST_UNBLOCK_USER_FAILURE_WITHOUT_ACCESS_TOKEN, false, HttpStatus.UNAUTHORIZED},
new Object[] {TEST_UNBLOCK_USER_FAILURE_WITH_INVALID_USERID, true, HttpStatus.NOT_FOUND},
new Object[] {TEST_UNBLOCK_USER_FAILURE_WITH_INVALID_USERID, true, HttpStatus.INTERNAL_SERVER_ERROR},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does invalid user ID result in internal server error?

};
}

@DataProvider(name = "unblockUserSuccessDataProvider")
public Object[][] unblockUserSuccessDataProvider() {

return new Object[][] {
new Object[] {TEST_UNBLOCK_USER_SUCCESS_WITH_VALID_USERID, true, HttpStatus.OK},
new Object[] {TEST_UNBLOCK_USER_SUCCESS_WITH_VALID_USERID, true, HttpStatus.INTERNAL_SERVER_ERROR},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does success test result in internal server error?

new Object[] {TEST_UPDATE_USER_LOGIN_TIME_SUCCESS_WITH_INVALID_USER_ID, true, HttpStatus.OK},
};
}
return new Object[][]{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format code properly.

},
new Object[] {
TEST_UPDATE_USER_PROFILE_VISIBILITY_FAILURE_WITH_INVALID_USERID, true, HttpStatus.NOT_FOUND
TEST_UPDATE_USER_PROFILE_VISIBILITY_FAILURE_WITH_INVALID_USERID, true, HttpStatus.BAD_REQUEST, false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does invalid user ID result in bad request? Not found is more relevant.

"err":"MANDATORY_PARAMETER_MISSING",
"status":"MANDATORY_PARAMETER_MISSING",
"errmsg":"Mandatory parameter filters is missing."
=======
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unresolved merge conflict is being pushed !

@manzarul manzarul changed the base branch from release-1.12 to release-2.0.0 July 12, 2019 04:51
@manzarul manzarul changed the base branch from release-2.0.0 to master July 12, 2019 04:52
@manzarul manzarul changed the base branch from master to release-2.0.0 July 12, 2019 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants