Skip to content

Commit

Permalink
#39 Add channelIds to generated devices
Browse files Browse the repository at this point in the history
  • Loading branch information
magx2 committed Sep 10, 2019
1 parent c8fd8fd commit 3b17de3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/kotlin/pl/grzeslowski/jsuplaservermock/InitDb.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ open class InitDb(private val deviceService: DeviceService) : CommandLineRunner
// multiple channels
buildDeviceWithMultipleChannels("Multiple channels #1"),
buildDeviceWithMultipleChannels("Multiple channels #2")
).forEach {
deviceService.addDevice(it)
updateEnabled(it)
updateName(it)
updateComment(it)
).forEach { device ->
device.channelsIds = device.channels
.stream()
.map { it.id }
.collect(Collectors.toList())
deviceService.addDevice(device)
updateEnabled(device)
updateName(device)
updateComment(device)
}
}

Expand Down

0 comments on commit 3b17de3

Please sign in to comment.