package capacitycontroller

import (
	"context"
	"testing"
)

func TestStaticAdapterDoesNotRequireKubernetes(t *testing.T) {
	adapter := NewStaticAdapter(map[string]int{"pool-a": 2})
	state, err := adapter.PoolState(context.Background(), "pool-a", "ignored")
	if err != nil {
		t.Fatal(err)
	}
	if state.PoolID != "pool-a" || state.CurrentReplicas != 2 {
		t.Fatalf("state=%+v", state)
	}
	if err := adapter.ScalePool(context.Background(), "pool-a", "ignored", 4); err != nil {
		t.Fatal(err)
	}
	state, _ = adapter.PoolState(context.Background(), "pool-a", "ignored")
	if state.CurrentReplicas != 2 {
		t.Fatalf("static adapter scaled to %d", state.CurrentReplicas)
	}
}
