@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("Unknown field '%s'", fieldName); } };
public InvocationException(Throwable cause, String format, Object... args) { super(StringUtils.format(format, args), cause); } }
@Override public String getHttpEndPoint(String conversationId) { return StringUtils.format("/conversations/%s/app_release", conversationId); }
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') equal to '%s'", fieldName, first, second); } },
@Override public String description(String fieldName, Comparable first, Comparable second) { return StringUtils.format("%s ('%s') is greater than or equal to '%s'", fieldName, first, second); } },
@Override public String toString() { return StringUtils.format("recipients=%s restored=%s", Arrays.toString(emailRecipients), Boolean.toString(restored)); } }
@Override public String toString() { return StringUtils.format("%s: versionName=%s versionCode=%d targetSdkVersion=%s debuggable=%b", getClass().getSimpleName(), versionName, versionCode, targetSdkVersion, debuggable); } }
@Override public String description(String fieldName, Comparable first, Comparable second) { if (!(second instanceof BigDecimal)) { return StringUtils.format("%s ('%s') before date '%s'", fieldName, toPrettyDate(first), toPrettyDate(second)); } Double offset = ((BigDecimal) second).doubleValue(); Double currentTime = Util.currentTimeSeconds(); return StringUtils.format("%s ('%s') before date '%s'", fieldName, toPrettyDate(first), toPrettyDate(currentTime + offset)); } },
/** * General failure with a message */ public static void assertFail(String format, Object... args) { assertFail(StringUtils.format(format, args)); }
@Override public String toString() { return StringUtils.format("KeyInfo: alias=%s versionCode=%d", hideIfSanitized(alias), versionCode); } }
public IndentPrinter print(String format, Object... args) { String message = indentBuffer + StringUtils.format(format, args); printInternal(message); return this; }
/** * Asserts that an object is <code>null</code> */ public static void assertNull(Object object) { if (imp != null && object != null) { imp.assertFailed(StringUtils.format("Expected 'null' but was '%s'", object)); } }
@Override public String toString() { return StringUtils.format("%s: id=%s limited=%b", getClass().getSimpleName(), ApptentiveLog.hideIfSanitized(id), limitAdTrackingEnabled); }
/** * Asserts that condition is <code>true</code> */ public static void assertTrue(boolean condition, String format, Object... args) { if (imp != null && !condition) { imp.assertFailed(StringUtils.format(format, args)); } }
/** * Asserts that code executes on the main thread. */ public static void assertMainThread() { if (imp != null && !DispatchQueue.isMainQueue()) { imp.assertFailed(StringUtils.format("Expected 'main' thread but was '%s'", Thread.currentThread().getName())); } }
public static void assertDispatchQueue(@NonNull DispatchQueue queue) { if (imp != null && (queue == null || !queue.isCurrent())) { imp.assertFailed(StringUtils.format("Expected '%s' queue but was '%s'", queue != null ? queue.getName() : "<missing queue>", Thread.currentThread().getName())); } }
public static void assertNotEquals(Object first, Object second) { if (imp != null && ObjectUtils.equal(first, second)) { imp.assertFailed(StringUtils.format("Expected '%s' and '%s' to differ, but they are the same.", first, second)); } }
public static void assertEquals(Object expected, Object actual) { if (imp != null && !ObjectUtils.equal(expected, actual)) { imp.assertFailed(StringUtils.format("Expected '%s' but was '%s'", expected, actual)); } }
public MockPayload(String key, Object value) { super(PayloadType.unknown, "nonce", "conversationId", new byte[0], "authToken", "contentType", "path", HttpRequestMethod.GET, false); // TODO: figure out a better type json = StringUtils.format("{'%s':'%s'}", key, value); responseHandler = new DefaultResponseHandler(); }
@Override public String toString() { return StringUtils.format("Conversation: localId=%s id=%s state=%s token=%s", getLocalIdentifier(), getConversationId(), getState(), hideIfSanitized(getConversationToken())); } }