Skip to content

Commit

Permalink
Merge pull request #41 from OSGP/feature/FDP-2551-firmware
Browse files Browse the repository at this point in the history
FDP-2551 Firmware update added
  • Loading branch information
sanderv authored Oct 30, 2024
2 parents 9cb3f7f + d49ce46 commit ed24206
Show file tree
Hide file tree
Showing 21 changed files with 349 additions and 582 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0
package org.gxf.crestdevicesimulator

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.cbor.databind.CBORMapper
import java.net.URI
import java.time.Duration
Expand All @@ -15,17 +14,14 @@ import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.core.io.ClassPathResource

@SpringBootTest
class SimulatorIntegrationTest {

@Value("\${simulator.config.uri}") private lateinit var uri: URI

private val mapper = ObjectMapper()
private lateinit var coapServer: CoapServer
private val coapResourceStub = CoapResourceStub()
private val expectedJsonNode = mapper.readTree(ClassPathResource("messages/kod-message.json").file)

@BeforeEach
fun setup() {
Expand All @@ -39,7 +35,7 @@ class SimulatorIntegrationTest {
fun shouldSendCoapRequestToConfiguredEndpoint() {
Awaitility.await().atMost(Duration.ofSeconds(5)).untilAsserted {
val jsonNodeStub = CBORMapper().readTree(coapResourceStub.lastRequestPayload)
assertThat(jsonNodeStub).isEqualTo(expectedJsonNode)
assertThat(jsonNodeStub.has("FMC")).isTrue()
}
}
}
4 changes: 0 additions & 4 deletions application/src/integrationTest/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ spring:

simulator:
config:
scheduled-message: "classpath:messages/kod-message.json"
success-message: "classpath:messages/psk-change-success-message.json"
failure-message: "classpath:messages/psk-change-failure-message.json"
reboot-success-message: "classpath:messages/kod-reboot-success-message.json"
# Simulator will produce valid/invalid CBOR messages
produce-valid-cbor: true
# Uri of the target coap server
Expand Down
185 changes: 0 additions & 185 deletions application/src/integrationTest/resources/messages/kod-message.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit ed24206

Please sign in to comment.