Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<version>4.12</version>
</dependency>
<dependency>
<groupId>jdom</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/org/openid4java/message/ax/FetchResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ else if (value instanceof List)
// only send up the the maximum requested number
int max = req.getCount(alias);
if (max == 0)
max = ((List)values).size();
max = ((List)value).size();
int count;
for (count = 0; count < max && values.hasNext(); count++)
{
Expand Down
32 changes: 32 additions & 0 deletions test/src/org/openid4java/message/ax/FetchResponseTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.openid4java.message.ax;

import static org.junit.Assert.assertEquals;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.junit.Test;
import org.openid4java.message.MessageException;
import org.openid4java.message.Parameter;
import org.openid4java.message.ParameterList;

public class FetchResponseTest
{
@Test
public void unlimitedCountWorksForLists() throws MessageException
{
ParameterList params = new ParameterList();
params.set(new Parameter("required", "key"));
params.set(new Parameter("count.key", "unlimited"));

FetchRequest req = new FetchRequest(params);

Map<String, List<String>> userData = Collections.singletonMap("key", Collections.singletonList("value"));

FetchResponse response = FetchResponse.createFetchResponse(req, userData);

assertEquals(Collections.singletonList("value"),
response.getAttributeValues("key"));
}
}