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;
}
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());
}
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());
}
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());
}
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());
}
Aggregations