@Test public void testApply() { MessageBuilder<CloudRuntimeEvent<?,?>> request = MessageBuilder.withPayload(new IgnoredRuntimeEvent()); subject.apply(request); Message<CloudRuntimeEvent<?,?>> message = request.build(); assertThat(message.getHeaders()) .containsEntry(RuntimeBundleInfoMessageHeaders.APP_NAME, APP_NAME) .containsEntry(RuntimeBundleInfoMessageHeaders.SERVICE_NAME, SPRING_APP_NAME) .containsEntry(RuntimeBundleInfoMessageHeaders.SERVICE_TYPE, SERVICE_TYPE) .containsEntry(RuntimeBundleInfoMessageHeaders.SERVICE_VERSION, SERVICE_VERSION); }
@Override public <P> MessageBuilder<P> apply(MessageBuilder<P> request) { Assert.notNull(request, "request must not be null"); return request.setHeader(RuntimeBundleInfoMessageHeaders.APP_NAME, properties.getAppName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_NAME, properties.getServiceName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_FULL_NAME, properties.getServiceFullName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_TYPE, properties.getServiceType()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_VERSION, properties.getServiceVersion()); }
RuntimeBundleInfoMessageBuilderAppender implements MessageBuilderAppender { @Override public <P> MessageBuilder<P> apply(MessageBuilder<P> request) { Assert.notNull(request, "request must not be null"); return request.setHeader(RuntimeBundleInfoMessageHeaders.APP_NAME, properties.getAppName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_NAME, properties.getServiceName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_FULL_NAME, properties.getServiceFullName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_TYPE, properties.getServiceType()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_VERSION, properties.getServiceVersion()); } }
RuntimeBundleInfoMessageBuilderAppender implements MessageBuilderAppender { @Override public <P> MessageBuilder<P> apply(MessageBuilder<P> request) { Assert.notNull(request, "request must not be null"); return request.setHeader(RuntimeBundleInfoMessageHeaders.APP_NAME, properties.getAppName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_NAME, properties.getServiceName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_FULL_NAME, properties.getServiceFullName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_TYPE, properties.getServiceType()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_VERSION, properties.getServiceVersion()); } RuntimeBundleInfoMessageBuilderAppender(RuntimeBundleProperties properties); }
RuntimeBundleInfoMessageBuilderAppender implements MessageBuilderAppender { @Override public <P> MessageBuilder<P> apply(MessageBuilder<P> request) { Assert.notNull(request, "request must not be null"); return request.setHeader(RuntimeBundleInfoMessageHeaders.APP_NAME, properties.getAppName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_NAME, properties.getServiceName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_FULL_NAME, properties.getServiceFullName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_TYPE, properties.getServiceType()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_VERSION, properties.getServiceVersion()); } RuntimeBundleInfoMessageBuilderAppender(RuntimeBundleProperties properties); @Override MessageBuilder<P> apply(MessageBuilder<P> request); }
RuntimeBundleInfoMessageBuilderAppender implements MessageBuilderAppender { @Override public <P> MessageBuilder<P> apply(MessageBuilder<P> request) { Assert.notNull(request, "request must not be null"); return request.setHeader(RuntimeBundleInfoMessageHeaders.APP_NAME, properties.getAppName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_NAME, properties.getServiceName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_FULL_NAME, properties.getServiceFullName()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_TYPE, properties.getServiceType()) .setHeader(RuntimeBundleInfoMessageHeaders.SERVICE_VERSION, properties.getServiceVersion()); } RuntimeBundleInfoMessageBuilderAppender(RuntimeBundleProperties properties); @Override MessageBuilder<P> apply(MessageBuilder<P> request);  }