@Test public void testReadStubConfigurationShouldUseTheCachedConfigurations() { List<String> paths = new ArrayList<>(); paths.add("test"); given(cachePathProvider.getConfigPathsFromCache(DESCRIPTOR_CACHE_PATH)).willReturn(paths); underTest.readStubConfiguration(); verify(stubDescriptorReader).loadSpecificStubDescriptors(paths); }
public void readStubConfiguration() { getJsonDescriptorPath(); stubConfigSchema.setSchema(stubConfigSchemaParser.parseSchema()); List<String> stubConfigPaths = cachePathProvider.getConfigPathsFromCache(jsonDescriptorsCachePath); if (!stubConfigPaths.isEmpty()) { stubDescriptorReader.loadSpecificStubDescriptors(stubConfigPaths); } else { stubConfigPaths = cachePathProvider.getConfigPathsFromSpecificFolder(jsonDescriptorsSourceFolderPath, jsonDescriptorsPattern); stubDescriptorReader.loadSpecificStubDescriptors(stubConfigPaths); } }
FileBasedStubConfigReader { public void readStubConfiguration() { getJsonDescriptorPath(); stubConfigSchema.setSchema(stubConfigSchemaParser.parseSchema()); List<String> stubConfigPaths = cachePathProvider.getConfigPathsFromCache(jsonDescriptorsCachePath); if (!stubConfigPaths.isEmpty()) { stubDescriptorReader.loadSpecificStubDescriptors(stubConfigPaths); } else { stubConfigPaths = cachePathProvider.getConfigPathsFromSpecificFolder(jsonDescriptorsSourceFolderPath, jsonDescriptorsPattern); stubDescriptorReader.loadSpecificStubDescriptors(stubConfigPaths); } } }
FileBasedStubConfigReader { public void readStubConfiguration() { getJsonDescriptorPath(); stubConfigSchema.setSchema(stubConfigSchemaParser.parseSchema()); List<String> stubConfigPaths = cachePathProvider.getConfigPathsFromCache(jsonDescriptorsCachePath); if (!stubConfigPaths.isEmpty()) { stubDescriptorReader.loadSpecificStubDescriptors(stubConfigPaths); } else { stubConfigPaths = cachePathProvider.getConfigPathsFromSpecificFolder(jsonDescriptorsSourceFolderPath, jsonDescriptorsPattern); stubDescriptorReader.loadSpecificStubDescriptors(stubConfigPaths); } }  }
FileBasedStubConfigReader { public void readStubConfiguration() { getJsonDescriptorPath(); stubConfigSchema.setSchema(stubConfigSchemaParser.parseSchema()); List<String> stubConfigPaths = cachePathProvider.getConfigPathsFromCache(jsonDescriptorsCachePath); if (!stubConfigPaths.isEmpty()) { stubDescriptorReader.loadSpecificStubDescriptors(stubConfigPaths); } else { stubConfigPaths = cachePathProvider.getConfigPathsFromSpecificFolder(jsonDescriptorsSourceFolderPath, jsonDescriptorsPattern); stubDescriptorReader.loadSpecificStubDescriptors(stubConfigPaths); } }  void readStubConfiguration(); }
FileBasedStubConfigReader { public void readStubConfiguration() { getJsonDescriptorPath(); stubConfigSchema.setSchema(stubConfigSchemaParser.parseSchema()); List<String> stubConfigPaths = cachePathProvider.getConfigPathsFromCache(jsonDescriptorsCachePath); if (!stubConfigPaths.isEmpty()) { stubDescriptorReader.loadSpecificStubDescriptors(stubConfigPaths); } else { stubConfigPaths = cachePathProvider.getConfigPathsFromSpecificFolder(jsonDescriptorsSourceFolderPath, jsonDescriptorsPattern); stubDescriptorReader.loadSpecificStubDescriptors(stubConfigPaths); } }  void readStubConfiguration();  }