Phabricator { public Data<RevisionSearchFields> getRevisionForTargetPhid(String harbormasterTargetPHID) { String buildPHID = harbormaster.getBuildPHID(harbormasterTargetPHID); String buildablePHID = harbormaster.getBuildablePHID(buildPHID); String objectPHID = harbormaster.getObjectPHID(buildablePHID); String revisionPHID = differentialDiff.getRevisionPHID(objectPHID); Data<RevisionSearchFields> revisionSearchFieldsData = differentialRevision.getRevision(revisionPHID); return revisionSearchFieldsData; } Phabricator(DifferentialDiff differentialDiff,
                       Harbormaster harbormaster,
                       DifferentialRevision differentialRevision); Data<RevisionSearchFields> getRevisionForTargetPhid(String harbormasterTargetPHID); DifferentialDiff getDifferentialDiff(); Harbormaster getHarbormaster(); DifferentialRevision getDifferentialRevision();  }
@Test public void getRevisionForTargetPhid() { StubPhabricatorHttpClient stubPhabricatorHttpClient = new StubPhabricatorHttpClient(getInputResourcesTestDir(), phabricatorHttpClient, phidMap); Phabricator phabricator = new Phabricator( new DifferentialDiff(stubPhabricatorHttpClient), new Harbormaster(stubPhabricatorHttpClient), new DifferentialRevision(stubPhabricatorHttpClient)); Data<RevisionSearchFields> revisionSearchFieldsData = phabricator.getRevisionForTargetPhid("PHID-HMBT-sometest"); assertEquals(49, (long) revisionSearchFieldsData.getId()); }