Source:
<code>public void testUpdateFieldVariable_Return400() throws Exception { final FieldResource resource = new FieldResource(); final ContentType contentType = getContentType(); final String jsonField = "{"+ <START> " \"clazz\" : \"com.dotcms.contenttype.model.field.ImmutableRelationshipField\","+ <END> " \"contentTypeId\" : \"CONTENT_TYPE_ID\","+ " \"name\" : \"YouTube Videos\","+ " \"values\" : 1," + " \"variable\": \"youtubeVideos\","+ " \"relationType\": \"Youtube\""+ " }"; Response response = resource.createContentTypeField( contentType.id(), jsonField.replace("CONTENT_TYPE_ID", contentType.id()), getHttpRequest()); assertNotNull(response); assertEquals(200, response.getStatus()); final Map<String, Object> fieldMap = (Map<String, Object>) ((ResponseEntityView) response.getEntity()).getEntity(); final String jsonFieldUpdate = "{"+ " \"clazz\" : \"com.dotcms.contenttype.model.field.ImmutableRelationshipField\","+ " \"contentTypeId\" : \"CONTENT_TYPE_ID\","+ " \"id\" : \"CONTENT_TYPE_FIELD_ID\","+ " \"name\" : \"YouTube Videos\","+ " \"values\" : 1," + " \"variable\": \"youtube-Videos\","+ " \"relationType\": \"Youtube\""+ " }"; response = resource.updateContentTypeFieldById( contentType.id(), (String) fieldMap.get("id"), jsonFieldUpdate.replace("CONTENT_TYPE_ID", contentType.id()).replace("CONTENT_TYPE_FIELD_ID", (String) fieldMap.get("id")), getHttpRequest()); assertNotNull(response); assertEquals(400, response.getStatus()); assertTrue("Error: " + response.getEntity().toString(), response.getEntity().toString().contains("Field variable can not be modified")); }</code><technical_language>this hardcoded replaced ImmutableRelationshipField.class.getCanonicalName()</technical_language>

Target:
public void testUpdateFieldVariable_Return400() throws Exception { final FieldResource resource = new FieldResource(); final ContentType contentType = getContentType(); final String jsonField = "{"+ " \"clazz\" : \"" + ImmutableRelationshipField.class.getCanonicalName() +"\","+ " \"contentTypeId\" : \"CONTENT_TYPE_ID\","+ " \"name\" : \"YouTube Videos\","+ " \"values\" : 1," + " \"variable\": \"youtubeVideos\","+ " \"relationType\": \"Youtube\""+ " }"; Response response = resource.createContentTypeField( contentType.id(), jsonField.replace("CONTENT_TYPE_ID", contentType.id()), getHttpRequest()); assertNotNull(response); assertEquals(200, response.getStatus()); final Map<String, Object> fieldMap = (Map<String, Object>) ((ResponseEntityView) response.getEntity()).getEntity(); final String jsonFieldUpdate = "{"+ " \"clazz\" : \"" + ImmutableRelationshipField.class.getCanonicalName() +"\","+ " \"contentTypeId\" : \"CONTENT_TYPE_ID\","+ " \"id\" : \"CONTENT_TYPE_FIELD_ID\","+ " \"name\" : \"YouTube Videos\","+ " \"values\" : 1," + " \"variable\": \"youtube-Videos\","+ " \"relationType\": \"Youtube\""+ " }"; response = resource.updateContentTypeFieldById( contentType.id(), (String) fieldMap.get("id"), jsonFieldUpdate.replace("CONTENT_TYPE_ID", contentType.id()).replace("CONTENT_TYPE_FIELD_ID", (String) fieldMap.get("id")), getHttpRequest()); assertNotNull(response); assertEquals(400, response.getStatus()); assertTrue("Error: " + response.getEntity().toString(), response.getEntity().toString().contains("Field variable can not be modified")); }