@Test public void testTranslate_notFound() { EntityReferenceTranslator translator = new EntityReferenceTranslator(getProject(), "defect", new SimpleCache()); RestInvocations.loadMetadata(handler, "defect"); RestInvocations.loadMetadata(handler, "release-backlog-item"); handler.addRequest(false, "GET", "/qcbin/rest/domains/domain/projects/project/defects?fields=actual-fix-time,attachment,in-bucket,changeset,build-closed,closing-version,closing-date,dev-comments,id,status,description,detected-by,build-detected,detected-in-rcyc,detected-in-rel,detection-version,creation-time,estimated-fix-time,extended-reference,fixed-on-date,has-change,has-linkage,has-others-linkage,last-modified,planned-closing-ver,priority,user-04,user-03,reproducible,severity,subject,name,user-02,user-01,watch-id,release-backlog-item.product-id,release-backlog-item.owner,release-backlog-item.blocked,release-backlog-item.entity-name,release-backlog-item.entity-type,release-backlog-item.feature-id,release-backlog-item.invested,release-backlog-item.kanban-status-id,release-backlog-item.linked-entities-info,release-backlog-item.no-of-sons,release-backlog-item.kanban-parent-status-id,release-backlog-item.rank,release-backlog-item.release-id,release-backlog-item.entity-id,release-backlog-item.remaining,release-backlog-item.sprint-id,release-backlog-item.status,release-backlog-item.kan-parent-duration,release-backlog-item.story-points,release-backlog-item.kan-status-duration,release-backlog-item.team-id,release-backlog-item.theme-id,release-backlog-item.estimated,release-backlog-item.watch-id,release-backlog-item.id,product-group-id&query={id[87]}&order-by={}", 200) .content("no_entities.xml"); handler.async(); String name = translator.translate("87", new ValueCallback() { @Override public void value(final String value) { handler.done(new Runnable() { @Override public void run() { Assert.assertEquals("N/A", value); } }); } }); Assert.assertNull(name); }
@Override public String translate(String value, ValueCallback callback) { return new Execution(callback).perform(value); }
EntityReferenceTranslator implements Translator { @Override public String translate(String value, ValueCallback callback) { return new Execution(callback).perform(value); } }
EntityReferenceTranslator implements Translator { @Override public String translate(String value, ValueCallback callback) { return new Execution(callback).perform(value); } EntityReferenceTranslator(Project project, String targetType, SimpleCache cache); }
EntityReferenceTranslator implements Translator { @Override public String translate(String value, ValueCallback callback) { return new Execution(callback).perform(value); } EntityReferenceTranslator(Project project, String targetType, SimpleCache cache); @Override String translate(String value, ValueCallback callback); String getTargetType(); }
EntityReferenceTranslator implements Translator { @Override public String translate(String value, ValueCallback callback) { return new Execution(callback).perform(value); } EntityReferenceTranslator(Project project, String targetType, SimpleCache cache); @Override String translate(String value, ValueCallback callback); String getTargetType();  }