use of com.hotels.styx.proxy.backends.file.FileBackedBackendServicesRegistry.YAMLBackendServicesReader in project styx by ExpediaGroup.
the class FileBackedBackendServicesRegistryTest method yamlBackendReaderPropagatesExceptionWhenFailsToReadFromByteStream.
@Test
public void yamlBackendReaderPropagatesExceptionWhenFailsToReadFromByteStream() {
Resource resource = newResource("classpath:/backends/origins-with-invalid-path.yml");
assertThrows(RuntimeException.class, () -> new YAMLBackendServicesReader().read(bytes(resource.inputStream(), true)));
}
use of com.hotels.styx.proxy.backends.file.FileBackedBackendServicesRegistry.YAMLBackendServicesReader in project styx by ExpediaGroup.
the class FileBackedBackendServicesRegistryTest method yamlBackendReaderReadsBackendServicesFromByteStream.
@Test
public void yamlBackendReaderReadsBackendServicesFromByteStream() throws IOException {
Resource resource = newResource("classpath:/backends/origins.yml");
Iterable<BackendService> backendServices = new YAMLBackendServicesReader().read(bytes(resource.inputStream(), true));
assertThat(iterableToList(backendServices).size(), is(3));
}
Aggregations