use of com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry in project sechub by mercedes-benz.
the class MappingEntryValidationImplTest method check_80_chars_limit_for_replacement.
@Test
public void check_80_chars_limit_for_replacement() {
assertTrue(validationToTest.validate(new MappingEntry("", CONST_80_CHARS, "")).isValid());
assertFalse(validationToTest.validate(new MappingEntry("", CONST_80_CHARS + "1", "")).isValid());
}
use of com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry in project sechub by mercedes-benz.
the class MappingEntryValidationImplTest method check_80_chars_limit_for_comment.
@Test
public void check_80_chars_limit_for_comment() {
assertTrue(validationToTest.validate(new MappingEntry("", "", CONST_80_CHARS)).isValid());
assertFalse(validationToTest.validate(new MappingEntry("", "", CONST_80_CHARS + "1")).isValid());
}
use of com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry in project sechub by mercedes-benz.
the class MappingEntryValidationImplTest method one_null_means_wrong.
@Test
public void one_null_means_wrong() {
assertFalse(validationToTest.validate(new MappingEntry(null, "", "")).isValid());
assertFalse(validationToTest.validate(new MappingEntry("", null, "")).isValid());
assertFalse(validationToTest.validate(new MappingEntry("", "", null)).isValid());
}
use of com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry in project sechub by mercedes-benz.
the class MappingEntryValidationImplTest method all_set_with_valid_content_nothing_wrong.
@Test
public void all_set_with_valid_content_nothing_wrong() {
assertTrue(validationToTest.validate(new MappingEntry("something.as.id", "replacement", "comment")).isValid());
assertTrue(validationToTest.validate(new MappingEntry("", "", "")).isValid());
}
use of com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry in project sechub by mercedes-benz.
the class MappingDataCSVSupport method toCSVRows.
public List<CSVRow> toCSVRows(MappingData data) {
List<CSVRow> rows = new ArrayList<>();
CSVRow headline = new CSVRow();
rows.add(headline);
headline.add("Pattern");
headline.add("Replacement");
headline.add("Comment");
for (MappingEntry entry : data.getEntries()) {
CSVRow row = new CSVRow();
rows.add(row);
row.add(entry.getPattern());
row.add(entry.getReplacement());
row.add(entry.getComment());
}
return rows;
}
Aggregations