Skip to content

functional test cases#120

Open
kirtisagarksj wants to merge 4 commits into
release-2.0.0from
functional_test_issues
Open

functional test cases#120
kirtisagarksj wants to merge 4 commits into
release-2.0.0from
functional_test_issues

Conversation

@kirtisagarksj

Copy link
Copy Markdown
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
Copy Markdown
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.

public void testDeleteUserNoteFailureWithInvalidNoteId() {
getTestCase().setName(TEST_DELETE_USER_NOTE_FAILURE_WITH_INVALID_NOTEID);
beforeTest();
//beforeTest();

Copy link
Copy Markdown
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

kirtisagarksj commented Oct 21, 2018 via email

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

public class AddUserToOrgTest extends BaseCitrusTestRunner {

public static final String TEST_ADD_USER_TO_ORG_FAILURE_WITH_EMPTY_ROLE_ARRAY =

Copy link
Copy Markdown
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.

@CitrusParameters({"testName", "getUserId", "httpStatus"})
@CitrusTest
public void testAddUserToOrgFailure(String testName) {
public void testAddUserToOrgFailure(String testName, boolean getUserId, HttpStatus httpStatus) {

Copy link
Copy Markdown
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.

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
Copy Markdown
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?


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
Copy Markdown
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?

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
Copy Markdown
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?


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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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