()
| 123 | |
| 124 | #[tokio::test] |
| 125 | async fn test_redis() { |
| 126 | let _guard = test::prepare().await; |
| 127 | let i = Integration::new(); |
| 128 | let mut last_id = "0".to_string(); |
| 129 | |
| 130 | // uplink |
| 131 | let pl = integration::UplinkEvent { |
| 132 | device_info: Some(integration::DeviceInfo { |
| 133 | application_id: Uuid::nil().to_string(), |
| 134 | dev_eui: "0102030405060708".to_string(), |
| 135 | ..Default::default() |
| 136 | }), |
| 137 | ..Default::default() |
| 138 | }; |
| 139 | i.uplink_event(&HashMap::new(), &pl).await.unwrap(); |
| 140 | last_id = assert_reply(&last_id, "up", &pl.encode_to_vec()).await; |
| 141 | |
| 142 | // join |
| 143 | let pl = integration::JoinEvent { |
| 144 | device_info: Some(integration::DeviceInfo { |
| 145 | application_id: Uuid::nil().to_string(), |
| 146 | dev_eui: "0102030405060708".to_string(), |
| 147 | ..Default::default() |
| 148 | }), |
| 149 | ..Default::default() |
| 150 | }; |
| 151 | i.join_event(&HashMap::new(), &pl).await.unwrap(); |
| 152 | last_id = assert_reply(&last_id, "join", &pl.encode_to_vec()).await; |
| 153 | |
| 154 | // ack |
| 155 | let pl = integration::AckEvent { |
| 156 | device_info: Some(integration::DeviceInfo { |
| 157 | application_id: Uuid::nil().to_string(), |
| 158 | dev_eui: "0102030405060708".to_string(), |
| 159 | ..Default::default() |
| 160 | }), |
| 161 | ..Default::default() |
| 162 | }; |
| 163 | i.ack_event(&HashMap::new(), &pl).await.unwrap(); |
| 164 | last_id = assert_reply(&last_id, "ack", &pl.encode_to_vec()).await; |
| 165 | |
| 166 | // txack |
| 167 | let pl = integration::TxAckEvent { |
| 168 | device_info: Some(integration::DeviceInfo { |
| 169 | application_id: Uuid::nil().to_string(), |
| 170 | dev_eui: "0102030405060708".to_string(), |
| 171 | ..Default::default() |
| 172 | }), |
| 173 | ..Default::default() |
| 174 | }; |
| 175 | i.txack_event(&HashMap::new(), &pl).await.unwrap(); |
| 176 | last_id = assert_reply(&last_id, "txack", &pl.encode_to_vec()).await; |
| 177 | |
| 178 | // log |
| 179 | let pl = integration::LogEvent { |
| 180 | device_info: Some(integration::DeviceInfo { |
| 181 | application_id: Uuid::nil().to_string(), |
| 182 | dev_eui: "0102030405060708".to_string(), |
nothing calls this directly
no test coverage detected