-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * Update the logging properties to opt-out of the prefix events #844 * Update the logging properties to opt-out of the prefix events, second iteration for #844 * Update the logging properties to opt-out of the prefix events, third iteration * Update the logging properties to opt-out of the prefix events #844 fourt iteration * Update the logging properties to opt-out of the prefix events #844 fifth iteration * Update the logging properties to opt-out of the prefix events #844 sixt iteration * Update the logging properties to opt-out of the prefix events #844 seventh iteration * Update the logging properties to opt-out of the prefix events #844 eigth iteration * Update the logging properties to opt-out of the prefix events #844 ninth iteration
- Loading branch information
Showing
12 changed files
with
337 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/test/java/org/owasp/esapi/logging/appender/EventTypeLogSupplierIgnoreEventTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.owasp.esapi.logging.appender; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.owasp.esapi.Logger; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
@RunWith(Parameterized.class) | ||
public class EventTypeLogSupplierIgnoreEventTypeTest { | ||
|
||
@Parameterized.Parameters (name="{0} -> {1}") | ||
public static Collection<Object[]> assembleTests() { | ||
List<Object[]> paramSets = new ArrayList<>(); | ||
paramSets.add(new Object[] {Logger.EVENT_FAILURE,""}); | ||
paramSets.add(new Object[] {Logger.EVENT_SUCCESS,""}); | ||
paramSets.add(new Object[] {Logger.EVENT_UNSPECIFIED,""}); | ||
paramSets.add(new Object[] {Logger.SECURITY_AUDIT,""}); | ||
paramSets.add(new Object[] {Logger.SECURITY_FAILURE,""}); | ||
paramSets.add(new Object[] {Logger.SECURITY_SUCCESS,""}); | ||
paramSets.add(new Object[] {null, ""}); | ||
|
||
return paramSets; | ||
} | ||
|
||
private final Logger.EventType eventType; | ||
private final String expectedResult; | ||
|
||
public EventTypeLogSupplierIgnoreEventTypeTest(Logger.EventType eventType, String result) { | ||
this.eventType = eventType; | ||
this.expectedResult = result; | ||
} | ||
|
||
@Test | ||
public void testEventTypeLogIgnoreEventType() { | ||
EventTypeLogSupplier supplier = new EventTypeLogSupplier(eventType); | ||
supplier.setLogEventType(false); | ||
assertEquals(expectedResult, supplier.get()); | ||
} | ||
} |
Oops, something went wrong.