@Test public void hashCodeShouldNotRetrieveCompleteGisFeatureFromProviderForEfficiencyReasons() { GisFeatureProvider gisFeatureProvider = Mockito.mock(GisFeatureProvider.class); when(gisFeatureProvider.gisFeatureHashCode()).thenReturn(1); when(gisFeatureProvider.getGisFeatureId()).thenReturn(new GisFeatureId(3017382L)); assertEquals(1, createFranceWithMockGisFeatureProvider(gisFeatureProvider).hashCode()); Mockito.verify(gisFeatureProvider).gisFeatureHashCode(); }
@Test public void equalsShouldNotRetrieveCompleteGisFeatureFromProviderForEfficiencyReasons() { GisFeatureProvider gisFeatureProvider = Mockito.mock(GisFeatureProvider.class); when(gisFeatureProvider.gisFeatureEquals((GisFeatureProvider) Mockito.anyObject())) .thenReturn(true); when(gisFeatureProvider.getGisFeatureId()).thenReturn(new GisFeatureId(3017382L)); assertEquals( createFranceWithMockGisFeatureProvider(gisFeatureProvider), createFranceWithMockGisFeatureProvider(gisFeatureProvider)); Mockito.verify(gisFeatureProvider).gisFeatureEquals((GisFeatureProvider) Mockito.anyObject()); }