Example usage for org.apache.commons.lang3.text StrBuilder trim

List of usage examples for org.apache.commons.lang3.text StrBuilder trim

Introduction

In this page you can find the example usage for org.apache.commons.lang3.text StrBuilder trim.

Prototype

public StrBuilder trim() 

Source Link

Document

Trims the builder by removing characters less than or equal to a space from the beginning and end.

Usage

From source file:gov.usgs.cida.ConsulRegistratorMojoUnitTest.java

@org.junit.Test
public void testBuildScriptContextPathsOnly() {
    String[] contextPaths = { "/wow", "/big", "/time" };
    StrBuilder sb = new StrBuilder();
    sb.append(ConsulRegistratorMojo.URL_COMMAND);
    for (String contextPath : contextPaths) {
        sb.append(NON_CONTEXT_PATH).append(contextPath).append(' ');
    }/*from w w w .  ja va 2 s . c  o  m*/
    sb.trim();

    String expResult = sb.build();

    String result = buildScript(null, contextPaths);
    assertEquals(expResult, result);
    result = buildScript("", contextPaths);
    assertEquals(expResult, result);
}