|
| 1 | +package org.audit4j.validation.jgiven; |
| 2 | + |
| 3 | +import java.util.Arrays; |
| 4 | + |
| 5 | +import org.audit4j.validation.jgiven.enumeration.Version; |
| 6 | +import org.audit4j.validation.jgiven.stage.GivenSomeState; |
| 7 | +import org.audit4j.validation.jgiven.stage.ThenSomeOutcome; |
| 8 | +import org.audit4j.validation.jgiven.stage.WhenSomeAction; |
| 9 | +import org.junit.Ignore; |
| 10 | +import org.junit.Rule; |
| 11 | +import org.junit.Test; |
| 12 | +import org.junit.contrib.java.lang.system.SystemOutRule; |
| 13 | + |
| 14 | +import com.tngtech.jgiven.junit.ScenarioTest; |
| 15 | + |
| 16 | +public class ConsoleAuditHandlerWithFileConfigWithLayoutTest |
| 17 | + extends ScenarioTest<GivenSomeState, WhenSomeAction, ThenSomeOutcome> { |
| 18 | + |
| 19 | + @Rule |
| 20 | + public final SystemOutRule systemOutRule = new SystemOutRule().enableLog(); |
| 21 | + |
| 22 | + private static final String FILE_NAME = "audit4j-console-layout.conf.yml"; |
| 23 | + |
| 24 | + @Test |
| 25 | + @Ignore // does not work in version 2.5.0 |
| 26 | + public void console_audit_handler_with_file_configuration_receiving_a_message_with_event_builder() { |
| 27 | + |
| 28 | + given().audit4j_starting_with_the_configuration_defined_in_the_file_$_for_$(FILE_NAME,Arrays.asList("ConsoleAuditHandler")); |
| 29 | + when().a_message_is_sent_to_the_audit_manager_with_event_builder() |
| 30 | + .and().audit_manager_is_stopped(); |
| 31 | + then().the_console_log_contains_the_audit4j_logo_with_version_$(systemOutRule, Version.V250); |
| 32 | + //.and().the_console_log_contains_the_expected_output_for_event_builder(systemOutRule); |
| 33 | + } |
| 34 | + |
| 35 | + /* @Test |
| 36 | + public void console_audit_handler_with_file_configuration_receiving_a_message_with_audit_event() { |
| 37 | + |
| 38 | + given().audit4j_starting_with_the_configuration_defined_in_the_file_$_for_$(FILE_NAME,Arrays.asList("ConsoleAuditHandler")); |
| 39 | + when().a_message_is_sent_to_the_audit_manager_with_audit_event() |
| 40 | + .and().audit_manager_is_stopped(); |
| 41 | + then().the_console_log_contains_the_audit4j_logo_with_version_$(systemOutRule, Version.V250) |
| 42 | + .and().the_console_log_contains_the_expected_output_for_audit_event(systemOutRule); |
| 43 | + } |
| 44 | +
|
| 45 | + |
| 46 | + @Test |
| 47 | + public void console_audit_handler_with_file_configuration_receiving_a_message_with_event_builder_during_disable_state() { |
| 48 | + |
| 49 | + given().audit4j_starting_with_the_configuration_defined_in_the_file_$_for_$(FILE_NAME,Arrays.asList("ConsoleAuditHandler")); |
| 50 | + when().audit_manager_is_disabled() |
| 51 | + .and().a_message_is_sent_to_the_audit_manager_with_event_builder() |
| 52 | + .and().audit_manager_is_stopped(); |
| 53 | + then().the_console_log_contains_the_audit4j_logo_with_version_$(systemOutRule, Version.V250) |
| 54 | + .but().the_console_log_does_not_contains_messages_for_event_builder(systemOutRule); |
| 55 | + |
| 56 | + }*/ |
| 57 | + |
| 58 | +} |
0 commit comments