### Question:
ApplicationDataStore extends CommonDatastore<ApplicationItem, Application> implements DatastoreHasAdd<ApplicationItem>,
DatastoreHasUpdate<ApplicationItem>,
DatastoreHasGet<ApplicationItem>,DatastoreHasSearch<ApplicationItem>, DatastoreHasDelete { @Override public ApplicationItem get(final APIID id) { try { final Application application = applicationAPI.getApplication(id.toLong()); return converter.toApplicationItem(application); } catch (final Exception e) { throw new APIException(e); } } ApplicationDataStore(final APISession engineSession, final ApplicationAPI applicationAPI, final PageAPI pageAPI, final ApplicationItemConverter converter); @Override void delete(final List<APIID> ids); @Override ApplicationItem get(final APIID id); @Override ApplicationItem add(final ApplicationItem item); @Override ApplicationItem update(final APIID id, final Map<String, String> attributes); @Override ItemSearchResult<ApplicationItem> search(final int page, final int resultsByPage, final String search, final String orders,
            final Map<String, String> filters);  }### Answer:
@Test public void should_return_the_good_application_on_get() throws Exception { final ApplicationImpl application = new ApplicationImpl("app", "1.0", "app desc"); final ApplicationItem item = new ApplicationItem(); given(converter.toApplicationItem(application)).willReturn(item); application.setId(1); given(applicationAPI.getApplication(1)).willReturn(application); final ApplicationItem retrivedItem = dataStore.get(APIID.makeAPIID("1")); assertThat(retrivedItem).isEqualTo(item); }
@Test(expected = APIException.class) public void should_return_throw_APIException_on_get_when_engine_throws_exception() throws Exception { given(applicationAPI.getApplication(1)).willThrow(new ApplicationNotFoundException(1)); dataStore.get(APIID.makeAPIID("1")); }