Search in sources :

Example 1 with DefaultAuditLogMsgBuilder

use of com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder in project athenz by yahoo.

the class AuditLogMsgBuilderTest method starter.

DefaultAuditLogMsgBuilder starter(final String whatApi) {
    AuditLoggerFactory auditLoggerFactory = new DefaultAuditLoggerFactory();
    AuditLogger logger = auditLoggerFactory.create();
    AuditLogMsgBuilder msgBldr = logger.getMsgBuilder();
    msgBldr.who(TOKEN_STR).when("now-timestamp").clientIp("12.12.12.12").whatApi(whatApi);
    return (DefaultAuditLogMsgBuilder) msgBldr;
}
Also used : DefaultAuditLogMsgBuilder(com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder) AuditLoggerFactory(com.yahoo.athenz.common.server.log.AuditLoggerFactory) AuditLogger(com.yahoo.athenz.common.server.log.AuditLogger) AuditLogMsgBuilder(com.yahoo.athenz.common.server.log.AuditLogMsgBuilder) DefaultAuditLogMsgBuilder(com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder)

Example 2 with DefaultAuditLogMsgBuilder

use of com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder in project athenz by yahoo.

the class AuditLogMsgBuilderTest method testWhatApi.

@Test
public void testWhatApi() {
    DefaultAuditLogMsgBuilder msgBldr = starter("testWhatApi");
    String dataStr = "putRole";
    msgBldr.whatApi(dataStr);
    Assert.assertTrue(msgBldr.whatApi().equals(dataStr), "whatApi string=" + msgBldr.whatApi());
}
Also used : DefaultAuditLogMsgBuilder(com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder) Test(org.testng.annotations.Test)

Example 3 with DefaultAuditLogMsgBuilder

use of com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder in project athenz by yahoo.

the class AuditLogMsgBuilderTest method testWhatEntity.

@Test
public void testWhatEntity() {
    DefaultAuditLogMsgBuilder msgBldr = starter("testWhatEntity");
    String dataStr = "readers";
    msgBldr.whatEntity(dataStr);
    Assert.assertTrue(msgBldr.whatEntity().equals(dataStr), "whatEntity string=" + msgBldr.whatEntity());
}
Also used : DefaultAuditLogMsgBuilder(com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder) Test(org.testng.annotations.Test)

Example 4 with DefaultAuditLogMsgBuilder

use of com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder in project athenz by yahoo.

the class AuditLogMsgBuilderTest method testClientIp.

@Test
public void testClientIp() {
    DefaultAuditLogMsgBuilder msgBldr = starter("testClientIp");
    String dataStr = "99.77.22.hup";
    msgBldr.clientIp(dataStr);
    Assert.assertTrue(msgBldr.clientIp().equals(dataStr), "clientIp string=" + msgBldr.clientIp());
}
Also used : DefaultAuditLogMsgBuilder(com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder) Test(org.testng.annotations.Test)

Example 5 with DefaultAuditLogMsgBuilder

use of com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder in project athenz by yahoo.

the class AuditLogMsgBuilderTest method testWhatDomain.

@Test
public void testWhatDomain() {
    DefaultAuditLogMsgBuilder msgBldr = starter("testWhatDomain");
    String dataStr = "sys.auth";
    msgBldr.whatDomain(dataStr);
    Assert.assertTrue(msgBldr.whatDomain().equals(dataStr), "whatDomain string=" + msgBldr.whatDomain());
}
Also used : DefaultAuditLogMsgBuilder(com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder) Test(org.testng.annotations.Test)

Aggregations

DefaultAuditLogMsgBuilder (com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder)16 Test (org.testng.annotations.Test)15 AuditLogMsgBuilder (com.yahoo.athenz.common.server.log.AuditLogMsgBuilder)7 AuditLogger (com.yahoo.athenz.common.server.log.AuditLogger)7 Principal (com.yahoo.athenz.auth.Principal)6 SimplePrincipal (com.yahoo.athenz.auth.impl.SimplePrincipal)6 DefaultAuditLogger (com.yahoo.athenz.common.server.log.impl.DefaultAuditLogger)6 SignedDomain (com.yahoo.athenz.zms.SignedDomain)6 ChangeLogStore (com.yahoo.athenz.zts.store.ChangeLogStore)6 DataStore (com.yahoo.athenz.zts.store.DataStore)6 MockZMSFileChangeLogStore (com.yahoo.athenz.zts.store.impl.MockZMSFileChangeLogStore)6 ZMSFileChangeLogStore (com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore)6 HashSet (java.util.HashSet)6 HttpServletRequest (javax.servlet.http.HttpServletRequest)6 AuditLoggerFactory (com.yahoo.athenz.common.server.log.AuditLoggerFactory)1