本文整理了Java中org.wildfly.common.Assert.assertTrue()
方法的一些代码示例,展示了Assert.assertTrue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.assertTrue()
方法的具体详情如下:
包路径:org.wildfly.common.Assert
类名称:Assert
方法名:assertTrue
[英]Assert that the given expression is always true.
[中]断言给定的表达式始终为真。
代码示例来源:origin: wildfly/wildfly
private void runReadTask() {
Assert.assertTrue(pooledByteBuffer == null);
channel.getReadSetter().set(channelListener);
channel.wakeupReads(); //should just be resume, see UNDERTOW-1192
}
代码示例来源:origin: wildfly/wildfly
public OAuth2InitialClientMessage getInitialResponse() throws AuthenticationMechanismException {
final CredentialCallback credentialCallback = new CredentialCallback(BearerTokenCredential.class);
try {
MechanismUtil.handleCallbacks(log, this.callbackHandler, credentialCallback);
} catch (UnsupportedCallbackException e) {
throw log.mechCallbackHandlerUnsupportedCallback(e);
}
assertTrue(credentialCallback.isCredentialTypeSupported(BearerTokenCredential.class));
final String token = credentialCallback.applyToCredential(BearerTokenCredential.class, BearerTokenCredential::getToken);
if (token == null) {
throw log.mechNoTokenGiven();
}
final ByteStringBuilder encoded = new ByteStringBuilder();
encoded.append("n").append(",");
if (this.authorizationId != null) {
encoded.append('a').append('=');
StringPrep.encode(this.authorizationId, encoded, StringPrep.PROFILE_SASL_STORED | StringPrep.MAP_SCRAM_LOGIN_CHARS);
}
encoded.append(",").append(KV_DELIMITER).append("auth").append("=").append("Bearer").append(" ").append(token).append(KV_DELIMITER);
return new OAuth2InitialClientMessage(null, null, encoded.toArray());
}
代码示例来源:origin: org.wildfly.wildfly-http-client/wildfly-http-client-common
private void runReadTask() {
Assert.assertTrue(pooledByteBuffer == null);
channel.getReadSetter().set(channelListener);
channel.wakeupReads(); //should just be resume, see UNDERTOW-1192
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
private void runReadTask() {
Assert.assertTrue(pooledByteBuffer == null);
channel.getReadSetter().set(channelListener);
channel.wakeupReads(); //should just be resume, see UNDERTOW-1192
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
public OAuth2InitialClientMessage getInitialResponse() throws AuthenticationMechanismException {
final CredentialCallback credentialCallback = new CredentialCallback(BearerTokenCredential.class);
try {
MechanismUtil.handleCallbacks(log, this.callbackHandler, credentialCallback);
} catch (UnsupportedCallbackException e) {
throw log.mechCallbackHandlerUnsupportedCallback(e);
}
assertTrue(credentialCallback.isCredentialTypeSupported(BearerTokenCredential.class));
final String token = credentialCallback.applyToCredential(BearerTokenCredential.class, BearerTokenCredential::getToken);
if (token == null) {
throw log.mechNoTokenGiven();
}
final ByteStringBuilder encoded = new ByteStringBuilder();
encoded.append("n").append(",");
if (this.authorizationId != null) {
encoded.append('a').append('=');
StringPrep.encode(this.authorizationId, encoded, StringPrep.PROFILE_SASL_STORED | StringPrep.MAP_SCRAM_LOGIN_CHARS);
}
encoded.append(",").append(KV_DELIMITER).append("auth").append("=").append("Bearer").append(" ").append(token).append(KV_DELIMITER);
return new OAuth2InitialClientMessage(null, null, encoded.toArray());
}
代码示例来源:origin: org.wildfly.security/wildfly-elytron
public OAuth2InitialClientMessage getInitialResponse() throws AuthenticationMechanismException {
final CredentialCallback credentialCallback = new CredentialCallback(BearerTokenCredential.class);
try {
MechanismUtil.handleCallbacks(log, this.callbackHandler, credentialCallback);
} catch (UnsupportedCallbackException e) {
throw log.mechCallbackHandlerUnsupportedCallback(e);
}
assertTrue(credentialCallback.isCredentialTypeSupported(BearerTokenCredential.class));
final String token = credentialCallback.applyToCredential(BearerTokenCredential.class, BearerTokenCredential::getToken);
if (token == null) {
throw log.mechNoTokenGiven();
}
final ByteStringBuilder encoded = new ByteStringBuilder();
encoded.append("n").append(",");
if (this.authorizationId != null) {
encoded.append('a').append('=');
StringPrep.encode(this.authorizationId, encoded, StringPrep.PROFILE_SASL_STORED | StringPrep.MAP_SCRAM_LOGIN_CHARS);
}
encoded.append(",").append(KV_DELIMITER).append("auth").append("=").append("Bearer").append(" ").append(token).append(KV_DELIMITER);
return new OAuth2InitialClientMessage(null, null, encoded.toArray());
}
代码示例来源:origin: org.wildfly.security/wildfly-elytron-mechanism-oauth2
public OAuth2InitialClientMessage getInitialResponse() throws AuthenticationMechanismException {
final CredentialCallback credentialCallback = new CredentialCallback(BearerTokenCredential.class);
try {
MechanismUtil.handleCallbacks(log, this.callbackHandler, credentialCallback);
} catch (UnsupportedCallbackException e) {
throw log.mechCallbackHandlerUnsupportedCallback(e);
}
assertTrue(credentialCallback.isCredentialTypeSupported(BearerTokenCredential.class));
final String token = credentialCallback.applyToCredential(BearerTokenCredential.class, BearerTokenCredential::getToken);
if (token == null) {
throw log.mechNoTokenGiven();
}
final ByteStringBuilder encoded = new ByteStringBuilder();
encoded.append("n").append(",");
if (this.authorizationId != null) {
encoded.append('a').append('=');
StringPrep.encode(this.authorizationId, encoded, StringPrep.PROFILE_SASL_STORED | StringPrep.MAP_SCRAM_LOGIN_CHARS);
}
encoded.append(",").append(KV_DELIMITER).append("auth").append("=").append("Bearer").append(" ").append(token).append(KV_DELIMITER);
return new OAuth2InitialClientMessage(null, null, encoded.toArray());
}
内容来源于网络,如有侵权,请联系作者删除!