use of org.hisp.dhis.helpers.QueryParamsBuilder in project dhis2-core by dhis2.
the class SystemSettingsTests method getDefaultSystemSettingAsText.
@Test
public void getDefaultSystemSettingAsText() {
ApiResponse response = systemSettingActions.get(MAX_SYNC_ATTEMPTS_KEY, ContentType.TEXT.toString(), ContentType.TEXT.toString(), new QueryParamsBuilder());
response.validate().statusCode(200).body(containsString(String.valueOf(MAX_SYNC_ATTEMPTS_DEFAULT_VALUE)));
// -----------------------------------------
response = systemSettingActions.get(MAX_PASSWORD_LENGTH_KEY, ContentType.TEXT.toString(), ContentType.TEXT.toString(), new QueryParamsBuilder());
response.validate().statusCode(200).body(containsString(String.valueOf(MAX_PASSWORD_LENGTH_DEFAULT_VALUE)));
// -----------------------------------------
response = systemSettingActions.get(EMAIL_SENDER_KEY, ContentType.TEXT.toString(), ContentType.TEXT.toString(), new QueryParamsBuilder());
response.validate().statusCode(200).body(containsString(EMAIL_SENDER_DEFAULT_VALUE));
}
use of org.hisp.dhis.helpers.QueryParamsBuilder in project dhis2-core by dhis2.
the class SystemSettingsTests method getDefaultSystemSettingAsJson.
@Test
public void getDefaultSystemSettingAsJson() {
ApiResponse response = systemSettingActions.get(MAX_SYNC_ATTEMPTS_KEY, ContentType.JSON.toString(), ContentType.JSON.toString(), new QueryParamsBuilder());
response.validate().statusCode(200).body(containsString(String.valueOf(MAX_SYNC_ATTEMPTS_DEFAULT_VALUE)));
// -----------------------------------------
response = systemSettingActions.get(MAX_PASSWORD_LENGTH_KEY, ContentType.JSON.toString(), ContentType.JSON.toString(), new QueryParamsBuilder());
response.validate().statusCode(200).body(containsString(String.valueOf(MAX_PASSWORD_LENGTH_DEFAULT_VALUE)));
// -----------------------------------------
response = systemSettingActions.get(EMAIL_SENDER_KEY, ContentType.JSON.toString(), ContentType.JSON.toString(), new QueryParamsBuilder());
response.validate().statusCode(200).body(containsString(EMAIL_SENDER_DEFAULT_VALUE));
}
use of org.hisp.dhis.helpers.QueryParamsBuilder in project dhis2-core by dhis2.
the class SystemSettingsTests method returnDefaultValueWhenTranslationIsNotAvailable.
@Test
public void returnDefaultValueWhenTranslationIsNotAvailable() {
prepareData();
ApiResponse response = systemSettingActions.get(APPLICATION_INTRO_KEY, ContentType.TEXT.toString(), ContentType.TEXT.toString(), new QueryParamsBuilder().add("locale=pl"));
response.validate().statusCode(200).body(containsString(DEFAULT_INTRO));
}
use of org.hisp.dhis.helpers.QueryParamsBuilder in project dhis2-core by dhis2.
the class SystemSettingsTests method deleteTranslationForGivenLocaleAndSettingKey.
@Test
public void deleteTranslationForGivenLocaleAndSettingKey() {
prepareData();
ApiResponse response = systemSettingActions.delete(APPLICATION_INTRO_KEY, new QueryParamsBuilder().add("locale=fr"));
response.validate().statusCode(204);
response = systemSettingActions.get(APPLICATION_INTRO_KEY, ContentType.TEXT.toString(), ContentType.TEXT.toString(), new QueryParamsBuilder().add("locale=fr"));
response.validate().statusCode(200).body(containsString(DEFAULT_INTRO));
}
use of org.hisp.dhis.helpers.QueryParamsBuilder in project dhis2-core by dhis2.
the class SystemSettingsTests method prepareData.
private void prepareData() {
QueryParamsBuilder params = new QueryParamsBuilder();
params.add("value=" + DEFAULT_FOOTER);
systemSettingActions.post(APPLICATION_FOOTER_KEY, ContentType.TEXT.toString(), new JsonObject(), params);
// ------------------------
params = new QueryParamsBuilder();
params.add("value=" + DEFAULT_INTRO);
systemSettingActions.post(APPLICATION_INTRO_KEY, ContentType.TEXT.toString(), new JsonObject(), params);
// ------------------------
params = new QueryParamsBuilder();
params.add("value=" + ENGLISH_INTRO);
params.add("locale=en");
systemSettingActions.post(APPLICATION_INTRO_KEY, ContentType.TEXT.toString(), new JsonObject(), params);
// ------------------------
params = new QueryParamsBuilder();
params.add("value=" + FRENCH_INTRO);
params.add("locale=fr");
systemSettingActions.post(APPLICATION_INTRO_KEY, ContentType.TEXT.toString(), new JsonObject(), params);
}
Aggregations