@Test void canCreateValidJsonString() { final BaseSearchResult searchResult = new BaseSearchResult( UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString() ); final String json = searchResult.toString(); Assertions.assertThatCode(() -> GenieObjectMapper.getMapper().readTree(json)).doesNotThrowAnyException(); }
@Override public String toString() { try { return GenieObjectMapper.getMapper().writeValueAsString(this); } catch (final JsonProcessingException ioe) { return ioe.getLocalizedMessage(); } }
BaseSearchResult implements Serializable { @Override public String toString() { try { return GenieObjectMapper.getMapper().writeValueAsString(this); } catch (final JsonProcessingException ioe) { return ioe.getLocalizedMessage(); } } }
BaseSearchResult implements Serializable { @Override public String toString() { try { return GenieObjectMapper.getMapper().writeValueAsString(this); } catch (final JsonProcessingException ioe) { return ioe.getLocalizedMessage(); } } @JsonCreator  BaseSearchResult(
        @NotBlank @JsonProperty(value = "id", required = true) final String id,
        @NotBlank @JsonProperty(value = "name", required = true) final String name,
        @NotBlank @JsonProperty(value = "user", required = true) final String user
    ); }
BaseSearchResult implements Serializable { @Override public String toString() { try { return GenieObjectMapper.getMapper().writeValueAsString(this); } catch (final JsonProcessingException ioe) { return ioe.getLocalizedMessage(); } } @JsonCreator  BaseSearchResult(
        @NotBlank @JsonProperty(value = "id", required = true) final String id,
        @NotBlank @JsonProperty(value = "name", required = true) final String name,
        @NotBlank @JsonProperty(value = "user", required = true) final String user
    ); @Override String toString(); }
BaseSearchResult implements Serializable { @Override public String toString() { try { return GenieObjectMapper.getMapper().writeValueAsString(this); } catch (final JsonProcessingException ioe) { return ioe.getLocalizedMessage(); } } @JsonCreator  BaseSearchResult(
        @NotBlank @JsonProperty(value = "id", required = true) final String id,
        @NotBlank @JsonProperty(value = "name", required = true) final String name,
        @NotBlank @JsonProperty(value = "user", required = true) final String user
    ); @Override String toString();  }