<p>These tests create real versions of the supported Payload & Entry types and<br>
run them through the 3 entry points (onMessage, Init, standard add()/remove()/refresh(),<br>
to verify the expected return values, internal state changes, and<br>
external signals (listeners, broadcasts).</p>
<p>The tests are involved and I am proposing future work to make many of the objects<br>
more testable that will greatly reduce the work and tests cases needed.</p>
<p>This work identified a few unexpected scenarios and potential bugs that are addressed<br>
in dependent pull requests.</p>
<p>Code coverage when running P2PDataStorageTest:</p>
<p>Before:<br>
Line: 4%<br>
Branch: 0%</p>
<p>After:<br>
Line: 78%<br>
Branch 76%</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/bisq-network/bisq/pull/3554'>https://github.com/bisq-network/bisq/pull/3554</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>[TESTS] Add tests for P2PDataStorage in order to safely refactor</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3554/files#diff-0">build.gradle</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3554/files#diff-1">core/src/main/java/bisq/core/alert/Alert.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3554/files#diff-2">p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3554/files#diff-3">p2p/src/test/java/bisq/network/p2p/storage/P2PDataStorageTest.java</a>
    (1525)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3554/files#diff-4">p2p/src/test/java/bisq/network/p2p/storage/mocks/AppendOnlyDataStoreServiceFake.java</a>
    (42)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3554/files#diff-5">p2p/src/test/java/bisq/network/p2p/storage/mocks/DateTolerantPayloadStub.java</a>
    (50)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3554/files#diff-6">p2p/src/test/java/bisq/network/p2p/storage/mocks/PersistableNetworkPayloadStub.java</a>
    (43)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3554/files#diff-7">p2p/src/test/java/bisq/network/p2p/storage/mocks/ProtectedDataStoreServiceFake.java</a>
    (45)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/3554.patch'>https://github.com/bisq-network/bisq/pull/3554.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/3554.diff'>https://github.com/bisq-network/bisq/pull/3554.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/3554?email_source=notifications&email_token=AJFFTNSAFLAOYQ5SIKYBIKTQSBSGVA5CNFSM4JIXNDR2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWVXVOA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNVUBBI3HURRZA5CLEDQSBSGVANCNFSM4JIXNDRQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNVDC3JQY37ON2VHRW3QSBSGVA5CNFSM4JIXNDR2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWVXVOA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/3554?email_source=notifications\u0026email_token=AJFFTNSAFLAOYQ5SIKYBIKTQSBSGVA5CNFSM4JIXNDR2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWVXVOA",
"url": "https://github.com/bisq-network/bisq/pull/3554?email_source=notifications\u0026email_token=AJFFTNSAFLAOYQ5SIKYBIKTQSBSGVA5CNFSM4JIXNDR2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWVXVOA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>