-
Notifications
You must be signed in to change notification settings - Fork 0
/
resolver_test.go
25 lines (21 loc) · 972 Bytes
/
resolver_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package core
import (
"github.com/stretchr/testify/assert"
"testing"
)
func getSimplePropertyResolver() *SimplePropertyResolver {
propertySources := NewPropertySources()
commandLinePropertySource := NewSimpleCommandLinePropertySource(getTestApplicationArguments())
propertySources.Add(commandLinePropertySource)
return NewSimplePropertyResolver(propertySources)
}
func TestSimplePropertyResolver_ContainsProperty(t *testing.T) {
propertyResolver := getSimplePropertyResolver()
assert.True(t, propertyResolver.ContainsProperty("procyon.application.name"))
assert.False(t, propertyResolver.ContainsProperty("procyon.server.timeout"))
}
func TestSimplePropertyResolver_GetProperty(t *testing.T) {
propertyResolver := getSimplePropertyResolver()
assert.Equal(t, "\"Test Application\"", propertyResolver.GetProperty("procyon.application.name", ""))
assert.Equal(t, "Default Timeout", propertyResolver.GetProperty("procyon.server.timeout", "Default Timeout"))
}