Java Code Examples for org.gluu.oxauth.client.RegisterRequest#setAdditionalAudience()

The following examples show how to use org.gluu.oxauth.client.RegisterRequest#setAdditionalAudience() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JsonApplierTest.java    From oxAuth with MIT License 5 votes vote down vote up
@Test
public void apply_forListAndJSONObjectAsTarget_shouldTransferPropertyToTarget() {
    RegisterRequest request = new RegisterRequest();
    request.setAdditionalAudience(Lists.newArrayList("aud1", "aud2"));

    JSONObject target = new JSONObject();

    JsonApplier.getInstance().apply(request, target);

    assertEquals(new JSONArray(Lists.newArrayList("aud1", "aud2")), target.getJSONArray("additional_audience"));
}
 
Example 2
Source File: JsonApplierTest.java    From oxAuth with MIT License 5 votes vote down vote up
@Test
public void apply_forListAndMapAsTarget_shouldTransferPropertyToTarget() {
    RegisterRequest request = new RegisterRequest();
    request.setAdditionalAudience(Lists.newArrayList("aud1", "aud2"));

    Map<String, String> target = new HashMap<>();

    JsonApplier.getInstance().apply(request, target);

    assertEquals(new JSONArray(Lists.newArrayList("aud1", "aud2")).toString(), target.get("additional_audience"));
}
 
Example 3
Source File: JsonApplierServerTest.java    From oxAuth with MIT License 5 votes vote down vote up
@Test
public void transfer_fromRegisterRequestToClientAttribute_withListOfString_shouldTransferValueCorrectly() {
    RegisterRequest request = new RegisterRequest();
    request.setAdditionalAudience(Lists.newArrayList("aud1", "aud2"));

    ClientAttributes attributes = new ClientAttributes();

    JsonApplier.getInstance().transfer(request, attributes);

    assertEquals(Lists.newArrayList("aud1", "aud2"), attributes.getAdditionalAudience());
}