diff --git a/application/src/main/kotlin/org/gxf/crestdeviceservice/command/resulthandler/Rsp2CommandResultHandler.kt b/application/src/main/kotlin/org/gxf/crestdeviceservice/command/resulthandler/Rsp2CommandResultHandler.kt index d9074434..54e85820 100644 --- a/application/src/main/kotlin/org/gxf/crestdeviceservice/command/resulthandler/Rsp2CommandResultHandler.kt +++ b/application/src/main/kotlin/org/gxf/crestdeviceservice/command/resulthandler/Rsp2CommandResultHandler.kt @@ -12,7 +12,7 @@ import org.springframework.stereotype.Component class Rsp2CommandResultHandler(commandService: CommandService, commandFeedbackService: CommandFeedbackService) : RspCommandResultHandler(commandService, commandFeedbackService) { - override val confirmationDownlinkInUrc = "CMD:RSP2" + override val successUrc = "RSP2:OK" override val errorUrc = "RSP2:DLER" override val supportedCommandType = CommandType.RSP2 diff --git a/application/src/main/kotlin/org/gxf/crestdeviceservice/command/resulthandler/RspCommandResultHandler.kt b/application/src/main/kotlin/org/gxf/crestdeviceservice/command/resulthandler/RspCommandResultHandler.kt index 5ffee70e..7f069dbf 100644 --- a/application/src/main/kotlin/org/gxf/crestdeviceservice/command/resulthandler/RspCommandResultHandler.kt +++ b/application/src/main/kotlin/org/gxf/crestdeviceservice/command/resulthandler/RspCommandResultHandler.kt @@ -13,13 +13,12 @@ import org.springframework.stereotype.Component class RspCommandResultHandler(commandService: CommandService, commandFeedbackService: CommandFeedbackService) : CommandResultHandler(commandService, commandFeedbackService) { - val confirmationDownlinkInUrc = "CMD:RSP" + val successUrc = "RSP:OK" val errorUrc = "RSP:DLER" override val supportedCommandType = CommandType.RSP - override fun hasSucceeded(deviceId: String, body: JsonNode) = - confirmationDownlinkInUrc in body.downlinks() && errorUrc !in body.urcs() + override fun hasSucceeded(deviceId: String, body: JsonNode) = successUrc in body.urcs() override fun hasFailed(deviceId: String, body: JsonNode) = errorUrc in body.urcs() } diff --git a/application/src/test/kotlin/org/gxf/crestdeviceservice/command/resulthandler/Rsp2CommandResultHandlerTest.kt b/application/src/test/kotlin/org/gxf/crestdeviceservice/command/resulthandler/Rsp2CommandResultHandlerTest.kt index 7ba41b49..5e95f111 100644 --- a/application/src/test/kotlin/org/gxf/crestdeviceservice/command/resulthandler/Rsp2CommandResultHandlerTest.kt +++ b/application/src/test/kotlin/org/gxf/crestdeviceservice/command/resulthandler/Rsp2CommandResultHandlerTest.kt @@ -83,9 +83,10 @@ class Rsp2CommandResultHandlerTest { @JvmStatic fun hasSucceededTestSource(): Stream = Stream.of( - Arguments.of(listOf(), "CMD:RSP2", true), - Arguments.of(listOf("PSK:TMP"), "!PSK:######;CMD:RSP2", true), - Arguments.of(listOf("PSK:TMP"), "!CMD:RSP2;PSK:######", true), + Arguments.of(listOf("RSP2:OK"), "CMD:RSP2", true), + Arguments.of(listOf(), "CMD:RSP2", false), + Arguments.of(listOf("PSK:TMP", "RSP2:OK"), "!PSK:######;CMD:RSP2", true), + Arguments.of(listOf("RSP2:OK", "PSK:TMP"), "!CMD:RSP2;PSK:######", true), Arguments.of(listOf("RSP2:DLER"), "CMD:RSP2", false), Arguments.of(listOf("RSP2:DLER", "PSK:TMP"), "!CMD:RSP2;PSK:######", false), Arguments.of(listOf("INIT", "WDR"), "0", false), diff --git a/application/src/test/kotlin/org/gxf/crestdeviceservice/command/resulthandler/RspCommandResultHandlerTest.kt b/application/src/test/kotlin/org/gxf/crestdeviceservice/command/resulthandler/RspCommandResultHandlerTest.kt index 071e34a1..1c5a7c65 100644 --- a/application/src/test/kotlin/org/gxf/crestdeviceservice/command/resulthandler/RspCommandResultHandlerTest.kt +++ b/application/src/test/kotlin/org/gxf/crestdeviceservice/command/resulthandler/RspCommandResultHandlerTest.kt @@ -83,9 +83,10 @@ class RspCommandResultHandlerTest { @JvmStatic fun hasSucceededTestSource(): Stream = Stream.of( - Arguments.of(listOf(), "CMD:RSP", true), - Arguments.of(listOf("PSK:TMP"), "!PSK:######;CMD:RSP", true), - Arguments.of(listOf("PSK:TMP"), "!CMD:RSP;PSK:######", true), + Arguments.of(listOf("RSP:OK"), "CMD:RSP", true), + Arguments.of(listOf(), "CMD:RSP", false), + Arguments.of(listOf("PSK:TMP", "RSP:OK"), "!PSK:######;CMD:RSP", true), + Arguments.of(listOf("RSP:OK", "PSK:TMP"), "!CMD:RSP;PSK:######", true), Arguments.of(listOf("RSP:DLER"), "CMD:RSP", false), Arguments.of(listOf("RSP:DLER", "PSK:TMP"), "!CMD:RSP;PSK:######", false), Arguments.of(listOf("INIT", "WDR"), "0", false),