-
Notifications
You must be signed in to change notification settings - Fork 19
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
base: release-2.0.0
Are you sure you want to change the base?
Conversation
"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" |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why beforeTest(); is commented.
beforeTest() is commented because the test is for Invalid NoteId. So we
don`t need to call beforeTest to get note id
…On Fri, Oct 19, 2018 at 5:05 PM manzarul Haque ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
sunbird_service_api_test/src/test/java/org/sunbird/integration/test/user/notes/DeleteUserNoteTest.java
<#120 (comment)>
:
> @@ -80,7 +80,7 @@ public void testDeleteUserNoteSuccess(
@citrustest
public void testDeleteUserNoteFailureWithInvalidNoteId() {
getTestCase().setName(TEST_DELETE_USER_NOTE_FAILURE_WITH_INVALID_NOTEID);
- beforeTest();
+ //beforeTest();
why beforeTest(); is commented.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#120 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AomXLrsqPaNaEVInPOPGVaUjdyh-vlr0ks5umbj9gaJpZM4XuT4W>
.
|
@Test(dataProvider = "addUserToOrgFailureDataProvider") | ||
@CitrusParameters({"testName"}) | ||
@Test(dataProvider = "addUserToOrgDataProvider") | ||
@CitrusParameters({"testName", "getUserId", "httpStatus"}) |
There was a problem hiding this comment.
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}", |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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.
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 = |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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}, |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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}, |
There was a problem hiding this comment.
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}, |
There was a problem hiding this comment.
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[][]{ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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." | ||
======= |
There was a problem hiding this comment.
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 !
No description provided.