Search in sources :

Example 16 with AdminSettings

use of org.thingsboard.server.common.data.AdminSettings in project thingsboard by thingsboard.

the class BaseAdminControllerTest method testSaveAdminSettingsWithNewJsonStructure.

@Test
public void testSaveAdminSettingsWithNewJsonStructure() throws Exception {
    loginSysAdmin();
    AdminSettings adminSettings = doGet("/api/admin/settings/mail", AdminSettings.class);
    JsonNode json = adminSettings.getJsonValue();
    ((ObjectNode) json).put("newKey", "my new value");
    adminSettings.setJsonValue(json);
    doPost("/api/admin/settings", adminSettings).andExpect(status().isBadRequest()).andExpect(statusReason(containsString("Provided json structure is different")));
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) JsonNode(com.fasterxml.jackson.databind.JsonNode) AdminSettings(org.thingsboard.server.common.data.AdminSettings) Test(org.junit.Test)

Aggregations

AdminSettings (org.thingsboard.server.common.data.AdminSettings)16 Test (org.junit.Test)13 JsonNode (com.fasterxml.jackson.databind.JsonNode)7 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)6 AdminSettingsId (org.thingsboard.server.common.data.id.AdminSettingsId)2 IncorrectParameterException (org.thingsboard.server.dao.exception.IncorrectParameterException)1