protected String getInvokedOutOfOrderErrorMessage(ObservedInvocation matchingInvocation, ObservedInvocation outOfOrderInvocation, StackTraceElement assertedAt) { StringBuilder message = new StringBuilder(); message.append("Invocation of "); message.append(getSimpleMethodName(matchingInvocation.getMethod())); message.append(" was expected to be performed after "); message.append(getSimpleMethodName(outOfOrderInvocation.getMethod())); message.append(" but actually occurred before it.\n"); message.append(getAssertLocationIndication(assertedAt)); message.append("\n\n"); message.append(createFullReport()); return message.toString(); }
protected String getAssertInvokedErrorMessage(ProxyInvocation proxyInvocation, StackTraceElement invokedAt) { StringBuilder message = new StringBuilder(); message.append("Expected invocation of "); message.append(getSimpleMethodName(proxyInvocation.getMethod())); message.append(", but it didn't occur.\n"); message.append(getAssertLocationIndication(invokedAt)); message.append("\n\n"); message.append(createFullReport()); return message.toString(); }
protected String getAssertNotInvokedErrorMessage(ProxyInvocation proxyInvocation, ObservedInvocation unexpectedInvocation, StackTraceElement[] assertedAt) { StringBuilder message = new StringBuilder(); message.append("Expected no invocation of "); message.append(getSimpleMethodName(proxyInvocation.getMethod())); message.append(", but it did occur.\nat "); message.append(unexpectedInvocation.getInvokedAt()); message.append("\n"); message.append(getAssertLocationIndication(assertedAt[0])); message.append("\n\n"); message.append(createFullReport()); return message.toString(); }