Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appsdk/configurable.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (dynamic AppFunctionsSDKConfigurable) TransformToXML() appcontext.AppFuncti
return transform.TransformToXML
}

// JSONTransform transforms an EdgeX event to JSON.
// TransformToJSON transforms an EdgeX event to JSON.
// It will return an error and stop the pipeline if a non-edgex
// event is received or if no data is recieved.
// This function is a configuration function and returns a function pointer.
Expand Down
20 changes: 10 additions & 10 deletions appsdk/configurable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestConfigurableDeviceNameFilter(t *testing.T) {
func TestConfigurableFilterByDeviceName(t *testing.T) {
configurable := AppFunctionsSDKConfigurable{
Sdk: &AppFunctionsSDK{
LoggingClient: lc,
Expand All @@ -45,15 +45,15 @@ func TestConfigurableDeviceNameFilter(t *testing.T) {
params[tt.key] = tt.value
trx := configurable.FilterByDeviceName(params)
if tt.expectNil {
assert.Nil(t, trx, "return result from DeviceNameFilter should be nil")
assert.Nil(t, trx, "return result from FilterByDeviceName should be nil")
} else {
assert.NotNil(t, trx, "return result from DeviceNameFilter should not be nil")
assert.NotNil(t, trx, "return result from FilterByDeviceName should not be nil")
}
})
}
}

func TestConfigurableValueDescriptorFilter(t *testing.T) {
func TestConfigurableFilterByValueDescriptor(t *testing.T) {
configurable := AppFunctionsSDKConfigurable{
Sdk: &AppFunctionsSDK{
LoggingClient: lc,
Expand All @@ -76,26 +76,26 @@ func TestConfigurableValueDescriptorFilter(t *testing.T) {
params[tt.key] = tt.value
trx := configurable.FilterByValueDescriptor(params)
if tt.expectNil {
assert.Nil(t, trx, "return result from ValueDescriptorFilter should be nil")
assert.Nil(t, trx, "return result from FilterByValueDescriptor should be nil")
} else {
assert.NotNil(t, trx, "return result from ValueDescriptorFilter should not be nil")
assert.NotNil(t, trx, "return result from FilterByValueDescriptor should not be nil")
}
})
}
}

func TestConfigurableXMLTransform(t *testing.T) {
func TestConfigurableTransformToXML(t *testing.T) {
configurable := AppFunctionsSDKConfigurable{}

trx := configurable.TransformToXML()
assert.NotNil(t, trx, "return result from XMLTransform should not be nil")
assert.NotNil(t, trx, "return result from TransformToXML should not be nil")
}

func TestConfigurableJSONTransform(t *testing.T) {
func TestConfigurableTransformToJSON(t *testing.T) {
configurable := AppFunctionsSDKConfigurable{}

trx := configurable.TransformToJSON()
assert.NotNil(t, trx, "return result from JSONTransform should not be nil")
assert.NotNil(t, trx, "return result from TransformToJSON should not be nil")
}

func TestConfigurableHTTPPost(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-filter-xml-mqtt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func main() {
os.Exit(-1)
}

// 2) Since our DeviceNameFilter Function requires the list of device names we would
// 2) Since our FilterByDeviceName Function requires the list of device names we would
// like to search for, we'll go ahead and define that now.
deviceNames := []string{"Random-Float-Device"}
// Since we are using MQTT, we'll also need to set up the addressable model to
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-filter-xml-post/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {
os.Exit(-1)
}

// 2) Since our DeviceNameFilter Function requires the list of device names we would
// 2) Since our FilterByDeviceName Function requires the list of device names we would
// like to search for, we'll go ahead and define that now.
deviceNames := []string{"Random-Float-Device"}
// 3) This is our pipeline configuration, the collection of functions to
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-filter-xml/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func main() {
os.Exit(-1)
}

// 2) Since our DeviceNameFilter Function requires the list of device names we would
// 2) Since our FilterByDeviceName Function requires the list of device names we would
// like to search for, we'll go ahead and define that now.
deviceNames := []string{"Random-Float-Device"}

Expand Down