Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
fcrepo-http-commons/src/test/java/org/fcrepo/http/commons/domain/MultiPreferTest.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,30 @@ | ||
package org.fcrepo.http.commons.domain; | ||
|
||
import static com.google.common.collect.Sets.newHashSet; | ||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import java.text.ParseException; | ||
|
||
import org.junit.Test; | ||
|
||
|
||
public class MultiPreferTest extends SinglePreferTest { | ||
|
||
@Override | ||
protected SinglePrefer createTestPreferTypeFromHeader(String header) throws ParseException { | ||
return new MultiPrefer(header); | ||
} | ||
|
||
@Test | ||
public void testMultiConstructor() throws ParseException { | ||
SinglePrefer first = new SinglePrefer(); | ||
SinglePrefer second = new SinglePrefer("return=representation"); | ||
SinglePrefer third = new SinglePrefer("handling=strict"); | ||
MultiPrefer testPrefer = new MultiPrefer(newHashSet(first, second, third)); | ||
// check to see that both headers were parsed | ||
assertTrue(testPrefer.hasReturn()); | ||
assertEquals("representation", testPrefer.getReturn().getValue()); | ||
assertTrue(testPrefer.hasHandling()); | ||
} | ||
} |
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