()
| 274 | |
| 275 | #[tokio::test] |
| 276 | async fn properties_replace() { |
| 277 | let mut database = DatabaseTestWrapper::new().await; |
| 278 | let mut api = seed(&mut database).await; |
| 279 | |
| 280 | let entity = api |
| 281 | .create_entity( |
| 282 | api.account_id, |
| 283 | CreateEntityParams { |
| 284 | web_id: WebId::new(api.account_id), |
| 285 | entity_uuid: None, |
| 286 | decision_time: None, |
| 287 | entity_type_ids: HashSet::from([person_entity_type_id()]), |
| 288 | properties: PropertyObjectWithMetadata::from_parts(alice(), None) |
| 289 | .expect("could not create property with metadata object"), |
| 290 | confidence: None, |
| 291 | link_data: None, |
| 292 | draft: false, |
| 293 | policies: Vec::new(), |
| 294 | provenance: ProvidedEntityEditionProvenance { |
| 295 | actor_type: ActorType::User, |
| 296 | origin: OriginProvenance::from_empty_type(OriginType::Api), |
| 297 | sources: Vec::new(), |
| 298 | }, |
| 299 | read_only: false, |
| 300 | }, |
| 301 | ) |
| 302 | .await |
| 303 | .expect("could not create entity"); |
| 304 | let entity_id = entity.metadata.record_id.entity_id; |
| 305 | |
| 306 | api.patch_entity( |
| 307 | api.account_id, |
| 308 | PatchEntityParams { |
| 309 | entity_id, |
| 310 | decision_time: None, |
| 311 | entity_type_ids: HashSet::new(), |
| 312 | properties: vec![PropertyPatchOperation::Replace { |
| 313 | path: once(PropertyPathElement::from(name_property_type_id())).collect(), |
| 314 | property: PropertyWithMetadata::Value(PropertyValueWithMetadata { |
| 315 | value: PropertyValue::String("Bob".to_owned()), |
| 316 | metadata: ValueMetadata { |
| 317 | confidence: None, |
| 318 | data_type_id: None, |
| 319 | original_data_type_id: None, |
| 320 | provenance: ValueProvenance::default(), |
| 321 | canonical: HashMap::default(), |
| 322 | }, |
| 323 | }), |
| 324 | }], |
| 325 | draft: None, |
| 326 | archived: None, |
| 327 | confidence: None, |
| 328 | provenance: ProvidedEntityEditionProvenance { |
| 329 | actor_type: ActorType::User, |
| 330 | origin: OriginProvenance::from_empty_type(OriginType::Api), |
| 331 | sources: Vec::new(), |
| 332 | }, |
| 333 | }, |
nothing calls this directly
no test coverage detected