Search in sources :

Example 1 with ZMSFileChangeLogStore

use of com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore in project athenz by yahoo.

the class ZMSFileChangeLogStoreTest method FileStructStoreInvalid.

@Test
public void FileStructStoreInvalid() {
    try {
        File rootDir = new File(FSTORE_PATH);
        rootDir.mkdirs();
        String fpath = FSTORE_PATH + "/zts_file.tmp";
        touch(fpath);
        @SuppressWarnings("unused") ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(fpath, null, null);
        fail();
    } catch (RuntimeException | IOException ex) {
        assertTrue(true);
    }
}
Also used : ZMSFileChangeLogStore(com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore) IOException(java.io.IOException) File(java.io.File) Test(org.testng.annotations.Test)

Example 2 with ZMSFileChangeLogStore

use of com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore in project athenz by yahoo.

the class ZMSFileChangeLogStoreTest method deleteExistent.

@Test
public void deleteExistent() {
    ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(FSTORE_PATH, null, null);
    Struct data = new Struct();
    data.put("key", "val1");
    fstore.put("test1", JSON.bytes(data));
    fstore.delete("test1");
    Struct st = fstore.get("test1", Struct.class);
    assertNull(st);
}
Also used : ZMSFileChangeLogStore(com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore) Struct(com.yahoo.rdl.Struct) Test(org.testng.annotations.Test)

Example 3 with ZMSFileChangeLogStore

use of com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore in project athenz by yahoo.

the class ZMSFileChangeLogStoreTest method scanEmpty.

@Test
public void scanEmpty() {
    ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(FSTORE_PATH, null, null);
    List<String> ls = fstore.scan();
    assertEquals(ls.size(), 0);
}
Also used : ZMSFileChangeLogStore(com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore) Test(org.testng.annotations.Test)

Example 4 with ZMSFileChangeLogStore

use of com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore in project athenz by yahoo.

the class ZMSFileChangeLogStoreTest method FileStructStoreValidDir.

@Test
public void FileStructStoreValidDir() {
    ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(FSTORE_PATH, null, null);
    assertNotNull(fstore);
}
Also used : ZMSFileChangeLogStore(com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore) Test(org.testng.annotations.Test)

Example 5 with ZMSFileChangeLogStore

use of com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore in project athenz by yahoo.

the class ZMSFileChangeLogStoreTest method scanSingle.

@Test
public void scanSingle() {
    ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(FSTORE_PATH, null, null);
    Struct data = new Struct();
    data.put("key", "val1");
    fstore.put("test1", JSON.bytes(data));
    List<String> ls = fstore.scan();
    assertEquals(ls.size(), 1);
    assertTrue(ls.contains("test1"));
}
Also used : ZMSFileChangeLogStore(com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore) Struct(com.yahoo.rdl.Struct) Test(org.testng.annotations.Test)

Aggregations

ZMSFileChangeLogStore (com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore)23 Test (org.testng.annotations.Test)23 SignedDomain (com.yahoo.athenz.zms.SignedDomain)11 SimplePrincipal (com.yahoo.athenz.auth.impl.SimplePrincipal)9 ChangeLogStore (com.yahoo.athenz.zts.store.ChangeLogStore)9 DataStore (com.yahoo.athenz.zts.store.DataStore)9 MockZMSFileChangeLogStore (com.yahoo.athenz.zts.store.impl.MockZMSFileChangeLogStore)9 Struct (com.yahoo.rdl.Struct)7 Principal (com.yahoo.athenz.auth.Principal)6 AuditLogMsgBuilder (com.yahoo.athenz.common.server.log.AuditLogMsgBuilder)6 AuditLogger (com.yahoo.athenz.common.server.log.AuditLogger)6 DefaultAuditLogMsgBuilder (com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder)6 DefaultAuditLogger (com.yahoo.athenz.common.server.log.impl.DefaultAuditLogger)6 HashSet (java.util.HashSet)6 HttpServletRequest (javax.servlet.http.HttpServletRequest)6 CertificateAuthority (com.yahoo.athenz.auth.impl.CertificateAuthority)3 InstanceCertManager (com.yahoo.athenz.zts.cert.InstanceCertManager)3 X509CertRecord (com.yahoo.athenz.zts.cert.X509CertRecord)3 Path (java.nio.file.Path)3 X509Certificate (java.security.cert.X509Certificate)3