Do not emit warning when StatePointer.isResolved = false

The warning is misleading because it is emitted in the case where the
ServiceHub reference is not null but one or more state pointers were
configured to not be automatically resolved by the transaction
builder.
This commit is contained in:
Ulrik Rasmussen 2022-04-28 11:35:33 +02:00
parent bc6a6ee2ae
commit af1dbf4c6d

View File

@ -741,9 +741,11 @@ open class TransactionBuilder(
addReferenceState(resolvedStateAndRef.referenced()) addReferenceState(resolvedStateAndRef.referenced())
} }
} else { } else {
log.warn("WARNING: You must pass in a ServiceHub reference to TransactionBuilder to resolve " + if (nextStatePointer.isResolved) {
"state pointers outside of flows. If you are writing a unit test then pass in a " + log.warn("WARNING: You must pass in a ServiceHub reference to TransactionBuilder to resolve " +
"MockServices instance.") "state pointers outside of flows. If you are writing a unit test then pass in a " +
"MockServices instance.")
}
return return
} }
} }