mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +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
|
@Test
|
||||||
public void testPreferences() throws Exception {
|
public void testPreferences() throws Exception {
|
||||||
|
|
||||||
ePersonService.addMetadata(context, eperson, "dspace", "agreements", "end-user", null, "test");
|
String cookies =
|
||||||
ePersonService.addMetadata(context, eperson, "dspace", "agreements", "cookies", null,
|
"{" +
|
||||||
"Dspace cookies agreement metadata");
|
"\"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();
|
context.commit();
|
||||||
|
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"test",
|
cookies,
|
||||||
ePersonService.getMetadataFirstValue(eperson, "dspace", "agreements", "end-user", null)
|
ePersonService.getMetadataFirstValue(eperson, "dspace", "agreements", "cookies", null)
|
||||||
);
|
);
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"Dspace cookies agreement metadata",
|
"true",
|
||||||
ePersonService.getMetadataFirstValue(eperson, "dspace", "agreements", "cookies", null)
|
ePersonService.getMetadataFirstValue(eperson, "dspace", "agreements", "end-user", null)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -20,14 +20,14 @@
|
|||||||
<schema>dspace</schema>
|
<schema>dspace</schema>
|
||||||
<element>agreements</element>
|
<element>agreements</element>
|
||||||
<qualifier>end-user</qualifier>
|
<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>
|
||||||
|
|
||||||
<dc-type>
|
<dc-type>
|
||||||
<schema>dspace</schema>
|
<schema>dspace</schema>
|
||||||
<element>agreements</element>
|
<element>agreements</element>
|
||||||
<qualifier>cookies</qualifier>
|
<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>
|
</dc-type>
|
||||||
|
|
||||||
</dspace-dc-types>
|
</dspace-dc-types>
|
||||||
|
Reference in New Issue
Block a user