in ddm-rrm/src/it/java/com/epam/digital/data/platform/management/CandidateVersionTableControllerIT.java [194:235]
void getTableTest() {
final var versionCandidateId = context.createVersionCandidate();
var name = "master_table";
mockMvc.perform(
get("/versions/candidates/{versionCandidateId}/tables/{tableName}", versionCandidateId,
name)
).andExpectAll(
status().isOk(),
content().contentType(MediaType.APPLICATION_JSON),
jsonPath("$.name", is(name)),
jsonPath("$.description", is("table in master version")),
jsonPath("$.objectReference", is(true)),
jsonPath("$.columns.subject_id.name", is("subject_id")),
jsonPath("$.columns.subject_id.description", is(nullValue())),
jsonPath("$.columns.subject_id.type", is("uuid")),
jsonPath("$.columns.subject_id.defaultValue", is(nullValue())),
jsonPath("$.columns.subject_id.notNullFlag", is(true)),
jsonPath("$.columns.id.name", is("id")),
jsonPath("$.columns.id.description", is(nullValue())),
jsonPath("$.columns.id.type", is("int4")),
jsonPath("$.columns.id.defaultValue", is(nullValue())),
jsonPath("$.columns.id.notNullFlag", is(true)),
jsonPath("$.foreignKeys.fk_master_table_subject.name", is("fk_master_table_subject")),
jsonPath("$.foreignKeys.fk_master_table_subject.targetTable", is("subject")),
jsonPath("$.foreignKeys.fk_master_table_subject.columnPairs", hasSize(1)),
jsonPath("$.foreignKeys.fk_master_table_subject.columnPairs[0].sourceColumnName",
is("subject_id")),
jsonPath("$.foreignKeys.fk_master_table_subject.columnPairs[0].targetColumnName",
is("subject_id")),
jsonPath("$.primaryKey.name", is("master_table_pkey")),
jsonPath("$.primaryKey.columns[0].name", is("id")),
jsonPath("$.primaryKey.columns[0].sorting", is("ASC")),
jsonPath("$.uniqueConstraints", is(Map.of())),
jsonPath("$.indices.ix_master_table_subject__subject_id.name",
is("ix_master_table_subject__subject_id")),
jsonPath("$.indices.ix_master_table_subject__subject_id.columns", hasSize(1)),
jsonPath("$.indices.ix_master_table_subject__subject_id.columns[0].name",
is("subject_id")),
jsonPath("$.indices.ix_master_table_subject__subject_id.columns[0].sorting", is("ASC"))
);
}