1. Restart RabbitMQ
2. Restart localstack
3. Run this code:
```
#[tokio::test]
async fn send_websocket() {
let device_info = create_device(None).await;
let mut socket = create_socket(&device_info).await;
let request = WebsocketMessageToDevice {
device_id: device_info.device_id.to_string(),
payload: "message from test".to_string(),
};
let serialized_request = serde_json::to_string(&request)
.expect("Failed to serialize connection request");
println!("request: {}", serialized_request);
socket
.send(Message::Text(serialized_request))
.await
.expect("Failed to send message");
}
```
4. Open RabbitMQ management console, there should be one dropped message (there is no device with `test_persist` ID)
[ss]
5. Open DynamoDB console, message should be persisted:
[ss].
6. Additionally, check TB logs for:
```
2023-09-28T12:52:08.492774Z DEBUG tunnelbroker::websockets::session: Received message for ZXx1ADCFxFm6P+UmVhX0A1tuqUoBU7lYjig/gMzSEJI
2023-09-28T12:52:08.492789Z DEBUG tunnelbroker::database: Persisting message to device: ZXx1ADCFxFm6P+UmVhX0A1tuqUoBU7lYjig/gMzSEJI
```
7. Run:
`cd services/commtest && cargo test --test tunnelbroker_persist_tests -- --nocapture`