• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

snowplow / snowplow-android-tracker / #1055

pending completion
#1055

push

github-actions

mscwilson
Merge branch 'release/5.0.0-beta.1' into next

214 of 214 new or added lines in 18 files covered. (100.0%)

3599 of 4680 relevant lines covered (76.9%)

0.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/snowplow-tracker/src/main/java/com/snowplowanalytics/core/statemachine/PluginStateMachine.kt
1
/*
2
 * Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
3
 *
4
 * This program is licensed to you under the Apache License Version 2.0,
5
 * and you may not use this file except in compliance with the Apache License Version 2.0.
6
 * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
7
 *
8
 * Unless required by applicable law or agreed to in writing,
9
 * software distributed under the Apache License Version 2.0 is distributed on an
10
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
 * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
12
 */
13
package com.snowplowanalytics.core.statemachine
14

15
import com.snowplowanalytics.snowplow.configuration.PluginAfterTrackConfiguration
16
import com.snowplowanalytics.snowplow.configuration.PluginEntitiesConfiguration
17
import com.snowplowanalytics.snowplow.event.Event
18
import com.snowplowanalytics.snowplow.payload.SelfDescribingJson
19
import com.snowplowanalytics.snowplow.tracker.InspectableEvent
20
import java.util.*
21

22
class PluginStateMachine(
1✔
23
    override val identifier: String,
1✔
24
    val entitiesConfiguration: PluginEntitiesConfiguration?,
1✔
25
    val afterTrackConfiguration: PluginAfterTrackConfiguration?
1✔
26
) : StateMachineInterface {
27

28
    override val subscribedEventSchemasForTransitions: List<String>
29
        get() = emptyList()
1✔
30

31
    override val subscribedEventSchemasForEntitiesGeneration: List<String>
32
        get() {
33
            val config = entitiesConfiguration ?: return emptyList()
1✔
34
            return config.schemas ?: Collections.singletonList("*")
1✔
35
        }
36

37
    override val subscribedEventSchemasForPayloadUpdating: List<String>
38
        get() = emptyList()
1✔
39

40
    override val subscribedEventSchemasForAfterTrackCallback: List<String>
41
        get() {
42
            val config = afterTrackConfiguration ?: return emptyList()
1✔
43
            return config.schemas ?: Collections.singletonList("*")
1✔
44
        }
45

46
    override fun transition(event: Event, state: State?): State? {
47
        return null
×
48
    }
49

50
    override fun entities(event: InspectableEvent, state: State?): List<SelfDescribingJson> {
51
        return entitiesConfiguration?.closure?.apply(event) ?: emptyList()
1✔
52
    }
53

54
    override fun payloadValues(event: InspectableEvent, state: State?): Map<String, Any>? {
55
        return null
×
56
    }
57

58
    override fun afterTrack(event: InspectableEvent) {
59
        afterTrackConfiguration?.closure?.accept(event)
1✔
60
    }
1✔
61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc