/** * @return A multi-line format relying on indenting and bullet points to display the structure (YAML-style). * Object and array delimiters are not shown. */ public static ToStringStyle multilineIndentStructure(String nameValueSeparator, String indentInObject, String indentInListBulletPoint, String indentInListNoBulletPoint) { return new ToStringStyle( "\n", "", nameValueSeparator, "", "", indentInObject, "", "", indentInListBulletPoint, indentInListNoBulletPoint, true ); }
public ToStringTreeBuilder() { this( ToStringStyle.inlineDelimiterStructure() ); }
public ToStringTreeAppendableMultilineFormatter(ToStringTreeAppendable appendable) { this.stringRepresentation = new ToStringTreeBuilder( ToStringStyle.multilineDelimiterStructure() ).value( appendable ).toString(); }
private String renderFailures() { ToStringStyle style = ToStringStyle.multilineIndentStructure( ENGINE_MESSAGES.failureReportContextFailuresSeparator(), ENGINE_MESSAGES.failureReportContextIndent(), ENGINE_MESSAGES.failureReportFailuresBulletPoint(), ENGINE_MESSAGES.failureReportFailuresNoBulletPoint() ); ToStringTreeBuilder builder = new ToStringTreeBuilder( style ); if ( delegate != null ) { delegate.appendFailuresTo( builder ); } return builder.toString(); }
public StubTreeNodeAssert<T> matches(T expected) { Map<String, StubTreeNodeMismatch> mismatchesByPath = StubTreeNodeCompare.compare( expected, actual ); if ( !mismatchesByPath.isEmpty() ) { ToStringTreeBuilder builder = new ToStringTreeBuilder( ToStringStyle.multilineDelimiterStructure() ); builder.startObject(); StubTreeNodeCompare.appendTo( builder, mismatchesByPath ); builder.endObject(); Assert.fail( messageBase + builder.toString() ); } return this; } }
private String renderFailures() { ToStringStyle style = ToStringStyle.multilineIndentStructure( ENGINE_MESSAGES.failureReportContextFailuresSeparator(), ENGINE_MESSAGES.failureReportContextIndent(), ENGINE_MESSAGES.failureReportFailuresBulletPoint(), ENGINE_MESSAGES.failureReportFailuresNoBulletPoint() ); ToStringTreeBuilder builder = new ToStringTreeBuilder( style ); if ( delegate != null ) { delegate.appendFailuresTo( builder ); } return builder.toString(); }
public StubIndexWorkAssert matches(StubIndexWork expected) { ToStringTreeBuilder builder = new ToStringTreeBuilder( ToStringStyle.multilineDelimiterStructure() ); builder.startObject(); boolean hasAnyMismatch; boolean mismatch = checkForMismatch( builder, "type", expected.getType(), actual.getType() ); hasAnyMismatch = mismatch; mismatch = checkForMismatch( builder, "tenantIdentifier", expected.getTenantIdentifier(), actual.getTenantIdentifier() ); hasAnyMismatch = hasAnyMismatch || mismatch; mismatch = checkForMismatch( builder, "identifier", expected.getIdentifier(), actual.getIdentifier() ); hasAnyMismatch = hasAnyMismatch || mismatch; mismatch = checkForMismatch( builder, "routingKey", expected.getRoutingKey(), actual.getRoutingKey() ); hasAnyMismatch = hasAnyMismatch || mismatch; Map<String, StubTreeNodeMismatch> documentMismatches = StubTreeNodeCompare.compare( expected.getDocument(), actual.getDocument() ); if ( !documentMismatches.isEmpty() ) { hasAnyMismatch = true; builder.startObject( "document" ); StubTreeNodeCompare.appendTo( builder, documentMismatches ); builder.endObject(); } builder.endObject(); if ( hasAnyMismatch ) { Assert.fail( messageBase + builder.toString() ); } return this; }