use of com.hotels.styx.api.Resource in project styx by ExpediaGroup.
the class ResourceFactoryTest method canAcquireFileResources.
@Test
public void canAcquireFileResources() {
String filePath = ResourceFactoryTest.class.getResource("/com/hotels/styx/common/io/resource.txt").getPath();
Resource resource = ResourceFactory.newResource(filePath);
assertThat(resource, contains("This is an example resource.\nIt has content to use in automated tests."));
}
use of com.hotels.styx.api.Resource in project styx by ExpediaGroup.
the class ResourceFactoryTest method canAcquireClasspathResources.
@Test
public void canAcquireClasspathResources() {
Resource resource = ResourceFactory.newResource("classpath:com/hotels/styx/common/io/resource.txt");
assertThat(resource, contains("This is an example resource.\nIt has content to use in automated tests."));
}
use of com.hotels.styx.api.Resource in project styx by ExpediaGroup.
the class FileResourceIndexTest method listsResourcesFromFileSystemFile.
@Test
public void listsResourcesFromFileSystemFile() {
File file = new File(PLUGINS_FIXTURE_PATH.toFile(), "groovy/UrlRewrite.groovy");
Iterable<Resource> files = resourceIndex.list(file.getPath(), ".anything");
assertThat(files, contains(resourceWithPath(PLUGINS_FIXTURE_PATH.resolve("groovy/UrlRewrite.groovy").toString())));
}
Aggregations