forked from ESAPI/esapi-java-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the logging properties to opt-out of the prefix events ESAPI#844
- Loading branch information
Showing
11 changed files
with
322 additions
and
12 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
44 changes: 44 additions & 0 deletions
44
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,44 @@ | ||
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.setIgnoreLogEventType(true); | ||
assertEquals(expectedResult, supplier.get()); | ||
} | ||
} |
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
Oops, something went wrong.