Skip to content

Commit

Permalink
Merge pull request #12 from project-sunbird/Issue-SB-5072
Browse files Browse the repository at this point in the history
Issue SB-  - 5072- User Functional test case fixes
  • Loading branch information
manzarul authored Jul 3, 2018
2 parents b27fa20 + 29b20a4 commit 2d75dde
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public TestGlobalProperty initGlobalValues() {
property.setEsPort(System.getenv("sunbird_es_port"));
property.setIndexType(System.getenv("sunbird_es_index_type"));
property.setIndex(System.getenv("sunbird_es_index"));
// System.getenv("sunbird_default_channel")
property.setSunbirdDefaultChannel("sunbird-dev");
property.setSunbirdDefaultChannel(System.getenv("sunbird_default_channel"));
property.setLmsUrl(System.getenv("sunbird_test_base_url"));
return property;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class UserTest extends TestNGCitrusTestDesigner {
private static volatile String USER_NAME = "userName";
private static String externalId = String.valueOf(System.currentTimeMillis());
private static String provider = String.valueOf(System.currentTimeMillis() + 10);
private static TestGlobalProperty testGlobalProperty = new EndpointConfig().initGlobalValues();

/**
* User can define the api request and response json structure. first index is request json
Expand Down Expand Up @@ -93,11 +94,6 @@ public Object[][] createUserDynamicJsonData() {
Constant.USER_TEMPLATE_LOCATION + "user_username_exist_response.json",
"duplicateUsernameTest"
},
new Object[] {
createUserWithDuplicateExtIdAndProvider(),
Constant.USER_TEMPLATE_LOCATION + "user_already_exist_response.json",
"duplicateExtIdAndProviderTest"
},
new Object[] {
createUserWithInvalidChannel(),
Constant.USER_TEMPLATE_LOCATION + "invalid_channel_response.json",
Expand All @@ -110,11 +106,6 @@ public Object[][] createUserDynamicJsonData() {
public Object[][] updateUserDataProvider() {
return new Object[][] {
new Object[] {updateUserWithId(), "update_user_success_response.json", "updateUserWithId"},
new Object[] {
updateUserWithExtIdAndProvider(),
"update_user_success_response.json",
"updateUserWithExtIdAndProvider"
},
new Object[] {
updateUserWithRegOrgId(),
Constant.UPDATE_USER_TEMPLATE_LOCATION + "user_update_bad_request_response.json",
Expand Down Expand Up @@ -408,8 +399,6 @@ private String createUserWithInvalidChannel() {
innerMap.put(
Constant.EMAIL, Constant.USER_NAME_PREFIX + UUID.randomUUID().toString() + "@gmail.com");
innerMap.put(Constant.USER_NAME, Constant.USER_NAME_PREFIX + UUID.randomUUID().toString());
innerMap.put(Constant.EXTERNAL_ID, externalId + 123);
innerMap.put(Constant.PROVIDER, provider + 234);
innerMap.put(Constant.CHANNEL, "functionalTest#Invalid$Channel@1235123");
requestMap.put(Constant.REQUEST, innerMap);
try {
Expand Down Expand Up @@ -452,8 +441,7 @@ private static Map<String, Object> createUserInnerMap() {
innerMap.put(Constant.FIRST_NAME, "ft_first_Name_pw12401");
innerMap.put(Constant.LAST_NAME, "ft_lastName");
innerMap.put(Constant.PASSWORD, "password");
innerMap.put(Constant.EXTERNAL_ID, externalId);
innerMap.put(Constant.PROVIDER, provider);
innerMap.put(Constant.CHANNEL,testGlobalProperty.getSunbirdDefaultChannel());
USER_NAME = Constant.USER_NAME_PREFIX + EndpointConfig.val;
String email = Constant.USER_NAME_PREFIX + EndpointConfig.val + "@gmail.com";
innerMap.put(Constant.USER_NAME, USER_NAME);
Expand All @@ -468,6 +456,7 @@ private String updateUserWithId() {
innerMap.put(Constant.ID, userId);
innerMap.put(Constant.USER_ID, userId);
innerMap.remove(Constant.USER_NAME);
innerMap.remove(Constant.CHANNEL);
requestMap.put(Constant.REQUEST, innerMap);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
{
"resmsgid":null,
"msgid":"@ignore@",
"err":"USER_ALREADY_EXISTS",
"status":"USER_ALREADY_EXISTS",
"err":"USERNAME_EMAIL_IN_USE",
"status":"USERNAME_EMAIL_IN_USE",
"errmsg":"@ignore@"
}
,"responseCode":"CLIENT_ERROR",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
{
"resmsgid":null,
"msgid":"@ignore@",
"err":"USER_ALREADY_EXISTS",
"status":"USER_ALREADY_EXISTS",
"err":"USERNAME_EMAIL_IN_USE",
"status":"USERNAME_EMAIL_IN_USE",
"errmsg":"@ignore@"
}
,"responseCode":"CLIENT_ERROR",
Expand Down

0 comments on commit 2d75dde

Please sign in to comment.