SEC-2781: Remove deprecations
This commit is contained in:
@@ -62,27 +62,6 @@ public class OpenID4JavaConsumer implements OpenIDConsumer {
|
||||
this(new ConsumerManager(), new NullAxFetchListFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use the {@link AxFetchListFactory} version instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public OpenID4JavaConsumer(List<OpenIDAttribute> attributes) throws ConsumerException {
|
||||
this(new ConsumerManager(), attributes);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public OpenID4JavaConsumer(ConsumerManager consumerManager, final List<OpenIDAttribute> attributes)
|
||||
throws ConsumerException {
|
||||
this.consumerManager = consumerManager;
|
||||
this.attributesToFetchFactory = new AxFetchListFactory() {
|
||||
private final List<OpenIDAttribute> fetchAttrs = Collections.unmodifiableList(attributes);
|
||||
|
||||
public List<OpenIDAttribute> createAttributeList(String identifier) {
|
||||
return fetchAttrs;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public OpenID4JavaConsumer(AxFetchListFactory attributesToFetchFactory) throws ConsumerException {
|
||||
this(new ConsumerManager(), attributesToFetchFactory);
|
||||
}
|
||||
|
||||
+8
-3
@@ -39,7 +39,7 @@ public class OpenID4JavaConsumerTests {
|
||||
when(mgr.authenticate(any(DiscoveryInformation.class), anyString(), anyString())).thenReturn(authReq);
|
||||
when(mgr.associate(anyList())).thenReturn(di);
|
||||
|
||||
OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(mgr, attributes);
|
||||
OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(mgr, new MockAttributesFactory());
|
||||
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
consumer.beginConsumption(request, "", "", "");
|
||||
@@ -195,11 +195,16 @@ public class OpenID4JavaConsumerTests {
|
||||
consumer.endConsumption(new MockHttpServletRequest());
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
public void additionalConstructorsWork() throws Exception {
|
||||
new OpenID4JavaConsumer();
|
||||
new OpenID4JavaConsumer(attributes);
|
||||
new OpenID4JavaConsumer(new MockAttributesFactory());
|
||||
}
|
||||
|
||||
private class MockAttributesFactory implements AxFetchListFactory {
|
||||
|
||||
public List<OpenIDAttribute> createAttributeList(String identifier) {
|
||||
return attributes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -45,7 +45,9 @@ public class OpenIDAuthenticationFilterTests {
|
||||
|
||||
@Test
|
||||
public void testFilterOperation() throws Exception {
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", REQUEST_PATH);
|
||||
MockHttpServletRequest req = new MockHttpServletRequest();
|
||||
req.setServletPath(REQUEST_PATH);
|
||||
req.setRequestURI(REQUEST_PATH);
|
||||
req.setServerPort(8080);
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user