Package net.shibboleth.idp.profile.logic
Class DateAttributePredicateTest
- java.lang.Object
-
- net.shibboleth.idp.profile.logic.DateAttributePredicateTest
-
public class DateAttributePredicateTest extends Object
Unit test forDateAttributePredicate.
-
-
Field Summary
Fields Modifier and Type Field Description private DateTimeFormatterformatterprivate DateTimeFormatterjavaformatter
-
Constructor Summary
Constructors Constructor Description DateAttributePredicateTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ProfileRequestContextcreateProfileRequestContext(String name, String[] values)private String[]javaDateStrings(Duration... offsets)Produces an array of date strings that are offsets from current system time.private String[]jodaDateStrings(Duration... offsets)Produces an array of date strings that are offsets from current system time.private net.shibboleth.idp.profile.logic.DateAttributePredicatenewJavaPredicate(String attribute, Duration offset)private net.shibboleth.idp.profile.logic.DateAttributePredicatenewJodaPredicate(String attribute, Duration offset)Object[][]provideTestDataJava()Object[][]provideTestDataJoda()voidtestJavaTime(net.shibboleth.idp.profile.logic.DateAttributePredicate predicate, String attribute, String[] values, boolean expected)voidtestJodaTime(net.shibboleth.idp.profile.logic.DateAttributePredicate predicate, String attribute, String[] values, boolean expected)
-
-
-
Field Detail
-
formatter
private final DateTimeFormatter formatter
-
javaformatter
private final DateTimeFormatter javaformatter
-
-
Method Detail
-
provideTestDataJoda
@DataProvider(name="test-data-joda") public Object[][] provideTestDataJoda()
-
provideTestDataJava
@DataProvider(name="test-data-java") public Object[][] provideTestDataJava()
-
testJodaTime
public void testJodaTime(net.shibboleth.idp.profile.logic.DateAttributePredicate predicate, String attribute, String[] values, boolean expected) throws Exception- Throws:
Exception
-
testJavaTime
public void testJavaTime(net.shibboleth.idp.profile.logic.DateAttributePredicate predicate, String attribute, String[] values, boolean expected) throws Exception- Throws:
Exception
-
createProfileRequestContext
private ProfileRequestContext createProfileRequestContext(String name, String[] values)
-
jodaDateStrings
private String[] jodaDateStrings(Duration... offsets)
Produces an array of date strings that are offsets from current system time.- Parameters:
offsets- One or more durations that are added to the current system time.- Returns:
- Array of date strings, one for each provided offset.
-
javaDateStrings
private String[] javaDateStrings(Duration... offsets)
Produces an array of date strings that are offsets from current system time.- Parameters:
offsets- One or more durations that are added to the current system time.- Returns:
- Array of date strings, one for each provided offset.
-
newJodaPredicate
private net.shibboleth.idp.profile.logic.DateAttributePredicate newJodaPredicate(String attribute, Duration offset)
-
-