private static InternalProperty asInternalProperty(DbTester dbTester, DbSession dbSession, String internalPropertyKey) { Map<String, Object> row = dbTester.selectFirst( dbSession, "select" + " is_empty as \"isEmpty\", text_value as \"textValue\", clob_value as \"clobValue\", created_at as \"createdAt\"" + " from internal_properties" + " where kee='" + internalPropertyKey + "'"); return new InternalProperty( isEmpty(row), (String) row.get("textValue"), (String) row.get("clobValue"), (Long) row.get("createdAt")); }
public InternalPropertyAssert hasClobValue(String expected) { isNotNull(); if (!Objects.equals(actual.getClobValue(), expected)) { failWithMessage("Expected Internal property to have column CLOB_VALUE to be <%s> but was <%s>", true, actual.getClobValue()); } if (actual.getTextValue() != null) { failWithMessage("Expected Internal property to have column TEXT_VALUE to be null but was <%s>", actual.getTextValue()); } if (!Objects.equals(actual.isEmpty(), FALSE)) { failWithMessage("Expected Internal property to have column IS_EMPTY to be <%s> but was <%s>", false, actual.isEmpty()); } return this; }
public InternalPropertyAssert hasTextValue(String expected) { isNotNull(); if (!Objects.equals(actual.getTextValue(), expected)) { failWithMessage("Expected Internal property to have column TEXT_VALUE to be <%s> but was <%s>", true, actual.getTextValue()); } if (actual.getClobValue() != null) { failWithMessage("Expected Internal property to have column CLOB_VALUE to be null but was <%s>", actual.getClobValue()); } if (!Objects.equals(actual.isEmpty(), FALSE)) { failWithMessage("Expected Internal property to have column IS_EMPTY to be <%s> but was <%s>", false, actual.isEmpty()); } return this; }
public InternalPropertyAssert isEmpty() { isNotNull(); if (!Objects.equals(actual.isEmpty(), TRUE)) { failWithMessage("Expected Internal property to have column IS_EMPTY to be <%s> but was <%s>", true, actual.isEmpty()); } if (actual.getTextValue() != null) { failWithMessage("Expected Internal property to have column TEXT_VALUE to be null but was <%s>", actual.getTextValue()); } if (actual.getClobValue() != null) { failWithMessage("Expected Internal property to have column CLOB_VALUE to be null but was <%s>", actual.getClobValue()); } return this; }
public InternalPropertyAssert hasCreatedAt(long expected) { isNotNull(); if (!Objects.equals(actual.getCreatedAt(), expected)) { failWithMessage("Expected Internal property to have column CREATED_AT to be <%s> but was <%s>", expected, actual.getCreatedAt()); } return this; }