@Test
public void unregisterCandidate() throws IOException {

    setUpWireMockForCall("invokescript", "invokescript_unregistercandidate.json");
    setUpWireMockForCall("getblockcount", "getblockcount_1000.json");
    byte[] pubKeyBytes = account1.getECKeyPair().getPublicKey().getEncoded(true);
    byte[] expectedScript = new ScriptBuilder().contractCall(NEO_TOKEN_SCRIPT_HASH,
            UNREGISTER_CANDIDATE, Arrays.asList(ContractParameter.publicKey(pubKeyBytes)))
            .toArray();
    Wallet w = Wallet.withAccounts(account1);
    TransactionBuilder b = new NeoToken(neow).unregisterCandidate(account1.getECKeyPair().getPublicKey())
            .wallet(w)
            .signers(Signer.global(account1.getScriptHash()));
    assertThat(b.getSigners().get(0).getScriptHash(), is(account1.getScriptHash()));
    assertThat(b.getSigners().get(0).getScopes(), contains(WitnessScope.GLOBAL));
    assertThat(b.getScript(), is(expectedScript));
}