### Question:
S3Repository extends AbstractRepository { @Override public List<MRL> getResources() { try { Metadata m = getMetadata(); if (m != null && !m.getArtifacts().isEmpty()) { MRL mrl = MRL.model(Application.UNDEFINED, m.getGroupId(), m.getArtifactId()); return Collections.singletonList(mrl); } } catch (IOException e) { logger.warn("Failed to scan S3: " + bucket, e); } return Collections.emptyList(); } S3Repository(
            S3Client client,
            String name,
            String bucket,
            String prefix,
            String artifactId,
            String modelName); @Override boolean isRemote(); @Override String getName(); @Override URI getBaseUri(); @Override Metadata locate(MRL mrl); @Override Artifact resolve(MRL mrl, String version, Map<String, String> filter); @Override List<MRL> getResources();  }### Answer:
@Test public void testAccessDeny() { S3Client client = S3Client.builder() .credentialsProvider(AnonymousCredentialsProvider.create()) .region(Region.US_EAST_1) .build(); Repository.registerRepositoryFactory(new S3RepositoryFactory(client)); Repository repository = Repository.newInstance("s3", "s3: List<MRL> list = repository.getResources(); Assert.assertTrue(list.isEmpty()); }