/** * Tests two strings for non-equality, but gracefully handles nulls. * * @param s1 String 1. * @param s2 String 2. * @return <jk>true</jk> if the strings are not equal. */ public static boolean isNotEquals(String s1, String s2) { return ! isEquals(s1, s2); }
/** * Tests two strings for non-equality, but gracefully handles nulls. * * @param s1 String 1. * @param s2 String 2. * @return <jk>true</jk> if the strings are not equal. */ public static boolean isNotEquals(String s1, String s2) { return ! isEquals(s1, s2); }
/** * Tests two strings for non-equality, but gracefully handles nulls. * * @param s1 String 1. * @param s2 String 2. * @return <jk>true</jk> if the strings are not equal. */ public static boolean isNotEquals(String s1, String s2) { return ! isEquals(s1, s2); }
/** * Returns <jk>true</jk> if the specified section was modified in this list of events. * * @param name The section name. * @return <jk>true</jk> if the specified section was modified in this list of events. */ public boolean isSectionModified(String name) { for (ConfigEvent ce : this) if (isEquals(name, ce.getSection())) return true; return false; }
@Override /* ConfigStore */ public synchronized String write(String name, String expectedContents, String newContents) throws IOException { // This is a no-op. if (isEquals(expectedContents, newContents)) return null; String currentContents = read(name); if (expectedContents != null && ! isEquals(currentContents, expectedContents)) return currentContents; update(name, newContents); return null; }
@Override /* ConfigStore */ public synchronized String write(String name, String expectedContents, String newContents) { // This is a no-op. if (isEquals(expectedContents, newContents)) return null; String currentContents = read(name); if (expectedContents != null && ! isEquals(currentContents, expectedContents)) return currentContents; update(name, newContents); return null; }
/** * Returns <jk>true</jk> if the specified section was modified in this list of events. * * @param name The section name. * @return <jk>true</jk> if the specified section was modified in this list of events. */ public boolean isSectionModified(String name) { for (ConfigEvent ce : this) if (isEquals(name, ce.getSection())) return true; return false; }
@Override /* ConfigStore */ public synchronized String write(String name, String expectedContents, String newContents) throws IOException { // This is a no-op. if (isEquals(expectedContents, newContents)) return null; String currentContents = read(name); if (expectedContents != null && ! isEquals(currentContents, expectedContents)) return currentContents; update(name, newContents); return null; }
/** * Returns <jk>true</jk> if the specified section was modified in this list of events. * * @param name The section name. * @return <jk>true</jk> if the specified section was modified in this list of events. */ public boolean isSectionModified(String name) { for (ConfigEvent ce : this) if (isEquals(name, ce.getSection())) return true; return false; }
@Override /* ConfigStore */ public synchronized String write(String name, String expectedContents, String newContents) { // This is a no-op. if (isEquals(expectedContents, newContents)) return null; String currentContents = read(name); if (expectedContents != null && ! isEquals(currentContents, expectedContents)) return currentContents; update(name, newContents); return null; }
@Override /* ConfigStore */ public synchronized String write(String name, String expectedContents, String newContents) throws IOException { // This is a no-op. if (isEquals(expectedContents, newContents)) return null; String currentContents = read(name); if (expectedContents != null && ! isEquals(currentContents, expectedContents)) return currentContents; update(name, newContents); return null; }
@Override /* ConfigStore */ public synchronized String write(String name, String expectedContents, String newContents) { // This is a no-op. if (isEquals(expectedContents, newContents)) return null; String currentContents = read(name); if (expectedContents != null && ! isEquals(currentContents, expectedContents)) return currentContents; update(name, newContents); return null; }
/** * Throws an {@link AssertionError} if the response does not contain the expected character encoding. * * @param value The expected character encoding. * @return This object (for method chaining). * @throws AssertionError Thrown if the response does not contain the expected character encoding. */ public MockServletResponse assertCharset(String value) { if (! StringUtils.isEquals(value, getCharacterEncoding())) throw new MockAssertionError("Response did not have the expected character encoding.\n\tExpected=[{0}]\n\tActual=[{1}]", value, getBodyAsString()); return this; }
/** * Throws an {@link AssertionError} if the response body does not contain the expected text. * * @param text The expected text of the body. * @return This object (for method chaining). * @throws AssertionError Thrown if the body does not contain the expected text. */ public MockServletResponse assertBody(String text) throws AssertionError { if (! StringUtils.isEquals(text, getBodyAsString())) throw new MockAssertionError("Response did not have the expected text.\n\tExpected=[{0}]\n\tActual=[{1}]", text, getBodyAsString()); return this; }
/** * Throws an {@link AssertionError} if the response does not contain the expected character encoding. * * @param value The expected character encoding. * @return This object (for method chaining). * @throws AssertionError Thrown if the response does not contain the expected character encoding. */ public MockServletResponse assertCharset(String value) { if (! StringUtils.isEquals(value, getCharacterEncoding())) throw new MockAssertionError("Response did not have the expected character encoding.\n\tExpected=[{0}]\n\tActual=[{1}]", value, getBodyAsString()); return this; }
/** * Throws an {@link AssertionError} if the response body does not contain the expected text. * * @param text The expected text of the body. * @return This object (for method chaining). * @throws AssertionError Thrown if the body does not contain the expected text. */ public MockServletResponse assertBody(String text) throws AssertionError { if (! StringUtils.isEquals(text, getBodyAsString())) throw new MockAssertionError("Response did not have the expected text.\n\tExpected=[{0}]\n\tActual=[{1}]", text, getBodyAsString()); return this; }
/** * Throws an {@link AssertionError} if the response body does not contain the expected text. * * @param text The expected text of the body. * @return This object (for method chaining). * @throws AssertionError Thrown if the body does not contain the expected text. */ public MockServletResponse assertBody(String text) throws AssertionError { if (! StringUtils.isEquals(text, getBodyAsString())) throw new MockAssertionError("Response did not have the expected text.\n\tExpected=[{0}]\n\tActual=[{1}]", text, getBodyAsString()); return this; }
/** * Throws an {@link AssertionError} if the response does not contain the expected character encoding. * * @param value The expected character encoding. * @return This object (for method chaining). * @throws AssertionError Thrown if the response does not contain the expected character encoding. */ public MockServletResponse assertCharset(String value) { if (! StringUtils.isEquals(value, getCharacterEncoding())) throw new MockAssertionError("Response did not have the expected character encoding.\n\tExpected=[{0}]\n\tActual=[{1}]", value, getBodyAsString()); return this; }
/** * Throws an {@link AssertionError} if the response does not contain the expected header value. * * @param name The header name. * @param value The expected header value. * @return This object (for method chaining). * @throws AssertionError Thrown if the response does not contain the expected header value. */ public MockServletResponse assertHeader(String name, String value) { if (! StringUtils.isEquals(value, getHeader(name))) throw new MockAssertionError("Response did not have the expected value for header {0}.\n\tExpected=[{1}]\n\tActual=[{2}]", name, value, getHeader(name)); return this; }