Skip to content

Commit

Permalink
test: replace MockUriTest with AmazonS3UtilsTest
Browse files Browse the repository at this point in the history
* former is no longer relevant
  • Loading branch information
bogovicj committed Feb 29, 2024
1 parent 44f1045 commit 7ef137f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 30 deletions.
41 changes: 41 additions & 0 deletions src/test/java/org/janelia/saalfeldlab/n5/s3/AmazonS3UtilsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.janelia.saalfeldlab.n5.s3;

import static org.junit.Assert.assertEquals;

import java.net.URI;
import java.net.URISyntaxException;

import org.junit.Test;

public class AmazonS3UtilsTest {

@Test
public void testUriParsing() throws URISyntaxException {

// dummy client
String[] prefixes = new String[]{
"s3://",
"https://s3-eu-west-1.amazonaws.com/",
"http://localhost:8001/",
};

String[] buckets = new String[]{
"zarr-n5-demo",
"static.wk.org"};

String[] paths = new String[]{
"",
"foo.zarr",
"data/sample"};

for (String prefix : prefixes)
for (String bucket : buckets)
for (String path : paths) {
URI uri = new URI(prefix + bucket + "/" + path);
assertEquals("bucket from uri", bucket, AmazonS3Utils.getS3Bucket(uri));
assertEquals("key from uri", path, AmazonS3Utils.getS3Key(uri));
}

}

}
30 changes: 0 additions & 30 deletions src/test/java/org/janelia/saalfeldlab/n5/s3/mock/MockUriTest.java

This file was deleted.

0 comments on commit 7ef137f

Please sign in to comment.