@Test public void getMetadataReturnsEmptyMapWhenNoMetadataIsAvailable() { when(this.provider1.provideMetadata(this.entity)).thenReturn(Collections.emptyMap()); when(this.provider2.provideMetadata(this.entity)).thenReturn(Collections.emptyMap()); Map<String, Object> result = this.component.getMetadata(this.entity); Assert.assertTrue(result.isEmpty()); }
@Override public Map<String, Object> getMetadata(PrimaryEntity entity) { Map<String, Object> result = new HashMap<>(); this.allProviders.get().forEach(provider -> result.putAll(provider.provideMetadata(entity))); return result; }
DefaultPrimaryEntityMetadataManager implements PrimaryEntityMetadataManager { @Override public Map<String, Object> getMetadata(PrimaryEntity entity) { Map<String, Object> result = new HashMap<>(); this.allProviders.get().forEach(provider -> result.putAll(provider.provideMetadata(entity))); return result; } }
DefaultPrimaryEntityMetadataManager implements PrimaryEntityMetadataManager { @Override public Map<String, Object> getMetadata(PrimaryEntity entity) { Map<String, Object> result = new HashMap<>(); this.allProviders.get().forEach(provider -> result.putAll(provider.provideMetadata(entity))); return result; }  }
DefaultPrimaryEntityMetadataManager implements PrimaryEntityMetadataManager { @Override public Map<String, Object> getMetadata(PrimaryEntity entity) { Map<String, Object> result = new HashMap<>(); this.allProviders.get().forEach(provider -> result.putAll(provider.provideMetadata(entity))); return result; }  @Override Map<String, Object> getMetadata(PrimaryEntity entity); }
DefaultPrimaryEntityMetadataManager implements PrimaryEntityMetadataManager { @Override public Map<String, Object> getMetadata(PrimaryEntity entity) { Map<String, Object> result = new HashMap<>(); this.allProviders.get().forEach(provider -> result.putAll(provider.provideMetadata(entity))); return result; }  @Override Map<String, Object> getMetadata(PrimaryEntity entity);  }