void getTableTest()

in ddm-rrm/src/it/java/com/epam/digital/data/platform/management/MasterVersionTableControllerIT.java [128:173]


    void getTableTest() {
      context.prepareRegistryDataSource(context.getGerritProps().getHeadBranch(),
          "liquibase/update-master_table.xml");
      var name = "master_table";
      mockMvc.perform(
          get("/versions/master/tables/{tableName}", 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("$.columns.string_column.name", is("string_column")),
          jsonPath("$.columns.string_column.description", is("string column in master_table")),
          jsonPath("$.columns.string_column.type", is("varchar")),
          jsonPath("$.columns.string_column.defaultValue", is(nullValue())),
          jsonPath("$.columns.string_column.notNullFlag", is(false)),
          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"))
      );
    }