Search in sources :

Example 16 with InMemoryStorage

use of com.artipie.asto.memory.InMemoryStorage in project maven-adapter by artipie.

the class UploadSliceTest method init.

@BeforeEach
void init() {
    this.asto = new InMemoryStorage();
    this.ums = new UploadSlice(this.asto);
}
Also used : InMemoryStorage(com.artipie.asto.memory.InMemoryStorage) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 17 with InMemoryStorage

use of com.artipie.asto.memory.InMemoryStorage in project maven-adapter by artipie.

the class ArtifactsMetadataTest method initiate.

@BeforeEach
void initiate() {
    this.storage = new InMemoryStorage();
    this.key = new Key.From("com/test/logger");
}
Also used : InMemoryStorage(com.artipie.asto.memory.InMemoryStorage) Key(com.artipie.asto.Key) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 18 with InMemoryStorage

use of com.artipie.asto.memory.InMemoryStorage in project front by artipie.

the class GetRepositoryPermissionsTest method init.

@BeforeEach
void init() {
    this.blsto = new BlockingStorage(new InMemoryStorage());
    this.snt = new RepoSettings("flat", this.blsto);
}
Also used : InMemoryStorage(com.artipie.asto.memory.InMemoryStorage) BlockingStorage(com.artipie.asto.blocking.BlockingStorage) RepoSettings(com.artipie.front.settings.RepoSettings) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 19 with InMemoryStorage

use of com.artipie.asto.memory.InMemoryStorage in project front by artipie.

the class GetRepositoryTest method returnsRepositorySettings.

@ParameterizedTest
@CsvSource({ "yaml,my-maven", "yml,my-npm-proxy" })
void returnsRepositorySettings(final String ext, final String name) throws Exception {
    final BlockingStorage blsto = new BlockingStorage(new InMemoryStorage());
    final String file = String.format("%s.%s", name, ext);
    blsto.save(new Key.From(file), new TestResource(String.format("GetRepositoryTest/%s", file)).asBytes());
    final var resp = Mockito.mock(Response.class);
    final var rqs = Mockito.mock(Request.class);
    Mockito.when(rqs.params(GetRepository.NAME_PARAM.toString())).thenReturn(name);
    Mockito.when(rqs.attribute(RequestAttr.Standard.USER_ID.attrName())).thenReturn("any");
    JSONAssert.assertEquals(new GetRepository(new RepoSettings("flat", blsto)).handle(rqs, resp), new String(new TestResource(String.format("GetRepositoryTest/%s.json", name)).asBytes(), StandardCharsets.UTF_8), true);
    Mockito.verify(resp).type("application/json");
}
Also used : InMemoryStorage(com.artipie.asto.memory.InMemoryStorage) BlockingStorage(com.artipie.asto.blocking.BlockingStorage) RepoSettings(com.artipie.front.settings.RepoSettings) TestResource(com.artipie.asto.test.TestResource) Key(com.artipie.asto.Key) CsvSource(org.junit.jupiter.params.provider.CsvSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 20 with InMemoryStorage

use of com.artipie.asto.memory.InMemoryStorage in project front by artipie.

the class PutUserTest method init.

@BeforeEach
void init() {
    this.asto = new BlockingStorage(new InMemoryStorage());
    this.users = new YamlUsers(PutUserTest.CREDS_YAML, this.asto);
}
Also used : InMemoryStorage(com.artipie.asto.memory.InMemoryStorage) BlockingStorage(com.artipie.asto.blocking.BlockingStorage) YamlUsers(com.artipie.front.auth.YamlUsers) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

InMemoryStorage (com.artipie.asto.memory.InMemoryStorage)30 BlockingStorage (com.artipie.asto.blocking.BlockingStorage)17 Key (com.artipie.asto.Key)16 Storage (com.artipie.asto.Storage)14 BeforeEach (org.junit.jupiter.api.BeforeEach)14 Test (org.junit.jupiter.api.Test)13 RsHasStatus (com.artipie.http.hm.RsHasStatus)6 LoggingSlice (com.artipie.http.slice.LoggingSlice)4 VertxSliceServer (com.artipie.vertx.VertxSliceServer)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4 PublisherAs (com.artipie.asto.ext.PublisherAs)3 TestResource (com.artipie.asto.test.TestResource)3 YamlUsers (com.artipie.front.auth.YamlUsers)3 RepoSettings (com.artipie.front.settings.RepoSettings)3 RsHasBody (com.artipie.http.hm.RsHasBody)3 Content (com.artipie.asto.Content)2 FromStorageCache (com.artipie.asto.cache.FromStorageCache)2 Authentication (com.artipie.http.auth.Authentication)2 JettyClientSlices (com.artipie.http.client.jetty.JettyClientSlices)2 RequestLine (com.artipie.http.rq.RequestLine)2