2022-10-04 09:23:43 +00:00
|
|
|
package bbgo
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestGetIsolationFromContext(t *testing.T) {
|
|
|
|
ctx := context.Background()
|
|
|
|
isolation := GetIsolationFromContext(ctx)
|
|
|
|
assert.NotNil(t, isolation)
|
|
|
|
assert.NotNil(t, isolation.persistenceServiceFacade)
|
|
|
|
assert.NotNil(t, isolation.gracefulShutdown)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestNewDefaultIsolation(t *testing.T) {
|
|
|
|
isolation := NewDefaultIsolation()
|
|
|
|
assert.NotNil(t, isolation)
|
|
|
|
assert.NotNil(t, isolation.persistenceServiceFacade)
|
|
|
|
assert.NotNil(t, isolation.gracefulShutdown)
|
2023-04-25 16:42:33 +00:00
|
|
|
assert.Equal(t, defaultPersistenceServiceFacade, isolation.persistenceServiceFacade)
|
2022-10-04 09:23:43 +00:00
|
|
|
}
|