/** * Creates a matcher of {@link String} that matches when the examined string has zero length. * <p/> * For example: * <pre>assertThat("", isEmptyString())</pre> */ public static org.hamcrest.Matcher<java.lang.String> isEmptyString() { return org.hamcrest.text.IsEmptyString.isEmptyString(); }
/** * Creates a matcher of {@link String} that matches when the examined string has zero length. * For example: * <pre>assertThat("", isEmptyString())</pre> * * @deprecated use is(emptyString()) instead */ @SuppressWarnings("deprecation") public static Matcher<java.lang.String> isEmptyString() { return org.hamcrest.text.IsEmptyString.isEmptyString(); }
public void isEmpty() { verifyUsingMatcher(IsEmptyString.isEmptyString()); }
@Test public void testGrammar() throws UnsupportedEncodingException { for (File swiftFile : swiftFiles) { ByteArrayOutputStream errContent = new ByteArrayOutputStream(); System.setErr(new PrintStream(errContent, false, Charset.defaultCharset().name())); String[] command = { "--debug", (TEST_INPUT_DIR + swiftFile.getName()) }; Tailor.main(command); assertThat(errContent.toString(Charset.defaultCharset().name()), IsEmptyString.isEmptyString()); System.setErr(null); } }
@SuppressWarnings("unchecked") private void assertCommonClientAccessTokenProperties(OAuth2AccessToken accessToken) { assertThat(accessToken, allOf(clientId(is(CLIENT_ID)), userId(is(nullValue())), subject(is(CLIENT_ID)), username(is(nullValue())), cid(is(CLIENT_ID)), scope(is(tokenSupport.clientScopes)), audience(is(tokenSupport.resourceIds)), jwtId(not(isEmptyString())), issuedAt(is(greaterThan(0))), expiry(is(greaterThan(0))))); }
@SuppressWarnings("unchecked") private void assertCommonUserRefreshTokenProperties(OAuth2RefreshToken refreshToken) { assertThat(refreshToken, allOf(/*issuer(is(issuerUri)),*/ OAuth2RefreshTokenMatchers.username(is(tokenSupport.username)), OAuth2RefreshTokenMatchers.clientId(is(CLIENT_ID)), OAuth2RefreshTokenMatchers.subject(is(not(nullValue()))), OAuth2RefreshTokenMatchers.audience(is(tokenSupport.resourceIds)), OAuth2RefreshTokenMatchers.origin(is(OriginKeys.UAA)), OAuth2RefreshTokenMatchers.revocationSignature(is(not(nullValue()))), OAuth2RefreshTokenMatchers.jwtId(not(isEmptyString())), OAuth2RefreshTokenMatchers.issuedAt(is(greaterThan(0))), OAuth2RefreshTokenMatchers.expiry(is(greaterThan(0))) ) ); }
@SuppressWarnings({"unused", "unchecked"}) private void assertCommonUserAccessTokenProperties(OAuth2AccessToken accessToken, String clientId) { assertThat(accessToken, allOf(username(is(tokenSupport.username)), clientId(is(clientId)), subject(is(tokenSupport.userId)), audience(is(tokenSupport.resourceIds)), origin(is(OriginKeys.UAA)), revocationSignature(is(not(nullValue()))), cid(is(clientId)), userId(is(tokenSupport.userId)), email(is(tokenSupport.email)), jwtId(not(isEmptyString())), issuedAt(is(greaterThan(0))), expiry(is(greaterThan(0))) )); }
/** * Creates a matcher of {@link String} that matches when the examined string has zero length. * For example: * <pre>assertThat("", isEmptyString())</pre> * * @deprecated use is(emptyString()) instead */ public static org.hamcrest.Matcher<java.lang.String> isEmptyString() { return org.hamcrest.text.IsEmptyString.isEmptyString(); }
/** * Creates a matcher of {@link String} that matches when the examined string has zero length. * For example: * <pre>assertThat("", isEmptyString())</pre> * * @deprecated use is(emptyString()) instead */ @SuppressWarnings("deprecation") public static Matcher<java.lang.String> isEmptyString() { return org.hamcrest.text.IsEmptyString.isEmptyString(); }
@Test public void toString_returns_nonEmptyString() throws Exception { assertThat(keyringConfig.toString(), is(not(IsEmptyString.isEmptyString()))); }
@Test public void toString_returns_nonEmptyString() throws Exception { final EncryptionConfig encryptionConfig = Configs.buildConfigForEncryptionFromResources(); assertThat(encryptionConfig.toString(), is(not(IsEmptyString.isEmptyString()))); }
@Test public void nowHasDefaultImplementation() throws Exception { String result = JtwigTemplate.inlineTemplate("{{ date('now','yyyy-MM-dd hh:mm:ss z', 'Europe/Paris') }}") .render(JtwigModel.newModel()); assertThat(result, not(isEmptyString())); }