SpringBoot: CordaClient: ResponseBody DAO

This commit is contained in:
djmil 2023-09-01 16:58:43 +02:00
parent f534b70bd2
commit 5035a16930
4 changed files with 55 additions and 2 deletions

View File

@ -0,0 +1,11 @@
package djmil.cordacheckers.cordaclient.dao.flow;
public record ResponseBody(
String holdingIdentityShortHash,
String clientRequestId,
String flowId,
String flowStatus,
String flowResult,
String flowError,
String timestamp
) { }

View File

@ -15,7 +15,7 @@ import java.io.IOException;
public class RequestBodyTest {
@Autowired
private JacksonTester<RequestBody> json;
private JacksonTester<RequestBody> jTester;
@Test
void listFlowTest() throws IOException {
@ -26,6 +26,6 @@ public class RequestBodyTest {
new Empty()
);
assertThat(json.write(requestBody)).isEqualToJson("requestBody/ListFlow.json");
assertThat(jTester.write(requestBody)).isEqualToJson("requestBody/ListFlow.json");
}
}

View File

@ -0,0 +1,33 @@
package djmil.cordacheckers.cordaclient.dao.flow;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.json.JsonTest;
import org.springframework.boot.test.json.JacksonTester;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
@JsonTest
public class ResponseBodyTest {
@Autowired
private JacksonTester<ResponseBody> jTester;
@Test
void GameProposalTest() throws IOException {
ResponseBody responseBody = new ResponseBody(
"804313813EED",
"game-proposal-11",
"ec913fe4-12cb-4867-acf0-4b8d24879362",
"COMPLETED",
"SHA-256D:67B08F2A94B1C38F6A42AC109FDCD6126B6B8F96FB2097DF81555956CC2AA7FB",
null,
"2023-08-29T14:41:05.600Z"
);
assertThat(jTester.write(responseBody)).isEqualToJson("ResponseBody-GameProposal.json");
}
}

View File

@ -0,0 +1,9 @@
{
"holdingIdentityShortHash": "804313813EED",
"clientRequestId": "game-proposal-11",
"flowId": "ec913fe4-12cb-4867-acf0-4b8d24879362",
"flowStatus": "COMPLETED",
"flowResult": "SHA-256D:67B08F2A94B1C38F6A42AC109FDCD6126B6B8F96FB2097DF81555956CC2AA7FB",
"flowError": null,
"timestamp": "2023-08-29T14:41:05.600Z"
}