use of com.mercedesbenz.sechub.docgen.DocAnnotationData in project sechub by mercedes-benz.
the class ScheduleDescriptionGeneratorTest method when_collector_returns_one_entry_with_spring_scheduled_initialDelayString_a_table_is_build.
@Test
public void when_collector_returns_one_entry_with_spring_scheduled_initialDelayString_a_table_is_build() throws Exception {
/* prepare */
DocAnnotationData a = new DocAnnotationData();
a.springScheduled = mock(Scheduled.class);
when(a.springScheduled.initialDelayString()).thenReturn("initialDelayString");
List<DocAnnotationData> list = new ArrayList<>();
list.add(a);
when(collector.fetchMustBeDocumentParts()).thenReturn(list);
/* execute */
String generated = generatorToTest.generate(collector);
/* test */
assertNotNull(generated);
assertFalse(generated.isEmpty());
assertTrue(generated.indexOf("|===") != -1);
}
use of com.mercedesbenz.sechub.docgen.DocAnnotationData in project sechub by mercedes-benz.
the class SystemPropertiesDescriptionGeneratorTest method when_collector_returns_one_entry_with_spring_value_1_a_table_is_build.
@Test
public void when_collector_returns_one_entry_with_spring_value_1_a_table_is_build() throws Exception {
/* prepare */
DocAnnotationData a = new DocAnnotationData();
a.springValue = "${something}";
a.description = "the description";
List<DocAnnotationData> list = new ArrayList<>();
list.add(a);
/* execute */
String generated = generatorToTest.generate(list);
/* test */
assertNotNull(generated);
assertFalse(generated.isEmpty());
assertTrue(generated.indexOf("|===") != -1);
}
use of com.mercedesbenz.sechub.docgen.DocAnnotationData in project sechub by mercedes-benz.
the class AnnotationDataLocationExtractorTest method data_with_field_results_in_correct_string.
@Test
public void data_with_field_results_in_correct_string() throws Exception {
/* prepare */
DocAnnotationData data = new DocAnnotationData();
data.linkedField = getClass().getDeclaredField("extractorToTest");
/* execute */
String result = extractorToTest.extractLocation(data);
/* test */
assertEquals("Field:AnnotationDataLocationExtractorTest.extractorToTest", result);
}
use of com.mercedesbenz.sechub.docgen.DocAnnotationData in project sechub by mercedes-benz.
the class AnnotationDataLocationExtractorTest method data_with_method_results_in_correct_string.
@Test
public void data_with_method_results_in_correct_string() throws Exception {
/* prepare */
DocAnnotationData data = new DocAnnotationData();
data.linkedMethod = getClass().getMethod("data_with_method_results_in_correct_string");
/* execute */
String result = extractorToTest.extractLocation(data);
/* test */
assertEquals("Method:AnnotationDataLocationExtractorTest#data_with_method_results_in_correct_string", result);
}
use of com.mercedesbenz.sechub.docgen.DocAnnotationData in project sechub by mercedes-benz.
the class AnnotationDataLocationExtractorTest method data_with_class_results_in_correct_string.
@Test
public void data_with_class_results_in_correct_string() throws Exception {
/* prepare */
DocAnnotationData data = new DocAnnotationData();
data.linkedClass = AnnotationDataLocationExtractorTest.class;
/* execute */
String result = extractorToTest.extractLocation(data);
/* test */
assertEquals("Class:AnnotationDataLocationExtractorTest", result);
}
Aggregations