@Test void testUpdateWhenVersionIsEmpty() { when(mockServiceEventData.getVersion()).thenReturn(""); underTest.update(mockAuditEventBuilder, mockServiceEventData); verify(mockServiceEventDataBuilder, never()).setDetailsVersion(any()); }
@Override public void update(AuditProto.AuditEvent.Builder auditEventBuilder, ServiceEventData eventData) { AuditProto.ServiceEventData.Builder serviceEventDataBuilder = builderProvider.getNewServiceEventDataBuilder(); doIfTrue(eventData.getEventDetails(), StringUtils::isNotEmpty, serviceEventDataBuilder::setEventDetails); doIfTrue(eventData.getVersion(), StringUtils::isNotEmpty, serviceEventDataBuilder::setDetailsVersion); auditEventBuilder.setServiceEventData(serviceEventDataBuilder.build()); }
ServiceEventDataBuildUpdater implements AuditEventBuilderUpdater<ServiceEventData> { @Override public void update(AuditProto.AuditEvent.Builder auditEventBuilder, ServiceEventData eventData) { AuditProto.ServiceEventData.Builder serviceEventDataBuilder = builderProvider.getNewServiceEventDataBuilder(); doIfTrue(eventData.getEventDetails(), StringUtils::isNotEmpty, serviceEventDataBuilder::setEventDetails); doIfTrue(eventData.getVersion(), StringUtils::isNotEmpty, serviceEventDataBuilder::setDetailsVersion); auditEventBuilder.setServiceEventData(serviceEventDataBuilder.build()); } }
ServiceEventDataBuildUpdater implements AuditEventBuilderUpdater<ServiceEventData> { @Override public void update(AuditProto.AuditEvent.Builder auditEventBuilder, ServiceEventData eventData) { AuditProto.ServiceEventData.Builder serviceEventDataBuilder = builderProvider.getNewServiceEventDataBuilder(); doIfTrue(eventData.getEventDetails(), StringUtils::isNotEmpty, serviceEventDataBuilder::setEventDetails); doIfTrue(eventData.getVersion(), StringUtils::isNotEmpty, serviceEventDataBuilder::setDetailsVersion); auditEventBuilder.setServiceEventData(serviceEventDataBuilder.build()); } ServiceEventDataBuildUpdater(ServiceEventDataBuilderProvider builderProvider); }
ServiceEventDataBuildUpdater implements AuditEventBuilderUpdater<ServiceEventData> { @Override public void update(AuditProto.AuditEvent.Builder auditEventBuilder, ServiceEventData eventData) { AuditProto.ServiceEventData.Builder serviceEventDataBuilder = builderProvider.getNewServiceEventDataBuilder(); doIfTrue(eventData.getEventDetails(), StringUtils::isNotEmpty, serviceEventDataBuilder::setEventDetails); doIfTrue(eventData.getVersion(), StringUtils::isNotEmpty, serviceEventDataBuilder::setDetailsVersion); auditEventBuilder.setServiceEventData(serviceEventDataBuilder.build()); } ServiceEventDataBuildUpdater(ServiceEventDataBuilderProvider builderProvider); @Override void update(AuditProto.AuditEvent.Builder auditEventBuilder, ServiceEventData eventData); @Override Class<ServiceEventData> getType(); }
ServiceEventDataBuildUpdater implements AuditEventBuilderUpdater<ServiceEventData> { @Override public void update(AuditProto.AuditEvent.Builder auditEventBuilder, ServiceEventData eventData) { AuditProto.ServiceEventData.Builder serviceEventDataBuilder = builderProvider.getNewServiceEventDataBuilder(); doIfTrue(eventData.getEventDetails(), StringUtils::isNotEmpty, serviceEventDataBuilder::setEventDetails); doIfTrue(eventData.getVersion(), StringUtils::isNotEmpty, serviceEventDataBuilder::setDetailsVersion); auditEventBuilder.setServiceEventData(serviceEventDataBuilder.build()); } ServiceEventDataBuildUpdater(ServiceEventDataBuilderProvider builderProvider); @Override void update(AuditProto.AuditEvent.Builder auditEventBuilder, ServiceEventData eventData); @Override Class<ServiceEventData> getType();  }