@Test void testUpdateWhenResultDetailIsEmpty() { when(mockResultServiceEventData.getResultDetails()).thenReturn(""); underTest.update(mockAttemptAuditEventResult, mockResultServiceEventData); verify(mockResultServiceEventDataBuilder, never()).setResultDetails(any()); }
@Override public void update(AuditProto.AttemptAuditEventResult.Builder builder, ResultServiceEventData resultEventData) { AuditProto.ResultServiceEventData.Builder resultServiceEventDataBuilder = builderProvider.getNewResultServiceEventDataBuilder() .addAllResourceCrn(resultEventData.getResourceCrns()); doIfTrue(resultEventData.getResultDetails(), StringUtils::isNotEmpty, resultServiceEventDataBuilder::setResultDetails); builder.setResultServiceEventData(resultServiceEventDataBuilder.build()); }
ResultServiceEventDataBuildUpdater implements AttemptAuditEventResultBuilderUpdater<ResultServiceEventData> { @Override public void update(AuditProto.AttemptAuditEventResult.Builder builder, ResultServiceEventData resultEventData) { AuditProto.ResultServiceEventData.Builder resultServiceEventDataBuilder = builderProvider.getNewResultServiceEventDataBuilder() .addAllResourceCrn(resultEventData.getResourceCrns()); doIfTrue(resultEventData.getResultDetails(), StringUtils::isNotEmpty, resultServiceEventDataBuilder::setResultDetails); builder.setResultServiceEventData(resultServiceEventDataBuilder.build()); } }
ResultServiceEventDataBuildUpdater implements AttemptAuditEventResultBuilderUpdater<ResultServiceEventData> { @Override public void update(AuditProto.AttemptAuditEventResult.Builder builder, ResultServiceEventData resultEventData) { AuditProto.ResultServiceEventData.Builder resultServiceEventDataBuilder = builderProvider.getNewResultServiceEventDataBuilder() .addAllResourceCrn(resultEventData.getResourceCrns()); doIfTrue(resultEventData.getResultDetails(), StringUtils::isNotEmpty, resultServiceEventDataBuilder::setResultDetails); builder.setResultServiceEventData(resultServiceEventDataBuilder.build()); } ResultServiceEventDataBuildUpdater(ResultServiceEventDataBuilderProvider builderProvider); }
ResultServiceEventDataBuildUpdater implements AttemptAuditEventResultBuilderUpdater<ResultServiceEventData> { @Override public void update(AuditProto.AttemptAuditEventResult.Builder builder, ResultServiceEventData resultEventData) { AuditProto.ResultServiceEventData.Builder resultServiceEventDataBuilder = builderProvider.getNewResultServiceEventDataBuilder() .addAllResourceCrn(resultEventData.getResourceCrns()); doIfTrue(resultEventData.getResultDetails(), StringUtils::isNotEmpty, resultServiceEventDataBuilder::setResultDetails); builder.setResultServiceEventData(resultServiceEventDataBuilder.build()); } ResultServiceEventDataBuildUpdater(ResultServiceEventDataBuilderProvider builderProvider); @Override void update(AuditProto.AttemptAuditEventResult.Builder builder, ResultServiceEventData resultEventData); @Override Class<ResultServiceEventData> getType(); }
ResultServiceEventDataBuildUpdater implements AttemptAuditEventResultBuilderUpdater<ResultServiceEventData> { @Override public void update(AuditProto.AttemptAuditEventResult.Builder builder, ResultServiceEventData resultEventData) { AuditProto.ResultServiceEventData.Builder resultServiceEventDataBuilder = builderProvider.getNewResultServiceEventDataBuilder() .addAllResourceCrn(resultEventData.getResourceCrns()); doIfTrue(resultEventData.getResultDetails(), StringUtils::isNotEmpty, resultServiceEventDataBuilder::setResultDetails); builder.setResultServiceEventData(resultServiceEventDataBuilder.build()); } ResultServiceEventDataBuildUpdater(ResultServiceEventDataBuilderProvider builderProvider); @Override void update(AuditProto.AttemptAuditEventResult.Builder builder, ResultServiceEventData resultEventData); @Override Class<ResultServiceEventData> getType();  }