func TestPluginConfigGetStreamArray(t *testing.T) {
	expect := ttesting.NewExpect(t)
	mockPluginCfg := NewPluginConfig("", "core.mockPlugin")
	mockPluginCfgReader := NewPluginConfigReaderWithError(&mockPluginCfg)
	mockStreamArray := []string{
		"stream1",
		"stream2",
	}
	mockStreamHashed := []MessageStreamID{
		StreamRegistry.GetStreamID("stream1"),
		StreamRegistry.GetStreamID("stream2"),
	}
	value, err := mockPluginCfgReader.GetStreamArray("mockstream", []MessageStreamID{})
	expect.NoError(err)
	expect.Equal(len(value), 0)
	mockPluginCfg.Override("mockstream", mockStreamArray)
	value, err = mockPluginCfgReader.GetStreamArray("mockstream", []MessageStreamID{})
	expect.NoError(err)
	expect.Equal(value, mockStreamHashed)
}
Function gets an array of MessageStreamID for a given key
Plan:
Create a new PluginConfig
Add an array of streams with mocked values in Settings
get the streamArray
Check the hash received hash with manual generation from streamregistery.getStreamID
package core
import (
	"github.com/trivago/tgo/tcontainer"
	"github.com/trivago/tgo/ttesting"
	"testing"
)
func TestPluginConfigValidate(t *testing.T) {
	expect := ttesting.NewExpect(t)
	mockPluginCfg := NewPluginConfig("", "core.mockPlugin")
	mockPluginCfgReader := NewPluginConfigReaderWithError(&mockPluginCfg)
	mockPluginCfg.Override("stringKey", "value")
	mockPluginCfg.Override("number", 1)
	sValue, err := mockPluginCfgReader.GetString("stringKey", "")
	expect.NoError(err)
	expect.Equal(sValue, "value")
	err = mockPluginCfg.Validate()
	expect.NoError(err)
	iValue, err := mockPluginCfgReader.GetInt("number", 0)
	expect.NoError(err)
	expect.Equal(iValue, int64(1))
	err = mockPluginCfg.Validate()
	expect.NoError(err)
}
func TestPluginConfigRead(t *testing.T) {
	expect := ttesting.NewExpect(t)
	mockPluginCfg := NewPluginConfig("", "core.mockPlugin")
	mockPluginCfgReader := NewPluginConfigReaderWithError(&mockPluginCfg)
	mockPluginCfg = NewPluginConfig("", "core.mockPlugin")
	mockPluginCfgReader = NewPluginConfigReaderWithError(&mockPluginCfg)
	testMarshalMap := tcontainer.NewMarshalMap()
	testMarshalMap["Enable"] = true
	testMarshalMap["Host"] = "someHost"
	testMarshalMap["Database"] = "someDatabase"
	mockPluginCfg.Read(testMarshalMap)
	expect.True(mockPluginCfg.Enable)
	host, err := mockPluginCfgReader.GetString("Host", "")
	expect.NoError(err)
	expect.Equal(host, "someHost")
	db, err := mockPluginCfgReader.GetString("Database", "")
	expect.NoError(err)
	expect.Equal(db, "someDatabase")
}
func TestPluginConfigHasValue(t *testing.T) {
	expect := ttesting.NewExpect(t)
	mockPluginCfg := NewPluginConfig("", "mockPlugin")
	mockPluginCfgReader := NewPluginConfigReaderWithError(&mockPluginCfg)
	expect.False(mockPluginCfgReader.HasValue("aKey"))
	mockPluginCfg.Override("aKey", 1)
	expect.True(mockPluginCfgReader.HasValue("aKey"))
}
func TestPluginConfigOverride(t *testing.T) {
	expect := ttesting.NewExpect(t)
	mockPluginCfg := NewPluginConfig("", "core.mockPlugin")
	mockPluginCfgReader := NewPluginConfigReaderWithError(&mockPluginCfg)
	mockPluginCfg.Override("akey", "aValue")
	expect.True(mockPluginCfgReader.HasValue("akey"))
	value, err := mockPluginCfgReader.GetString("akey", "")
	expect.NoError(err)
	expect.Equal(value, "aValue")
	mockPluginCfg.Override("akey", "newValue")
	value, err = mockPluginCfgReader.GetString("akey", "")
	expect.NoError(err)
	expect.Equal(value, "newValue")
}
func TestPluginConfigGetString(t *testing.T) {
	expect := ttesting.NewExpect(t)
	mockPluginCfg := NewPluginConfig("", "core.mockPlugin")
	mockPluginCfgReader := NewPluginConfigReaderWithError(&mockPluginCfg)
	value, err := mockPluginCfgReader.GetString("aKey", "default")
	expect.NoError(err)
	expect.Equal(value, "default")
	mockPluginCfg.Override("aKey", "aValue")
	value, err = mockPluginCfgReader.GetString("aKey", "default")
	expect.NoError(err)
	expect.Equal(value, "aValue")
}
func TestPluginConfigGetStringArray(t *testing.T) {
	expect := ttesting.NewExpect(t)
	mockPluginCfg := NewPluginConfig("", "core.mockPlugin")
	mockPluginCfgReader := NewPluginConfigReaderWithError(&mockPluginCfg)
	mockStringArray := []string{"el1", "el2", "el3"}
	value, err := mockPluginCfgReader.GetStringArray("arrKey", []string{})
	expect.NoError(err)
	expect.Equal(len(value), 0)
	mockPluginCfg.Override("arrKey", mockStringArray)
	value, err = mockPluginCfgReader.GetStringArray("arrKey", []string{})
	expect.NoError(err)
	expect.Equal(value, mockStringArray)
}
func TestPluginConfigGetStringMap(t *testing.T) {
	expect := ttesting.NewExpect(t)
	mockPluginCfg := NewPluginConfig("", "core.mockPlugin")
	mockPluginCfgReader := NewPluginConfigReaderWithError(&mockPluginCfg)
	mockStringMap := map[string]string{
		"k1": "v1",
		"k2": "v2",
		"k3": "v3",
	}
	value, err := mockPluginCfgReader.GetStringMap("strmapkey", map[string]string{})
	expect.NoError(err)
	expect.Equal(len(value), 0)
	mockPluginCfg.Override("strmapkey", mockStringMap)
	value, err = mockPluginCfgReader.GetStringMap("strmapkey", map[string]string{})
	expect.NoError(err)
	expect.Equal(value, mockStringMap)
}