Search in sources :

Example 21 with MappingEntry

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());
}
Also used : MappingEntry(com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry) Test(org.junit.Test)

Example 22 with MappingEntry

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());
}
Also used : MappingEntry(com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry) Test(org.junit.Test)

Example 23 with MappingEntry

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());
}
Also used : MappingEntry(com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry) Test(org.junit.Test)

Example 24 with MappingEntry

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());
}
Also used : MappingEntry(com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry) Test(org.junit.Test)

Example 25 with MappingEntry

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;
}
Also used : MappingEntry(com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry) ArrayList(java.util.ArrayList)

Aggregations

MappingEntry (com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry)32 MappingData (com.mercedesbenz.sechub.sharedkernel.mapping.MappingData)21 Test (org.junit.Test)21 ArrayList (java.util.ArrayList)7 Before (org.junit.Before)2 ProductExecutorConfigSetup (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetup)1 ProductExecutorConfigSetupCredentials (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupCredentials)1 ProductExecutorConfigSetupJobParameter (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter)1 ExecutionResult (com.mercedesbenz.sechub.integrationtest.internal.SecHubClientExecutor.ExecutionResult)1 TestURLBuilder (com.mercedesbenz.sechub.test.TestURLBuilder)1 UUID (java.util.UUID)1