### Question:
DatabaseTableInsertQueryGenerator { public String generate(DatabaseTableData tableMetadata) { StringBuilder result = new StringBuilder(); return result.append("INSERT INTO ") .append(tableMetadata.getTableName()) .append(OPEN_BRACKET) .append(generateInsertStatementTableColums(tableMetadata.getTableColumnsMetadata())) .append(CLOSING_BRACKET) .append(" VALUES ") .append(OPEN_BRACKET) .append(generateInsertStatementParameters(tableMetadata.getTableColumnsMetadata() .size())) .append(CLOSING_BRACKET) .toString(); }  String generate(DatabaseTableData tableMetadata);  }### Answer:
@Test void testGenerateWithTestDatabaseMetadataWhenSingleColumn() { DatabaseTableColumnMetadata databaseTableColumnMetadata = buildDatabaseTableColumnMetadata(TEST_COLUMN_NAME, TEST_COLUMN_TYPE); DatabaseTableData databaseTableMetadata = buildDatabaseTableData(List.of(databaseTableColumnMetadata), TEST_TABLE_NAME); String expectedQuery = "INSERT INTO testTableName(testColumnName) VALUES (?)"; String resultQuery = databaseTableInsertQueryGenerator.generate(databaseTableMetadata); Assertions.assertEquals(expectedQuery, resultQuery); }
@Test void testGenerateWithTestDatabaseMetadataWhenMultipleColumns() { List<DatabaseTableColumnMetadata> multipleDatabaseTableColumnMetadata = List.of(buildDatabaseTableColumnMetadata(TEST_COLUMN_NAME, TEST_COLUMN_TYPE), buildDatabaseTableColumnMetadata(TEST_COLUMN_NAME_2, TEST_COLUMN_TYPE)); DatabaseTableData databaseTableMetadata = buildDatabaseTableData(multipleDatabaseTableColumnMetadata, TEST_TABLE_NAME); String resultQuery = databaseTableInsertQueryGenerator.generate(databaseTableMetadata); String expectedQuery = "INSERT INTO testTableName(testColumnName, testColumnName2) VALUES (?, ?)"; Assertions.assertEquals(expectedQuery, resultQuery); }