update status data
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
messages "git.tornberg.me/go-cart-actor/proto"
|
||||
)
|
||||
|
||||
func TestConnection(t *testing.T) {
|
||||
@@ -33,14 +36,25 @@ func TestConnection(t *testing.T) {
|
||||
pool.AddRemote("127.0.0.1")
|
||||
|
||||
go pool.Negotiate()
|
||||
|
||||
data, err := pool.Get(ToCartId("kalle"))
|
||||
msg := Message{
|
||||
Type: AddItemType,
|
||||
//TimeStamp: time.Now().Unix(),
|
||||
Content: &messages.AddItem{
|
||||
Quantity: 1,
|
||||
Price: 100,
|
||||
Sku: "123",
|
||||
Name: "Test",
|
||||
Image: "Test",
|
||||
},
|
||||
}
|
||||
data, err := pool.Process(ToCartId("kalle"), msg)
|
||||
if err != nil {
|
||||
t.Errorf("Error getting data: %v", err)
|
||||
}
|
||||
if data == nil {
|
||||
t.Errorf("Expected data, got nil")
|
||||
if data.StatusCode != 200 {
|
||||
t.Errorf("Expected 200")
|
||||
}
|
||||
log.Println(data)
|
||||
time.Sleep(2 * time.Millisecond)
|
||||
data, err = pool.Get(ToCartId("kalle"))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user