当前位置: 首页>>代码示例>>Java>>正文


Java Strings.isNullOrEmpty方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:gchq,项目名称:stroom-stats,代码行数:9,代码来源:StatsApiClient.java

示例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;
}
 
开发者ID:line,项目名称:armeria,代码行数:35,代码来源:HttpAuthServiceTest.java

示例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;
}
 
开发者ID:rpau,项目名称:javalang-compiler,代码行数:11,代码来源:AssertUtil.java

示例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);
}
 
开发者ID:Arnauld,项目名称:bidij,代码行数:14,代码来源:ProcStepdefs.java

示例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;
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:8,代码来源:AbstractIterableAssert.java

示例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;
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:7,代码来源:Classes_assertHasMethods_Test.java


注:本文中的org.assertj.core.util.Strings.isNullOrEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。