static String buildPrefix(String message) { return (StringUtils.isNotBlank(message) ? message + " ==> " : ""); }
private static String buildSuffix(String message) { return StringUtils.isNotBlank(message) ? ": " + message : ""; }
private ConditionEvaluationException evaluationException(Class<?> conditionType, Exception ex) { String cause = StringUtils.isNotBlank(ex.getMessage()) ? ": " + ex.getMessage() : ""; return new ConditionEvaluationException( format("Failed to evaluate condition [%s]%s", conditionType.getName(), cause), ex); }
private static void throwTestAbortedException(String message) { throw new TestAbortedException( StringUtils.isNotBlank(message) ? ("Assumption failed: " + message) : "Assumption failed"); }
private static ParameterResolutionException parameterResolutionException(String message, Exception cause, ParameterContext parameterContext) { String fullMessage = message + " at index " + parameterContext.getIndex(); if (StringUtils.isNotBlank(cause.getMessage())) { fullMessage += ": " + cause.getMessage(); } return new ParameterResolutionException(fullMessage, cause); }
if (StringUtils.isNotBlank(throwable.getMessage())) { message += ": " + throwable.getMessage();
@Override public String getLegacyReportingName() { String methodName = description.getMethodName(); if (methodName == null) { String className = description.getClassName(); if (isNotBlank(className)) { return className; } } return super.getLegacyReportingName(); }
private Method getMethod(ExtensionContext context, String factoryMethodName) { if (StringUtils.isNotBlank(factoryMethodName)) { if (factoryMethodName.contains("#")) { return getMethodByFullyQualifiedName(factoryMethodName); } else { return getMethod(context.getRequiredTestClass(), factoryMethodName); } } return getMethod(context.getRequiredTestClass(), context.getRequiredTestMethod().getName()); }
parameterContext.getParameter(), asLabel(executable), executable.toGenericString()); if (StringUtils.isNotBlank(throwable.getMessage())) { message += ": " + throwable.getMessage();
private ConditionEvaluationException evaluationException(Class<?> conditionType, Exception ex) { String cause = StringUtils.isNotBlank(ex.getMessage()) ? ": " + ex.getMessage() : ""; return new ConditionEvaluationException( String.format("Failed to evaluate condition [%s]%s", conditionType.getName(), cause), ex); }
private void writeSkippedElement(String reason, XMLStreamWriter writer) throws XMLStreamException { if (isNotBlank(reason)) { writer.writeStartElement("skipped"); writeCDataSafely(writer, reason); writer.writeEndElement(); } else { writer.writeEmptyElement("skipped"); } newLine(writer); }
private void printMessage(Color color, String indent, String message) { String[] lines = message.split("\\R"); out.print(" "); out.print(color(color, lines[0])); if (lines.length > 1) { for (int i = 1; i < lines.length; i++) { out.println(); out.print(indent); if (StringUtils.isNotBlank(lines[i])) { String extra = theme.blank(); out.print(color(color, extra + lines[i])); } } } }
private void lazyLoadJavaMethod() { lazyLoadJavaClass(); if (this.javaMethod == null) { if (StringUtils.isNotBlank(this.methodParameterTypes)) { this.javaMethod = ReflectionUtils.findMethod(this.javaClass, this.methodName, this.methodParameterTypes).orElseThrow( () -> new PreconditionViolationException(String.format( "Could not find method with name [%s] and parameter types [%s] in class [%s].", this.methodName, this.methodParameterTypes, this.javaClass.getName()))); } else { this.javaMethod = ReflectionUtils.findMethod(this.javaClass, this.methodName).orElseThrow( () -> new PreconditionViolationException( String.format("Could not find method with name [%s] in class [%s].", this.methodName, this.javaClass.getName()))); } } }
Integer line = null; Integer column = null; if (StringUtils.isNotBlank(query)) { try { for (String pair : query.split("&")) {
throws MqttException { final boolean hasAuth = isNotBlank(userName) && isNotBlank(password); final boolean hasWill = isNotBlank(willMessage) && isNotBlank(willTopic) && (willQos != null) && (willRetained != null);