org.unitils.mock.report.impl
Class DetailedObservedInvocationsReport
java.lang.Object
org.unitils.mock.report.impl.ProxyInvocationsReport
org.unitils.mock.report.impl.ObservedInvocationsReport
org.unitils.mock.report.impl.DetailedObservedInvocationsReport
public class DetailedObservedInvocationsReport
- extends ObservedInvocationsReport
A view that displays the details of the observed invocations. The details include:
- the location where the invocation was invoked
- the mock behavior that was executed
- the location where this mock behavior was defined
Example:
1. mock.method1() -> string1
- string1 -> "1234567891234567890"
- Observed at MyTest.testMethod(MyTest.java:75)
- Behavior defined at MyTest.myTest(MyTest.java:37)
2. mock.method1("value", 4) -> null
- Observed at MyTest.testMethod(MyTest.java:77)
- No behavior defined, returned default value.
- Author:
- Kenny Claes, Filip Neven, Tim Ducheyne
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DetailedObservedInvocationsReport
public DetailedObservedInvocationsReport(Object testedObject)
createReport
public String createReport(List<ObservedInvocation> observedInvocations)
- Creates a string representation of the given scenario as described in the class javadoc.
- Overrides:
createReport
in class ObservedInvocationsReport
- Parameters:
observedInvocations
- The invocations for which to create a report, not null
- Returns:
- The string representation, not null
formatInvokedAt
protected String formatInvokedAt(ProxyInvocation proxyInvocation)
- Creates a string representation of the details of the given invocation. This will give information about
where the invocation occurred.
- Overrides:
formatInvokedAt
in class ProxyInvocationsReport
- Parameters:
proxyInvocation
- The invocation to format, not null
- Returns:
- The string representation, not null
formatBehaviorDetails
protected String formatBehaviorDetails(ObservedInvocation observedInvocation)
- Creates a string representation of the behavior details of the given invocation. This will give information about
where the mock behavior was recorded.
- Parameters:
observedInvocation
- The invocation to format, not null
- Returns:
- The string representation, not null
formatLargeObjects
protected String formatLargeObjects(List<ProxyInvocationsReport.FormattedObject> largeObjects)
- Format the values that were to long to be displayed inline
- Parameters:
largeObjects
- The large value representations, not null
- Returns:
- The string representation, not null
Copyright © 2011. All Rights Reserved.