@Test
  public void testGetResourceSummariesTargetRestriction() throws Exception {

    MapEntryQueryServiceRestrictions restrictions = new MapEntryQueryServiceRestrictions();
    NameOrURI mapVersion = ModelUtils.nameOrUriFromName("MappingSample-1.0");
    restrictions.setMapVersion(mapVersion);

    EntityNameOrURI target = new EntityNameOrURI();
    target.setEntityName(ModelUtils.createScopedEntityName("E0001", "GermanMadePartsNamespace"));
    restrictions.getTargetEntities().add(target);

    MapEntryQueryImpl mapEntryQueryImpl = new MapEntryQueryImpl(null, null, null, restrictions);

    SortCriteria sortCriteria = null;
    Page page = new Page();

    DirectoryResult<MapEntryDirectoryEntry> list =
        this.service.getResourceSummaries(mapEntryQueryImpl, sortCriteria, page);
    assertNotNull(list);
    assertEquals(3, list.getEntries().size());
  }
    @Override
    public EntityList readEntityDescriptions(
        EntityNameOrURI entityId, ResolvedReadContext readContext) {
      EntityList entities = createEntityList();
      EntityListEntry entry = createEntityListEntry();

      if (entityId.getEntityName().getName().equals("test.name") && readContext != null) {
        entry.setResourceName("success");
      } else {
        entry.setResourceName("fail");
      }

      entities.addEntry(entry);
      return entities;
    }
    @Override
    public EntityReference availableDescriptions(
        EntityNameOrURI entityId, ResolvedReadContext readContext) {
      EntityReference ref = new EntityReference();
      ref.setAbout("test.about");
      ScopedEntityName name = new ScopedEntityName();
      name.setNamespace("test");
      if (entityId.getUri().equals("test.uri") && readContext != null) {
        name.setName("success");
      } else {
        name.setName("fail");
      }

      ref.setName(name);
      return ref;
    }