本文整理汇总了Java中org.assertj.core.util.Strings.isNullOrEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Strings.isNullOrEmpty方法的具体用法?Java Strings.isNullOrEmpty怎么用?Java Strings.isNullOrEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.assertj.core.util.Strings
的用法示例。
在下文中一共展示了Strings.isNullOrEmpty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAuthHeader
import org.assertj.core.util.Strings; //导入方法依赖的package包/类
private String getAuthHeader(){
if(Strings.isNullOrEmpty(jwtToken)){
return authHeader.get();
}
else {
return "Bearer " + jwtToken;
}
}
示例2: oauth1aGetRequest
import org.assertj.core.util.Strings; //导入方法依赖的package包/类
private static HttpRequestBase oauth1aGetRequest(String path, OAuth1aToken oAuth1aToken) {
HttpGet request = new HttpGet(server.uri(path));
StringBuilder authorization = new StringBuilder("OAuth ");
String realm = oAuth1aToken.realm();
if (!Strings.isNullOrEmpty(realm)) {
authorization.append("realm=\"");
authorization.append(realm);
authorization.append("\",");
}
authorization.append("oauth_consumer_key=\"");
authorization.append(oAuth1aToken.consumerKey());
authorization.append("\",oauth_token=\"");
authorization.append(oAuth1aToken.token());
authorization.append("\",oauth_signature_method=\"");
authorization.append(oAuth1aToken.signatureMethod());
authorization.append("\",oauth_signature=\"");
authorization.append(oAuth1aToken.signature());
authorization.append("\",oauth_timestamp=\"");
authorization.append(oAuth1aToken.timestamp());
authorization.append("\",oauth_nonce=\"");
authorization.append(oAuth1aToken.nonce());
authorization.append("\",version=\"");
authorization.append(oAuth1aToken.version());
authorization.append('"');
for (Entry<String, String> entry : oAuth1aToken.additionals().entrySet()) {
authorization.append("\",");
authorization.append(entry.getKey());
authorization.append("=\"");
authorization.append(entry.getValue());
authorization.append('"');
}
request.addHeader("Authorization", authorization.toString());
return request;
}
示例3: navigationDescription
import org.assertj.core.util.Strings; //导入方法依赖的package包/类
/**
* Build a string representing a navigation from given assert to given property name.
*/
static String navigationDescription(AbstractAssert<?, ?> as, String propertyName) {
String text = as.descriptionText();
if (Strings.isNullOrEmpty(text)) {
text = removeAssert(as.getClass().getSimpleName());
}
return text + " " + propertyName;
}
示例4: should
import org.assertj.core.util.Strings; //导入方法依赖的package包/类
@Then("^(once finished, )?the last command output should (contain|be|equal to|satisfy|partially satisfy):$")
public void assertLastCommandOutputVerifies(String onceFinished,
String comparator,
String expectedText) throws TimeoutException, InterruptedException, IOException {
Proc proc = procWorld.peekProcess();
if (!Strings.isNullOrEmpty(onceFinished)) {
procWorld.waitTermination(proc);
}
String s = IOUtils.toString(new FileInputStream(proc.getOut()));
StringAssertions.apply(comparator, s, expectedText);
}
示例5: navigationDescription
import org.assertj.core.util.Strings; //导入方法依赖的package包/类
protected String navigationDescription(String propertyName) {
String text = descriptionText();
if (Strings.isNullOrEmpty(text)) {
text = removeAssert(this.getClass().getSimpleName());
}
return text + " " + propertyName;
}
示例6: setupActual
import org.assertj.core.util.Strings; //导入方法依赖的package包/类
@Before
public void setupActual() {
AnotherMethodsClass m = new AnotherMethodsClass();
Strings.isNullOrEmpty(m.string); // causes a synthetic method in AnotherMethodsClass
actual = AnotherMethodsClass.class;
}