@Test public void testFromExternalId() { String externalId = "A123"; RecordRef ref = RecordReferences.from(RecordTypeEnum.ACCOUNT, externalId, RecordIdType.EXTERNAL) .createRef(); assertEquals(externalId, ref.getExternalId()); assertNull(ref.getInternalId()); }
@Test(expected = IllegalArgumentException.class) public void nullSafeFromNotIllegalArgument() throws Exception { RecordReferences.nulSafeFrom(null, "A126", null); }
@Test public void nullSafeFromNotNull() throws Exception { assertNotNull( RecordReferences.nulSafeFrom( RecordTypeEnum.ASSEMBLY_UNBUILD, "A126", RecordIdType.INTERNAL)); }
@Test public void nullSafeFromNull() throws Exception { assertNull(RecordReferences.nulSafeFrom(null, null, null)); }
@Test(expected = IllegalArgumentException.class) public void testFromBadInputType() { RecordReferences.from(null, "A126", RecordIdType.INTERNAL); }
@Test(expected = IllegalArgumentException.class) public void testFromBadInputId() { RecordReferences.from(RecordTypeEnum.ACCOUNT, null, RecordIdType.INTERNAL); }