Skip to content

Commit

Permalink
Merge 054a0ee into 1db605a
Browse files Browse the repository at this point in the history
  • Loading branch information
kkovarik committed Nov 8, 2018
2 parents 1db605a + 054a0ee commit 2f6a3ff
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
Expand Up @@ -26,7 +26,11 @@
import org.apache.camel.spring.boot.CamelConfigurationProperties;
import org.apache.camel.spring.boot.CamelContextConfiguration;
import org.apache.camel.spring.boot.RoutesCollector;
import org.openhubframework.openhub.api.route.WebServiceUriBuilder;
import org.openhubframework.openhub.common.OpenHubPropertyConstants;
import org.openhubframework.openhub.test.route.TestWsUriBuilder;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.*;
Expand Down Expand Up @@ -97,5 +101,17 @@ public void afterApplicationStart(CamelContext camelContext) {
}
};
}

/**
* Registration of test implementation of {@link WebServiceUriBuilder}.
*
* @see TestWsUriBuilder for more information.
*/
@Primary
@Bean
@ConditionalOnProperty(name = OpenHubPropertyConstants.PREFIX + "test.ws-uri-builder.enabled", matchIfMissing = true)
public WebServiceUriBuilder testWebServiceUriBuilder() {
return new TestWsUriBuilder();
}
}

Expand Up @@ -19,8 +19,6 @@
import javax.annotation.Nullable;
import javax.xml.namespace.QName;

import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

import org.openhubframework.openhub.api.route.WebServiceUriBuilder;
Expand All @@ -41,8 +39,6 @@
*
* @author Petr Juza
*/
@Component
@Primary
public class TestWsUriBuilder implements WebServiceUriBuilder {

public static final String URI_WS_IN = "direct:inWS_";
Expand Down Expand Up @@ -74,4 +70,4 @@ public String getInWsUri(QName qName, String endpointMappingRef, @Nullable Strin

return URI_WS_IN + qName.getLocalPart();
}
}
}
7 changes: 7 additions & 0 deletions test/src/main/resources/application-test.properties
Expand Up @@ -86,3 +86,10 @@ camel.springboot.name=camelContext
# Code of actual node for this application server instance
ohf.cluster.actualNodeInstance.code = TestNode

# ===============================
# = TEST
# ===============================
# Configurations for unit tests

# WebServiceUriBuilder for tests
ohf.test.ws-uri-builder.enabled = true

0 comments on commit 2f6a3ff

Please sign in to comment.