| 1 | package fr.sii.ogham.core.builder.configurer; | |
| 2 | ||
| 3 | import static fr.sii.ogham.core.CoreConstants.CLASSPATH_LOOKUPS; | |
| 4 | import static fr.sii.ogham.core.CoreConstants.DEFAULT_MESSAGING_CONFIGURER_PRIORITY; | |
| 5 | import static fr.sii.ogham.core.CoreConstants.FILE_LOOKUPS; | |
| 6 | import static fr.sii.ogham.core.CoreConstants.STRING_LOOKUPS; | |
| 7 | import static fr.sii.ogham.core.builder.configuration.MayOverride.overrideIfNotSet; | |
| 8 | import static fr.sii.ogham.core.builder.configurer.SendMessageRetryablePredicates.canResendMessage; | |
| 9 | import static java.util.Arrays.asList; | |
| 10 | ||
| 11 | import java.util.List; | |
| 12 | import java.util.function.Supplier; | |
| 13 | import java.util.regex.Pattern; | |
| 14 | ||
| 15 | import org.apache.tika.Tika; | |
| 16 | import org.slf4j.Logger; | |
| 17 | import org.slf4j.LoggerFactory; | |
| 18 | ||
| 19 | import fr.sii.ogham.core.builder.MessagingBuilder; | |
| 20 | import fr.sii.ogham.core.builder.env.EnvironmentBuilder; | |
| 21 | import fr.sii.ogham.core.builder.mimetype.MimetypeDetectionBuilder; | |
| 22 | import fr.sii.ogham.core.builder.mimetype.TikaBuilder; | |
| 23 | import fr.sii.ogham.core.builder.resolution.ResourceResolutionBuilder; | |
| 24 | import fr.sii.ogham.core.convert.DefaultConverter; | |
| 25 | import fr.sii.ogham.core.exception.MessagingException; | |
| 26 | import fr.sii.ogham.core.service.MessagingService; | |
| 27 | import fr.sii.ogham.email.builder.AutofillDefaultEmailAddressBuilder; | |
| 28 | import fr.sii.ogham.email.builder.AutofillSubjectBuilder; | |
| 29 | import fr.sii.ogham.email.builder.CssInliningBuilder; | |
| 30 | import fr.sii.ogham.email.builder.EmailBuilder; | |
| 31 | import fr.sii.ogham.email.builder.ImageInliningBuilder; | |
| 32 | import fr.sii.ogham.email.message.Email; | |
| 33 | import fr.sii.ogham.sms.builder.AutofillSmsBuilder; | |
| 34 | import fr.sii.ogham.sms.builder.RecipientNumberFormatBuilder; | |
| 35 | import fr.sii.ogham.sms.builder.SenderNumberFormatBuilder; | |
| 36 | import fr.sii.ogham.sms.builder.SmsBuilder; | |
| 37 | import fr.sii.ogham.sms.message.Sms; | |
| 38 | ||
| 39 | /** | |
| 40 | * Default configurer that is automatically applied every time a | |
| 41 | * {@link MessagingBuilder} instance is created through | |
| 42 | * {@link MessagingBuilder#standard()} or {@link MessagingBuilder#minimal()}. | |
| 43 | * | |
| 44 | * <p> | |
| 45 | * The configurer has a priority of 100000 in order to be applied before all | |
| 46 | * other configurers. | |
| 47 | * </p> | |
| 48 | * | |
| 49 | * This configurer applies general configuration (see | |
| 50 | * {@link EnvironmentBuilder}): | |
| 51 | * <ul> | |
| 52 | * <li>The {@link MessagingService} will catch all uncaught exception (even | |
| 53 | * runtime) in order to wrap them in a {@link MessagingException}.</li> | |
| 54 | * <li>General environment configuration: | |
| 55 | * <ul> | |
| 56 | * <li>System properties with</li> | |
| 57 | * <li>Uses the {@link DefaultConverter}</li> | |
| 58 | * <li><strong>Environment will be inherited by sub-builders by | |
| 59 | * default.</strong></li> | |
| 60 | * </ul> | |
| 61 | * </li> | |
| 62 | * <li>Resource resolution configuration (see | |
| 63 | * {@link ResourceResolutionBuilder}): | |
| 64 | * <ul> | |
| 65 | * <li>Lookup prefixes for classpath: "classpath:" and no lookup prefix (if no | |
| 66 | * prefix is defined, then classpath is used). | |
| 67 | * <li>Lookup prefix for file: "file:". | |
| 68 | * <li>Lookup prefixes for string: "string:", "s:. | |
| 69 | * <li><strong>Resource resolution will be by default inherited by | |
| 70 | * sub-builders</strong></li> | |
| 71 | * </ul> | |
| 72 | * </li> | |
| 73 | * <li>Configure common email behaviors: | |
| 74 | * <ul> | |
| 75 | * <li>Configure resource resolution for attachments, css inlining and image | |
| 76 | * inlining using same resource resolution configuration as the general one (see | |
| 77 | * {@link ResourceResolutionBuilder})</li> | |
| 78 | * <li>Configure mimetype detection for attachments and image inlining (see | |
| 79 | * {@link MimetypeDetectionBuilder})</li> | |
| 80 | * <li>Automatically fill {@link Email} messages with subject either from title | |
| 81 | * tag of html template, from first line starting with "Subject:" of text | |
| 82 | * template or using {@code ogham.email.subject} property if defined (see | |
| 83 | * {@link AutofillSubjectBuilder})</li> | |
| 84 | * <li>Autofill {@link Email} messages with sender address if one of the | |
| 85 | * property {@code ogham.email.from.default-value} or {@code mail.smtp.from} is | |
| 86 | * defined (see {@link AutofillDefaultEmailAddressBuilder})</li> | |
| 87 | * <li>Autofill {@link Email} messages with recipient address (to) if the | |
| 88 | * property {@code ogham.email.to.default-value} is defined (see | |
| 89 | * {@link AutofillDefaultEmailAddressBuilder})</li> | |
| 90 | * <li>Autofill {@link Email} messages with recipient address (cc) if the | |
| 91 | * property {@code ogham.email.cc.default-value} is defined (see | |
| 92 | * {@link AutofillDefaultEmailAddressBuilder})</li> | |
| 93 | * <li>Autofill {@link Email} messages with recipient address (bcc) if the | |
| 94 | * property {@code ogham.email.bcc.default-value} is defined (see | |
| 95 | * {@link AutofillDefaultEmailAddressBuilder})</li> | |
| 96 | * <li>Automatically inline CSS styles in the HTML templates (see | |
| 97 | * {@link CssInliningBuilder})</li> | |
| 98 | * <li>Automatically inline images in the email either by attaching them or by | |
| 99 | * converting them into base64 (see {@link ImageInliningBuilder})</li> | |
| 100 | * </ul> | |
| 101 | * </li> | |
| 102 | * <li>Configure common SMS behaviors: | |
| 103 | * <ul> | |
| 104 | * <li>Autofill {@link Sms} messages with sender phone number if the property | |
| 105 | * {@code ogham.sms.from.default-value} is defined (see | |
| 106 | * {@link AutofillSmsBuilder})</li> | |
| 107 | * <li>Autofill {@link Sms} messages with recipient phone number if the property | |
| 108 | * {@code ogham.sms.to.default-value} is defined (see | |
| 109 | * {@link AutofillSmsBuilder})</li> | |
| 110 | * <li>Configure phone number formats (see {@link SenderNumberFormatBuilder} and | |
| 111 | * {@link RecipientNumberFormatBuilder})</li> | |
| 112 | * </ul> | |
| 113 | * </li> | |
| 114 | * <li>Mimetype detection configuration: | |
| 115 | * <ul> | |
| 116 | * <li>Uses {@link Tika} to detect mimetype (see {@link TikaBuilder})</li> | |
| 117 | * <li>Uses property {@code ogham.mimetype.default-mimetype} if Tika has not | |
| 118 | * detected the mimetype (see {@link MimetypeDetectionBuilder})</li> | |
| 119 | * <li>Uses {@code application/octet-stream} if neither Tika has detected | |
| 120 | * mimetype nor default property value has been set</li> | |
| 121 | * </ul> | |
| 122 | * </ul> | |
| 123 | * | |
| 124 | * @author Aurélien Baudet | |
| 125 | * | |
| 126 | */ | |
| 127 | @ConfigurerFor(targetedBuilder = { "minimal", "standard" }, priority = DEFAULT_MESSAGING_CONFIGURER_PRIORITY) | |
| 128 | public class DefaultMessagingConfigurer extends MessagingConfigurerAdapter { | |
| 129 | private static final Logger LOG = LoggerFactory.getLogger(DefaultMessagingConfigurer.class); | |
| 130 | private static final Pattern LOCATIONS_SEPARATOR = Pattern.compile(",\\s*"); | |
| 131 | private static final Pattern PROFILES_SEPARATOR = Pattern.compile(",\\s*"); | |
| 132 | | |
| 133 | private final Supplier<List<String>> profilesSupplier; | |
| 134 | private final Supplier<List<String>> locationsSupplier; | |
| 135 | | |
| 136 | public DefaultMessagingConfigurer() { | |
| 137 |
2
1. lambda$new$0 : replaced return value with Collections.emptyList for fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::lambda$new$0 → NO_COVERAGE 2. lambda$new$0 : replaced return value with Collections.emptyList for fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::lambda$new$0 → SURVIVED |
this(() -> asList(PROFILES_SEPARATOR.split(System.getProperty("ogham.profiles.active", "default"))), |
| 138 |
2
1. lambda$new$1 : replaced return value with Collections.emptyList for fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::lambda$new$1 → SURVIVED 2. lambda$new$1 : replaced return value with Collections.emptyList for fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::lambda$new$1 → NO_COVERAGE |
() -> asList(LOCATIONS_SEPARATOR.split(System.getProperty("ogham.config.location", "")))); |
| 139 | } | |
| 140 | | |
| 141 | public DefaultMessagingConfigurer(Supplier<List<String>> profilesSupplier, Supplier<List<String>> locationsSupplier) { | |
| 142 | super(); | |
| 143 | this.profilesSupplier = profilesSupplier; | |
| 144 | this.locationsSupplier = locationsSupplier; | |
| 145 | } | |
| 146 | ||
| 147 | @Override | |
| 148 | public void configure(MessagingBuilder builder) { | |
| 149 | LOG.debug("[{}] apply configuration", this); | |
| 150 |
7
1. configure : removed call to fr/sii/ogham/core/builder/configurer/MessagingConfigurerAdapter::configure → NO_COVERAGE 2. configure : removed call to fr/sii/ogham/core/builder/configurer/MessagingConfigurerAdapter::configure → SURVIVED 3. configure : removed call to fr/sii/ogham/core/builder/configurer/MessagingConfigurerAdapter::configure → TIMED_OUT 4. configure : removed call to fr/sii/ogham/core/builder/configurer/MessagingConfigurerAdapter::configure → KILLED 5. configure : removed call to fr/sii/ogham/core/builder/configurer/MessagingConfigurerAdapter::configure → KILLED 6. configure : removed call to fr/sii/ogham/core/builder/configurer/MessagingConfigurerAdapter::configure → KILLED 7. configure : removed call to fr/sii/ogham/core/builder/configurer/MessagingConfigurerAdapter::configure → KILLED |
super.configure(builder); |
| 151 | builder.wrapUncaught().properties("${ogham.wrap-uncaught-exceptions.enable}").defaultValue(overrideIfNotSet(true)); | |
| 152 | } | |
| 153 | ||
| 154 | @Override | |
| 155 | public void configure(EnvironmentBuilder<?> builder) { | |
| 156 | // @formatter:off | |
| 157 | builder | |
| 158 | .systemProperties() | |
| 159 | .converter() | |
| 160 | .defaultConverter(overrideIfNotSet(new DefaultConverter())); | |
| 161 | // @formatter:on | |
| 162 | List<String> profiles = profilesSupplier.get(); | |
| 163 | List<String> locations = locationsSupplier.get(); | |
| 164 |
3
1. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addUserDefinedConfigLocationsForProfiles → SURVIVED 2. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addUserDefinedConfigLocationsForProfiles → NO_COVERAGE 3. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addUserDefinedConfigLocationsForProfiles → KILLED |
addUserDefinedConfigLocationsForProfiles(builder, locations, profiles); |
| 165 |
3
1. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addUserDefinedConfigLocations → SURVIVED 2. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addUserDefinedConfigLocations → NO_COVERAGE 3. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addUserDefinedConfigLocations → KILLED |
addUserDefinedConfigLocations(builder, locations); |
| 166 |
3
1. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addDefaultConfigLocationsForProfiles → SURVIVED 2. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addDefaultConfigLocationsForProfiles → NO_COVERAGE 3. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addDefaultConfigLocationsForProfiles → KILLED |
addDefaultConfigLocationsForProfiles(builder, profiles); |
| 167 |
3
1. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addDefaultConfigLocations → SURVIVED 2. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addDefaultConfigLocations → NO_COVERAGE 3. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addDefaultConfigLocations → KILLED |
addDefaultConfigLocations(builder); |
| 168 | } | |
| 169 | ||
| 170 | @Override | |
| 171 | public void configure(ResourceResolutionBuilder<?> builder) { | |
| 172 | // @formatter:off | |
| 173 | builder | |
| 174 | .string() | |
| 175 | .lookup(STRING_LOOKUPS) | |
| 176 | .and() | |
| 177 | .file() | |
| 178 | .lookup(FILE_LOOKUPS) | |
| 179 | .and() | |
| 180 | .classpath() | |
| 181 | .lookup(CLASSPATH_LOOKUPS); | |
| 182 | // @formatter:on | |
| 183 | } | |
| 184 | ||
| 185 | @Override | |
| 186 | public void configure(EmailBuilder builder) { | |
| 187 | // configure resource resolution for attachments, css and images | |
| 188 |
3
1. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configure → NO_COVERAGE 2. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configure → SURVIVED 3. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configure → KILLED |
configure(builder.attachments()); |
| 189 |
3
1. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configure → NO_COVERAGE 2. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configure → SURVIVED 3. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configure → KILLED |
configure(builder.css().inline()); |
| 190 |
3
1. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configure → NO_COVERAGE 2. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configure → SURVIVED 3. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configure → KILLED |
configure(builder.images().inline()); |
| 191 | // configure mimetype detection for images | |
| 192 |
8
1. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configureImageInliningMimetype → NO_COVERAGE 2. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configureImageInliningMimetype → KILLED 3. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configureImageInliningMimetype → KILLED 4. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configureImageInliningMimetype → KILLED 5. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configureImageInliningMimetype → KILLED 6. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configureImageInliningMimetype → KILLED 7. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configureImageInliningMimetype → KILLED 8. configure : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::configureImageInliningMimetype → KILLED |
configureImageInliningMimetype(builder.images().inline().mimetype()); |
| 193 | ||
| 194 | // @formatter:off | |
| 195 | builder | |
| 196 | .autofill() | |
| 197 | .subject() | |
| 198 | .defaultValue().properties("${ogham.email.subject.default-value}").and() | |
| 199 | .htmlTitle().properties("${ogham.email.subject.extract-html-title.enable}").defaultValue(overrideIfNotSet(true)).and() | |
| 200 | .text().properties("${ogham.email.subject.extract-from-text.first-line-prefix}").defaultValue(overrideIfNotSet("Subject:")).and() | |
| 201 | .and() | |
| 202 | .from() | |
| 203 | .defaultValue().properties("${ogham.email.from.default-value}", "${mail.smtp.from}", "${mail.from}").and() | |
| 204 | .and() | |
| 205 | .to() | |
| 206 | .defaultValue().properties("${ogham.email.to.default-value}").and() | |
| 207 | .and() | |
| 208 | .cc() | |
| 209 | .defaultValue().properties("${ogham.email.cc.default-value}").and() | |
| 210 | .and() | |
| 211 | .bcc() | |
| 212 | .defaultValue().properties("${ogham.email.bcc.default-value}").and() | |
| 213 | .and() | |
| 214 | .and() | |
| 215 | .css() | |
| 216 | .inline() | |
| 217 | .jsoup() | |
| 218 | .and() | |
| 219 | .and() | |
| 220 | .images() | |
| 221 | .inline() | |
| 222 | .attach() | |
| 223 | .cid() | |
| 224 | .sequential() | |
| 225 | .and() | |
| 226 | .and() | |
| 227 | .base64().and() | |
| 228 | .and() | |
| 229 | .and() | |
| 230 | .failIfMissingVariant().defaultValue(overrideIfNotSet(true)).and() | |
| 231 | .listPossiblePaths().defaultValue(overrideIfNotSet(true)).and() | |
| 232 | .autoRetry() | |
| 233 | .fixedDelay() | |
| 234 | .maxRetries().properties("${ogham.email.send-retry.max-attempts}").and() | |
| 235 | .delay().properties("${ogham.email.send-retry.delay-between-attempts}").and() | |
| 236 | .and() | |
| 237 | .exponentialDelay() | |
| 238 | .maxRetries().properties("${ogham.email.send-retry.max-attempts}").and() | |
| 239 | .initialDelay().properties("${ogham.email.send-retry.exponential-initial-delay}").and() | |
| 240 | .and() | |
| 241 | .perExecutionDelay() | |
| 242 | .maxRetries().properties("${ogham.email.send-retry.max-attempts}").and() | |
| 243 | .delays().properties("${ogham.email.send-retry.per-execution-delays}").and() | |
| 244 | .and() | |
| 245 | .fixedInterval() | |
| 246 | .maxRetries().properties("${ogham.email.send-retry.max-attempts}").and() | |
| 247 | .interval().properties("${ogham.email.send-retry.execution-interval}").and() | |
| 248 | .and() | |
| 249 | .retryable(canResendMessage()); | |
| 250 | // @formatter:on | |
| 251 | } | |
| 252 | ||
| 253 | @Override | |
| 254 | public void configure(SmsBuilder builder) { | |
| 255 | // @formatter:off | |
| 256 | builder | |
| 257 | .autofill() | |
| 258 | .from() | |
| 259 | .defaultValue().properties("${ogham.sms.from.default-value}").and() | |
| 260 | .and() | |
| 261 | .to() | |
| 262 | .defaultValue().properties("${ogham.sms.to.default-value}").and() | |
| 263 | .and() | |
| 264 | .and() | |
| 265 | .numbers() | |
| 266 | .from() | |
| 267 | .format() | |
| 268 | .alphanumericCode().properties("${ogham.sms.from.alphanumeric-code-format.enable}").defaultValue(overrideIfNotSet(true)).and() | |
| 269 | .shortCode().properties("${ogham.sms.from.short-code-format.enable}").defaultValue(overrideIfNotSet(true)).and() | |
| 270 | .internationalNumber().properties("${ogham.sms.from.international-format.enable}").defaultValue(overrideIfNotSet(true)).and() | |
| 271 | .and() | |
| 272 | .and() | |
| 273 | .to() | |
| 274 | .format() | |
| 275 | .internationalNumber().properties("${ogham.sms.to.international-format.enable}").defaultValue(overrideIfNotSet(true)).and() | |
| 276 | .and() | |
| 277 | .and() | |
| 278 | .and() | |
| 279 | .autoRetry() | |
| 280 | .fixedDelay() | |
| 281 | .maxRetries().properties("${ogham.sms.send-retry.max-attempts}").and() | |
| 282 | .delay().properties("${ogham.sms.send-retry.delay-between-attempts}").and() | |
| 283 | .and() | |
| 284 | .exponentialDelay() | |
| 285 | .maxRetries().properties("${ogham.sms.send-retry.max-attempts}").and() | |
| 286 | .initialDelay().properties("${ogham.sms.send-retry.exponential-initial-delay}").and() | |
| 287 | .and() | |
| 288 | .perExecutionDelay() | |
| 289 | .maxRetries().properties("${ogham.sms.send-retry.max-attempts}").and() | |
| 290 | .delays().properties("${ogham.sms.send-retry.per-execution-delays}").and() | |
| 291 | .and() | |
| 292 | .fixedInterval() | |
| 293 | .maxRetries().properties("${ogham.sms.send-retry.max-attempts}").and() | |
| 294 | .interval().properties("${ogham.sms.send-retry.execution-interval}").and() | |
| 295 | .and() | |
| 296 | .retryable(canResendMessage()); | |
| 297 | // @formatter:on | |
| 298 | } | |
| 299 | ||
| 300 | @Override | |
| 301 | public void configure(MimetypeDetectionBuilder<?> builder) { | |
| 302 | // @formatter:off | |
| 303 | builder | |
| 304 | .tika() | |
| 305 | .instance(new Tika()) | |
| 306 | .failIfOctetStream().properties("${ogham.mimetype.tika.fail-if-octet-stream}").defaultValue(overrideIfNotSet(true)).and() | |
| 307 | .and() | |
| 308 | .defaultMimetype().properties("${ogham.mimetype.default-mimetype}").defaultValue(overrideIfNotSet("application/octet-stream")); | |
| 309 | // @formatter:on | |
| 310 | } | |
| 311 | ||
| 312 | protected void configureImageInliningMimetype(MimetypeDetectionBuilder<?> builder) { | |
| 313 | // @formatter:off | |
| 314 | builder | |
| 315 | .tika() | |
| 316 | .instance(new Tika()) | |
| 317 | .failIfOctetStream().defaultValue(overrideIfNotSet(true)).and() | |
| 318 | .and() | |
| 319 | .allowed().properties("${ogham.email.image-inlining.mimetype.allowed-mimetypes}").defaultValue(overrideIfNotSet(new String[] { "image/*" })); | |
| 320 | // @formatter:on | |
| 321 | } | |
| 322 | | |
| 323 | ||
| 324 | protected void addDefaultConfigLocationsForProfiles(EnvironmentBuilder<?> builder, List<String> profiles) { | |
| 325 | for (String profile : profiles) { | |
| 326 |
3
1. addDefaultConfigLocationsForProfiles : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → SURVIVED 2. addDefaultConfigLocationsForProfiles : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → NO_COVERAGE 3. addDefaultConfigLocationsForProfiles : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → KILLED |
addConfigLocations(builder, "file:config", profile); |
| 327 |
3
1. addDefaultConfigLocationsForProfiles : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → NO_COVERAGE 2. addDefaultConfigLocationsForProfiles : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → SURVIVED 3. addDefaultConfigLocationsForProfiles : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → KILLED |
addConfigLocations(builder, "classpath:config", profile); |
| 328 | } | |
| 329 | } | |
| 330 | ||
| 331 | protected void addDefaultConfigLocations(EnvironmentBuilder<?> builder) { | |
| 332 |
3
1. addDefaultConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → NO_COVERAGE 2. addDefaultConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → SURVIVED 3. addDefaultConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → KILLED |
addConfigLocations(builder, "file:config"); |
| 333 |
3
1. addDefaultConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → SURVIVED 2. addDefaultConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → NO_COVERAGE 3. addDefaultConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → KILLED |
addConfigLocations(builder, "classpath:config"); |
| 334 | } | |
| 335 | ||
| 336 | protected void addUserDefinedConfigLocations(EnvironmentBuilder<?> builder, List<String> locations) { | |
| 337 | for (String location : locations) { | |
| 338 |
3
1. addUserDefinedConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → SURVIVED 2. addUserDefinedConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → NO_COVERAGE 3. addUserDefinedConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → KILLED |
addConfigLocations(builder, location); |
| 339 | } | |
| 340 | } | |
| 341 | | |
| 342 | protected void addUserDefinedConfigLocationsForProfiles(EnvironmentBuilder<?> builder, List<String> locations, List<String> profiles) { | |
| 343 | for (String location : locations) { | |
| 344 | for (String profile : profiles) { | |
| 345 |
3
1. addUserDefinedConfigLocationsForProfiles : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → SURVIVED 2. addUserDefinedConfigLocationsForProfiles : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → NO_COVERAGE 3. addUserDefinedConfigLocationsForProfiles : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → KILLED |
addConfigLocations(builder, location, profile); |
| 346 | } | |
| 347 | } | |
| 348 | } | |
| 349 | | |
| 350 | protected void addConfigLocations(EnvironmentBuilder<?> builder, String location) { | |
| 351 |
3
1. addConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → SURVIVED 2. addConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → NO_COVERAGE 3. addConfigLocations : removed call to fr/sii/ogham/core/builder/configurer/DefaultMessagingConfigurer::addConfigLocations → KILLED |
addConfigLocations(builder, location, null); |
| 352 | } | |
| 353 | | |
| 354 | protected void addConfigLocations(EnvironmentBuilder<?> builder, String location, String profile) { | |
| 355 |
4
1. addConfigLocations : negated conditional → SURVIVED 2. addConfigLocations : negated conditional → NO_COVERAGE 3. addConfigLocations : negated conditional → KILLED 4. addConfigLocations : negated conditional → KILLED |
if (location.isEmpty()) { |
| 356 | return; | |
| 357 | } | |
| 358 |
3
1. addConfigLocations : negated conditional → NO_COVERAGE 2. addConfigLocations : negated conditional → SURVIVED 3. addConfigLocations : negated conditional → KILLED |
String suffix = profile == null ? "" : ("-" + profile); |
| 359 |
3
1. addConfigLocations : negated conditional → SURVIVED 2. addConfigLocations : negated conditional → NO_COVERAGE 3. addConfigLocations : negated conditional → KILLED |
if (suffix.isEmpty()) { |
| 360 | builder.properties("?"+location); | |
| 361 | } | |
| 362 | builder.properties("?"+location+"/ogham"+suffix+".properties"); | |
| 363 | builder.properties("?"+location+"/application"+suffix+".properties"); | |
| 364 | } | |
| 365 | } | |
Mutations | ||
| 137 |
1.1 2.2 |
|
| 138 |
1.1 2.2 |
|
| 150 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 |
|
| 164 |
1.1 2.2 3.3 |
|
| 165 |
1.1 2.2 3.3 |
|
| 166 |
1.1 2.2 3.3 |
|
| 167 |
1.1 2.2 3.3 |
|
| 188 |
1.1 2.2 3.3 |
|
| 189 |
1.1 2.2 3.3 |
|
| 190 |
1.1 2.2 3.3 |
|
| 192 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 |
|
| 326 |
1.1 2.2 3.3 |
|
| 327 |
1.1 2.2 3.3 |
|
| 332 |
1.1 2.2 3.3 |
|
| 333 |
1.1 2.2 3.3 |
|
| 338 |
1.1 2.2 3.3 |
|
| 345 |
1.1 2.2 3.3 |
|
| 351 |
1.1 2.2 3.3 |
|
| 355 |
1.1 2.2 3.3 4.4 |
|
| 358 |
1.1 2.2 3.3 |
|
| 359 |
1.1 2.2 3.3 |