use chrono::Utc;
use stix_rs::objects::{Identity, Indicator};
use stix_rs::vocab::{IdentityClass, IndicatorPatternType};
use stix_rs::bundle::Bundle;
#[test]
fn test_complex_workflow() {
let sensor = Identity::builder()
.name("Honeypot-Beta")
.identity_class(IdentityClass::System)
.property("x_custom_region", "us-east-1") .build()
.unwrap();
let indicator = Indicator::builder()
.name("Malicious IP")
.pattern("[ipv4-addr:value = '198.51.100.1']")
.pattern_type(IndicatorPatternType::Stix)
.valid_from(Utc::now())
.build()
.unwrap();
let bundle = Bundle::new(vec![sensor.into(), indicator.into()]);
let json = serde_json::to_string_pretty(&bundle).unwrap();
println!("{}", json);
assert!(json.contains("\"type\": \"bundle\""));
assert!(json.contains("\"x_custom_region\": \"us-east-1\""));
assert!(json.contains("\"identity_class\": \"system\""));
}