use of gov.ca.cwds.data.persistence.cms.CmsDocumentBlobSegment in project API by ca-cwds.
the class CmsDocumentBlobSegmentTest method testColumnConstraintsGood.
@Test
public void testColumnConstraintsGood() throws Exception {
CmsDocumentBlobSegment blob = new CmsDocumentBlobSegment(docHandle, segmentSequence, docBlob);
Set<ConstraintViolation<CmsDocumentBlobSegment>> violations = validator.validate(blob);
assertEquals(0, violations.size());
}
use of gov.ca.cwds.data.persistence.cms.CmsDocumentBlobSegment in project API by ca-cwds.
the class CmsDocumentBlobSegmentTest method testConstraintBlobNull.
// ====================
// BLOB
// ====================
@Test
public void testConstraintBlobNull() throws Exception {
CmsDocumentBlobSegment blob = new CmsDocumentBlobSegment(docHandle, segmentSequence, null);
Set<ConstraintViolation<CmsDocumentBlobSegment>> violations = validator.validate(blob);
assertEquals(1, violations.size());
assertEquals("may not be null", violations.iterator().next().getMessage());
}
use of gov.ca.cwds.data.persistence.cms.CmsDocumentBlobSegment in project API by ca-cwds.
the class CmsDocumentBlobSegmentTest method testConstraintDocSegmentPattern.
@Test
public void testConstraintDocSegmentPattern() throws Exception {
CmsDocumentBlobSegment blob = new CmsDocumentBlobSegment(docHandle, "abcd", docBlob);
Set<ConstraintViolation<CmsDocumentBlobSegment>> violations = validator.validate(blob);
assertEquals(1, violations.size());
// assertEquals("invalid DOC_HANDLE", violations.iterator().next().getMessage());
}
use of gov.ca.cwds.data.persistence.cms.CmsDocumentBlobSegment in project API by ca-cwds.
the class CmsDocumentBlobSegmentTest method testConstraintDocHandlePattern.
// ====================
// DOC_HANDLE
// ====================
@Test
public void testConstraintDocHandlePattern() throws Exception {
CmsDocumentBlobSegment blob = new CmsDocumentBlobSegment("123456789012345678901234567890", segmentSequence, docBlob);
Set<ConstraintViolation<CmsDocumentBlobSegment>> violations = validator.validate(blob);
assertEquals(1, violations.size());
assertEquals("invalid DOC_HANDLE", violations.iterator().next().getMessage());
}
use of gov.ca.cwds.data.persistence.cms.CmsDocumentBlobSegment in project API by ca-cwds.
the class CmsDocumentBlobSegmentTest method testGetPrimaryKeyGood.
@Test
public void testGetPrimaryKeyGood() throws Exception {
VarargPrimaryKey pk = new VarargPrimaryKey(docHandle, segmentSequence);
CmsDocumentBlobSegment blob = new CmsDocumentBlobSegment(docHandle, segmentSequence, docBlob);
assertThat(blob.getPrimaryKey().toString(), is(equalTo(pk.toString())));
}
Aggregations