mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
taskid 72455 Cookie Preferences per account - add scope notes and more realistic test value
This commit is contained in:
@@ -81,18 +81,27 @@ public class EPersonTest extends AbstractUnitTest {
|
||||
@Test
|
||||
public void testPreferences() throws Exception {
|
||||
|
||||
ePersonService.addMetadata(context, eperson, "dspace", "agreements", "end-user", null, "test");
|
||||
ePersonService.addMetadata(context, eperson, "dspace", "agreements", "cookies", null,
|
||||
"Dspace cookies agreement metadata");
|
||||
String cookies =
|
||||
"{" +
|
||||
"\"token_item\":true," +
|
||||
"\"impersonation\":true," +
|
||||
"\"redirect\":true," +
|
||||
"\"language\":true," +
|
||||
"\"klaro\":true," +
|
||||
"\"google-analytics\":false" +
|
||||
"}";
|
||||
|
||||
ePersonService.addMetadata(context, eperson, "dspace", "agreements", "cookies", null, cookies);
|
||||
ePersonService.addMetadata(context, eperson, "dspace", "agreements", "end-user", null, "true");
|
||||
context.commit();
|
||||
|
||||
assertEquals(
|
||||
"test",
|
||||
ePersonService.getMetadataFirstValue(eperson, "dspace", "agreements", "end-user", null)
|
||||
cookies,
|
||||
ePersonService.getMetadataFirstValue(eperson, "dspace", "agreements", "cookies", null)
|
||||
);
|
||||
assertEquals(
|
||||
"Dspace cookies agreement metadata",
|
||||
ePersonService.getMetadataFirstValue(eperson, "dspace", "agreements", "cookies", null)
|
||||
"true",
|
||||
ePersonService.getMetadataFirstValue(eperson, "dspace", "agreements", "end-user", null)
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -20,14 +20,14 @@
|
||||
<schema>dspace</schema>
|
||||
<element>agreements</element>
|
||||
<qualifier>end-user</qualifier>
|
||||
<scope_note></scope_note>
|
||||
<scope_note>Stores whether the End User Agreement has been accepted by an EPerson. Valid values; true, false</scope_note>
|
||||
</dc-type>
|
||||
|
||||
<dc-type>
|
||||
<schema>dspace</schema>
|
||||
<element>agreements</element>
|
||||
<qualifier>cookies</qualifier>
|
||||
<scope_note></scope_note>
|
||||
<scope_note>Stores the cookie preferences of an EPerson, as selected in last session. Value will be an array of cookieName/boolean pairs, specifying which cookies are allowed or not allowed.</scope_note>
|
||||
</dc-type>
|
||||
|
||||
</dspace-dc-types>
|
||||
|
Reference in New Issue
Block a user