IdentifierBrowserBean implements IdentifierBrowser { @Override public Long getObjectId(String identifier) { DigitalObject object = digitalObjectDao.getDigitalObject(identifier); if (object != null) { return object.getId(); } return null; }  @Override String findNextActiveIdentifier(String previousIdentifier); @Override List<String> getIdentifiersForMigration(String puid, String username, Collection<Long> objectIds); @Override Long getObjectId(String identifier);  }
@Test public void shouldGetNullForNotExistingIdentifier() throws Exception { Long tested = identifierBrowser.getObjectId("oai:darceo.psnc.pl:0"); Assert.assertNull(tested); }