org.openid4java.message.Message.hasExtension()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(355)

本文整理了Java中org.openid4java.message.Message.hasExtension()方法的一些代码示例,展示了Message.hasExtension()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.hasExtension()方法的具体详情如下:
包路径:org.openid4java.message.Message
类名称:Message
方法名:hasExtension

Message.hasExtension介绍

[英]Returns true if the message has parameters for the specified extension type URI.
[中]如果消息具有指定扩展类型URI的参数,则返回true。

代码示例

代码示例来源:origin: spring-projects/spring-security

  1. || !authSuccess.hasExtension(AxMessage.OPENID_NS_AX)) {
  2. return Collections.emptyList();

代码示例来源:origin: spring-projects/spring-security

  1. @Test
  2. public void fetchAttributesReturnsExpectedValues() throws Exception {
  3. OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(
  4. new NullAxFetchListFactory());
  5. Message msg = mock(Message.class);
  6. FetchResponse fr = mock(FetchResponse.class);
  7. when(msg.hasExtension(AxMessage.OPENID_NS_AX)).thenReturn(true);
  8. when(msg.getExtension(AxMessage.OPENID_NS_AX)).thenReturn(fr);
  9. when(fr.getAttributeValues("a")).thenReturn(Arrays.asList("x", "y"));
  10. List<OpenIDAttribute> fetched = consumer.fetchAxAttributes(msg, attributes);
  11. assertThat(fetched).hasSize(1);
  12. assertThat(fetched.get(0).getValues()).hasSize(2);
  13. }

代码示例来源:origin: spring-projects/spring-security

  1. @Test(expected = OpenIDConsumerException.class)
  2. public void messageExceptionFetchingAttributesRaisesOpenIDException()
  3. throws Exception {
  4. OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(
  5. new NullAxFetchListFactory());
  6. Message msg = mock(Message.class);
  7. FetchResponse fr = mock(FetchResponse.class);
  8. when(msg.hasExtension(AxMessage.OPENID_NS_AX)).thenReturn(true);
  9. when(msg.getExtension(AxMessage.OPENID_NS_AX))
  10. .thenThrow(new MessageException(""));
  11. when(fr.getAttributeValues("a")).thenReturn(Arrays.asList("x", "y"));
  12. consumer.fetchAxAttributes(msg, attributes);
  13. }

代码示例来源:origin: org.springframework.security/spring-security-openid

  1. || !authSuccess.hasExtension(AxMessage.OPENID_NS_AX)) {
  2. return Collections.emptyList();

代码示例来源:origin: org.openid4java/openid4java-nodeps

  1. if (hasExtension(extensionTypeUri))

代码示例来源:origin: jbufu/openid4java

  1. if (hasExtension(extensionTypeUri))

代码示例来源:origin: be.fedict.eid-idp/eid-idp-sp-protocol-openid

  1. if (authResponse.hasExtension(AxMessage.OPENID_NS_AX)) {
  2. if (authResponse.hasExtension(PapeResponse.OPENID_NS_PAPE)) {

代码示例来源:origin: org.openid4java/openid4java

  1. if (hasExtension(extensionTypeUri))

代码示例来源:origin: com.cloudbees/openid4java-shaded

  1. if (hasExtension(extensionTypeUri))

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

  1. ParameterList extension = new ParameterList();
  2. if (hasExtension(extensionTypeUri)) {
  3. String extensionAlias = getExtensionAlias(extensionTypeUri);

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

  1. String typeUri = extension.getTypeUri();
  2. if (hasExtension(typeUri)) {
  3. throw new MessageException("Extension already present: " + typeUri);

代码示例来源:origin: org.openid4java/openid4java

  1. if (hasExtension(typeUri))
  2. throw new MessageException("Extension already present: " + typeUri);

代码示例来源:origin: org.openid4java/openid4java-nodeps

  1. if (hasExtension(typeUri))
  2. throw new MessageException("Extension already present: " + typeUri);

代码示例来源:origin: jbufu/openid4java

  1. if (hasExtension(typeUri))
  2. throw new MessageException("Extension already present: " + typeUri);

代码示例来源:origin: com.cloudbees/openid4java-shaded

  1. if (hasExtension(typeUri))
  2. throw new MessageException("Extension already present: " + typeUri);

相关文章