@Override public void verify(final Node node) { assertThat(node.execute(transaction)).isNotBlank(); } }
@Property(shrinking = ShrinkingMode.OFF) @Report(Reporting.GENERATED) void aPersonsNameIsNeverEmpty(@ForAll("people") Person aPerson) { Assertions.assertThat(aPerson.toString()).isNotBlank(); }
assertThat(transactionReceipt.getBlockHash()).isNotBlank(); assertThat(transactionReceipt.getTransactionHash()).isNotBlank(); assertThat(transactionReceipt.getTransactionIndex()).isNotNull(); assertThat(transactionReceipt.getTransactionHash()).isNotNull();
@Property(shrinking = ShrinkingMode.OFF) @Report(Reporting.GENERATED) @Domain(People.class) void aPersonsNameIsNeverEmpty2(@ForAll Person aPerson) { Assertions.assertThat(aPerson.toString()).isNotBlank(); }
private static void assertSedesWorks(final byte[] data) { final BytesValue input = BytesValue.wrap(data); final PeerInfo peerInfo = PeerInfo.readFrom(RLP.input(input)); assertThat(peerInfo.getClientId()).isNotBlank(); assertThat(peerInfo.getCapabilities()).isNotEmpty(); assertThat(peerInfo.getNodeId().extractArray().length).isEqualTo(64); assertThat(peerInfo.getPort()).isGreaterThanOrEqualTo(0); assertThat(peerInfo.getVersion()).isEqualTo(5); // Re-serialize and check that data matches final BytesValueRLPOutput out = new BytesValueRLPOutput(); peerInfo.writeTo(out); assertThat(out.encoded()).isEqualTo(input); } }
@Test public void shouldCreateCustomer() throws Exception { final ObjectMapper mapper = new ObjectMapper(); final CustomerDTO customerDTO = CustomerDTOFactory.customer(customer()); final String json = mapper.writeValueAsString(customerDTO); final ResultActions result = mvc.perform(post(API_CUSTOMERS_PATH).contentType(MediaTypes.APPLICATION_JSON_V1) .accept(MediaTypes.APPLICATION_JSON_V1) .content(json)) .andExpect(status().isCreated()); final String locationHeader = result.andReturn().getResponse().getHeader("Location"); assertThat(locationHeader).isNotBlank(); assertThat(locationHeader).endsWith(API_CUSTOMERS_PATH); }
@Test public void shouldDeleteCustomer() throws Exception { final String uri = API_CUSTOMERS_PATH + "/123"; final ResultActions result = mvc.perform(delete(uri).accept(MediaTypes.APPLICATION_JSON_V1)) .andExpect(status().isOk()); final String locationHeader = result.andReturn().getResponse().getHeader("Location"); assertThat(locationHeader).isNotBlank(); assertThat(locationHeader).endsWith(API_CUSTOMERS_PATH); } }
@Test public void shouldUpdateCustomer() throws Exception { final ObjectMapper mapper = new ObjectMapper(); final CustomerDTO customerDTO = CustomerDTOFactory.customer(customer()); final String json = mapper.writeValueAsString(customerDTO); final String uri = API_CUSTOMERS_PATH + "/123"; final ResultActions result = mvc.perform(put(uri).contentType(MediaTypes.APPLICATION_JSON_V1) .accept(MediaTypes.APPLICATION_JSON_V1) .content(json)) .andExpect(status().isOk()); final String locationHeader = result.andReturn().getResponse().getHeader("Location"); assertThat(locationHeader).isNotBlank(); assertThat(locationHeader).endsWith(API_CUSTOMERS_PATH); }