@Test public void getValuesInvokesThePropertyValueGetterToReturnThePropertyValues() { PropertyValueGetter propertyValueGetter = mock(PropertyValueGetter.class); FacetGetter facetGetter = mock(FacetGetter.class); List<String> mockValues = mock(List.class); Vertex vertex = mock(Vertex.class); given(propertyValueGetter.getValues(any(), any())).willReturn(mockValues); FacetDescription instance = new FacetDescriptionImpl(FACET_NAME, PROPERTY_NAME, facetGetter, propertyValueGetter); List<String> result = instance.getValues(vertex); assertEquals(result, mockValues); ArgumentCaptor<Vertex> captor = ArgumentCaptor.forClass(Vertex.class); ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class); verify(propertyValueGetter, times(1)).getValues(captor.capture(), captor1.capture()); assertThat(captor.getValue(), equalTo(vertex)); assertThat(captor1.getValue(), equalTo(PROPERTY_NAME)); }
@Override public List<String> getValues(Vertex vertex) { return propertyValueGetter.getValues(vertex, propertyName); }
AbstractFacetDescription implements FacetDescription { @Override public List<String> getValues(Vertex vertex) { return propertyValueGetter.getValues(vertex, propertyName); } }
AbstractFacetDescription implements FacetDescription { @Override public List<String> getValues(Vertex vertex) { return propertyValueGetter.getValues(vertex, propertyName); } AbstractFacetDescription(String facetName, String propertyName, FacetGetter facetGetter,
                                  PropertyValueGetter propertyValueGetter); }
AbstractFacetDescription implements FacetDescription { @Override public List<String> getValues(Vertex vertex) { return propertyValueGetter.getValues(vertex, propertyName); } AbstractFacetDescription(String facetName, String propertyName, FacetGetter facetGetter,
                                  PropertyValueGetter propertyValueGetter); @Override String getName(); @Override Facet getFacet(Map<String, Set<Vertex>> values); @Override List<String> getValues(Vertex vertex); }
AbstractFacetDescription implements FacetDescription { @Override public List<String> getValues(Vertex vertex) { return propertyValueGetter.getValues(vertex, propertyName); } AbstractFacetDescription(String facetName, String propertyName, FacetGetter facetGetter,
                                  PropertyValueGetter propertyValueGetter); @Override String getName(); @Override Facet getFacet(Map<String, Set<Vertex>> values); @Override List<String> getValues(Vertex vertex);  }