@Test
public void getCandidates() throws IOException {

    String responseBody = ContractTestHelper.loadFile(
            "/responses/invokefunction_getcandidates.json");
    WireMock.stubFor(post(urlEqualTo("/"))
            .withRequestBody(new RegexPattern(""
                    + ".*\"method\":\"invokefunction\""
                    + ".*\"params\":"
                    + ".*\"de5f57d430d3dece511cf975a8d37848cb9e0525\"" // neo contract
                    + ".*\"getCandidates\".*" // function
            ))
            .willReturn(aResponse()
                    .withStatus(200)
                    .withBody(responseBody)));
    Map<ECPublicKey, Integer> result = new NeoToken(neow).getCandidates();
    assertThat(result.keySet(), contains(
            new ECPublicKey(Numeric.hexStringToByteArray(
                    "02200284598c6c1117f163dd938a4c8014cf2cf1164c4b7197f347109db50eae7c")),
            new ECPublicKey(Numeric.hexStringToByteArray(
                    "02c0b60c995bc092e866f15a37c176bb59b7ebacf069ba94c0ebf561cb8f956238"))
    ));
    assertThat(result.values(), contains(100, 49999900));
}