Skip to content

Commit

Permalink
fix(tests): add a test to cover a put file from another storage file …
Browse files Browse the repository at this point in the history
…data

part of #4761
  • Loading branch information
brian-mulier-p committed Oct 11, 2024
1 parent e12ba7d commit 876b36c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/src/main/java/io/kestra/core/storage/StorageTestSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,27 @@ void put() throws Exception {
put(tenantId, prefix);
}

@Test
void putFromAnotherFile() throws Exception {
String prefix = IdUtils.create();
String tenantId = IdUtils.create();

put(tenantId, prefix);

URI putFromAnother = storageInterface.put(
tenantId,
new URI("/" + prefix + "/storage/put_from_another.yml"),
storageInterface.get(tenantId, new URI("/" + prefix + "/storage/put.yml"))
);

assertThat(putFromAnother.toString(), is(new URI("kestra:///" + prefix + "/storage/put_from_another.yml").toString()));
InputStream get = storageInterface.get(tenantId, new URI("/" + prefix + "/storage/put_from_another.yml"));
assertThat(
CharStreams.toString(new InputStreamReader(get)),
is(CONTENT_STRING)
);
}

@Test
void putNoTenant() throws Exception {
String prefix = IdUtils.create();
Expand Down

0 comments on commit 876b36c

Please sign in to comment.