Skip to content

Commit da8ec79

Browse files
yasirfolio3Michael Ng
authored andcommitted
fix(testapp-support): Fixes to allow test-app to use notification listeners. (#66)
1 parent 9065f67 commit da8ec79

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

optimizely/client/factory.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
type Options struct {
3333
Context context.Context
3434
ProjectConfigManager optimizely.ProjectConfigManager
35+
DecisionService decision.DecisionService
3536
}
3637

3738
// OptimizelyFactory is used to construct an instance of the OptimizelyClient
@@ -104,8 +105,12 @@ func (f OptimizelyFactory) ClientWithOptions(clientOptions Options) (*Optimizely
104105
return client, errors.New("unable to instantiate client: no project config manager, SDK key, or a Datafile provided")
105106
}
106107

107-
// @TODO: allow decision service to be passed in via options
108-
client.decisionService = decision.NewCompositeService(notificationCenter)
108+
if clientOptions.DecisionService != nil {
109+
client.decisionService = clientOptions.DecisionService
110+
} else {
111+
client.decisionService = decision.NewCompositeService(notificationCenter)
112+
}
113+
109114
client.isValid = true
110115
return client, nil
111116
}

optimizely/decision/entities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type Source string
3939

4040
const (
4141
// Rollout - the decision came from a rollout
42-
Rollout Source = "Rollout"
42+
Rollout Source = "rollout"
4343
)
4444

4545
// Decision contains base information about a decision

0 commit comments

Comments
 (0)