()
| 95 | |
| 96 | #[tokio::test] |
| 97 | async fn test_handle() { |
| 98 | let _guard = test::prepare().await; |
| 99 | integration::set_mock().await; |
| 100 | |
| 101 | let rx_time = Utc::now(); |
| 102 | |
| 103 | let ufs = UplinkFrameSet { |
| 104 | uplink_set_id: Uuid::new_v4(), |
| 105 | dr: 0, |
| 106 | ch: 0, |
| 107 | phy_payload: lrwn::PhyPayload { |
| 108 | mhdr: lrwn::MHDR { |
| 109 | f_type: lrwn::FType::UnconfirmedDataUp, |
| 110 | major: lrwn::Major::LoRaWANR1, |
| 111 | }, |
| 112 | payload: lrwn::Payload::MACPayload(lrwn::MACPayload { |
| 113 | fhdr: Default::default(), |
| 114 | f_port: None, |
| 115 | frm_payload: None, |
| 116 | }), |
| 117 | mic: None, |
| 118 | }, |
| 119 | tx_info: Default::default(), |
| 120 | rx_info_set: vec![gw::UplinkRxInfo { |
| 121 | gw_time: Some(rx_time.into()), |
| 122 | ..Default::default() |
| 123 | }], |
| 124 | gateway_private_up_map: HashMap::new(), |
| 125 | gateway_private_down_map: HashMap::new(), |
| 126 | gateway_tenant_id_map: HashMap::new(), |
| 127 | gateway_downlink_priority_map: HashMap::new(), |
| 128 | region_common_name: lrwn::region::CommonName::EU868, |
| 129 | region_config_id: "eu868".into(), |
| 130 | roaming_meta_data: None, |
| 131 | }; |
| 132 | |
| 133 | let tenant = tenant::create(tenant::Tenant { |
| 134 | name: "test-tenant".into(), |
| 135 | ..Default::default() |
| 136 | }) |
| 137 | .await |
| 138 | .unwrap(); |
| 139 | let app = application::create(application::Application { |
| 140 | tenant_id: tenant.id, |
| 141 | name: "test-app".into(), |
| 142 | ..Default::default() |
| 143 | }) |
| 144 | .await |
| 145 | .unwrap(); |
| 146 | let dp = device_profile::create(device_profile::DeviceProfile { |
| 147 | tenant_id: Some(tenant.id), |
| 148 | name: "test-dp".into(), |
| 149 | ..Default::default() |
| 150 | }) |
| 151 | .await |
| 152 | .unwrap(); |
| 153 | let dev = device::create(device::Device { |
| 154 | application_id: app.id, |
nothing calls this directly
no test coverage detected