Upstream sync

This commit is contained in:
Senad Uka
2023-09-18 12:27:40 +02:00
parent 9750aa2c37
commit 1f30f85787
30 changed files with 309 additions and 150 deletions

View File

@@ -26,7 +26,7 @@ func runTestServer() *httptest.Server {
if err != nil {
log.Fatal(err)
}
shared.Init()
r := gin.Default()
r.POST("/device_info", SaveDeviceInfofunc)
@@ -45,7 +45,6 @@ func TestSaveDeviceInfofunc(t *testing.T) {
if err != nil {
t.Fatalf("Expected no error, got %v", err)
}
assert.Equal(t, 400, resp.StatusCode)
})
@@ -65,7 +64,7 @@ func TestSaveDeviceInfofunc(t *testing.T) {
t.Run("it should return 200 when all conditions are correct", func(t *testing.T) {
// Add a valid payload
deviceInfo := map[string]interface{}{
"IMEI": "SOME_VALID_IMEI",
"IMEI": "SOME_VALID_IMEI",
"SomeOtherField": "Value",
}