target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test @Parameters({"[], false", "[{\"prop\": 1}], true", "[{\"prop\": 2}], false"}) public void shouldFilterOnJsonArrayStrings(final String payload, final boolean expected) { final JsonSimplePredicate predicate = new JsonSimplePredicate("${body.size()} == 1 && ${body[0].prop} == 1", CONTEXT); assertThat(predicate.match... | @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true); final Message payload = exchangeForProce... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... |
@Test public void shouldNotUpdateComponentAccessAndRefreshTokensWithEmptyValues() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor("{\"access_token\": \"\", \"refresh_token\": \"\"}"); assertThatThrownBy(() -> processor.process(exchange)).isSameAs(exception); assertThat(processor.state.ge... | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldNotUpdateComponentAccessAndRefreshTokensWithNullValues() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor("{\"access_token\": null, \"refresh_token\": null}"); assertThatThrownBy(() -> processor.process(exchange)).isSameAs(exception); assertThat(processor.state.get... | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldNotUpdateComponentRefreshTokensWithEmptyValues() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor( "{\"access_token\": \"new-access-token\", \"refresh_token\": \"\"}"); assertThatThrownBy(() -> processor.process(exchange)).isSameAs(exception); assertThat(processor.... | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldNotUpdateComponentRefreshTokensWithNullValues() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor( "{\"access_token\": \"new-access-token\", \"refresh_token\": null}"); assertThatThrownBy(() -> processor.process(exchange)).isSameAs(exception); assertThat(processor.s... | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldRefreshSecondTimeIfWeReceivedTheSameRefreshTokenTheFirstTime() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor( "{\"access_token\": \"new-access-token\", \"refresh_token\": \"new-refresh-token\"}", "{\"access_token\": \"newer-access-token\", \"refresh_token\": \"n... | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldThrowExceptionIfAlreadyAttemptedWithTheSameRefreshToken() throws Exception { final Configuration configuration = configuration("403"); final OAuthRefreshTokenOnFailProcessor processor = new OAuthRefreshTokenOnFailProcessor(OAuthState.createFrom(configuration), configuration); processor.lastRefre... | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldThrowExceptionIfStatusIsNonRetriable() { final Configuration configuration = configuration("400"); final OAuthRefreshTokenOnFailProcessor processor = new OAuthRefreshTokenOnFailProcessor(OAuthState.createFrom(configuration), configuration); assertThatThrownBy(() -> processor.process(exchange)).i... | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldUpdateComponentAccessAndRefreshTokens() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor( "{\"access_token\": \"new-access-token\", \"refresh_token\": \"new-refresh-token\"}"); assertThatThrownBy(() -> processor.process(exchange)).isSameAs(exception); assertThat(pr... | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldUpdateComponentAccessToken() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor("{\"access_token\": \"new-access-token\"}"); assertThatThrownBy(() -> processor.process(exchange)).isSameAs(exception); assertThat(processor.state.getAccessToken()).isEqualTo("new-access-... | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldUpdateComponentRefreshTokenOnlyIfAccessTokenIsGiven() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor("{\"refresh_token\": \"new-refresh-token\"}"); assertThatThrownBy(() -> processor.process(exchange)).isSameAs(exception); assertThat(processor.state.getAccessToke... | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldFilterOnListOfJsonStrings() { final JsonSimplePredicate predicate = new JsonSimplePredicate("${body[0].prop} == 1", CONTEXT); assertThat(predicate.matches(exchangeWith(Collections.emptyList()))).isEqualTo(false); assertThat(predicate.matches(exchangeWith(Arrays.asList("{\"prop\": 1}", "{\"prop\"... | @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true); final Message payload = exchangeForProce... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... |
@Test public void shouldAllowOverideExpires() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor( "{\"access_token\": \"new-access-token\", \"refresh_token\": \"new-refresh-token\", \"expires_in\": 3600}"); processor.state.update("access-token", currentTime, null); processor.isFirstTime.set... | @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.getIn(); in.setHeader("Authorization", "Bearer " + st... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... |
@Test public void shouldNotRefreshAccessTokenIfItHasntExpired() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor( "{\"access_token\": \"new-access-token\", \"refresh_token\": \"new-refresh-token\", \"expires_in\": 3600}"); processor.state.update("access-token", currentTime + OAuthRefreshT... | @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.getIn(); in.setHeader("Authorization", "Bearer " + st... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... |
@Test public void shouldRefreshAccessTokenBeforeItExpiresUsingAheadOfTimeRefresh() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor( "{\"access_token\": \"new-access-token\", \"refresh_token\": \"new-refresh-token\", \"expires_in\": 3600}"); processor.state.update("access-token", currentT... | @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.getIn(); in.setHeader("Authorization", "Bearer " + st... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... |
@Test public void shouldRefreshAccessTokenIfItHasExpired() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor( "{\"access_token\": \"new-access-token\", \"refresh_token\": \"new-refresh-token\", \"expires_in\": 3600}"); processor.state.update("access-token", currentTime, null); processor.is... | @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.getIn(); in.setHeader("Authorization", "Bearer " + st... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... |
@Test public void shouldRefreshAccessTokenIfItsTheFirstTimeApiIsInvoked() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor( "{\"access_token\": \"new-access-token\", \"refresh_token\": \"new-refresh-token\", \"expires_in\": 3600}"); processor.state.update("access-token", currentTime + OAu... | @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.getIn(); in.setHeader("Authorization", "Bearer " + st... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... | OAuthRefreshTokenProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { if (state.getRefreshToken() != null && (isFirstTime.get() || state.getAccessTokenExpiresAt() - AHEAD_OF_TIME_REFRESH_MILIS <= now())) { tryToRefreshAccessToken(); } final Message in = exchange.get... |
@Test public void shouldSetBasicAuthorizationHeader() throws Exception { final AuthenticationCustomizer customizer = new AuthenticationCustomizer(); final Map<String, Object> options = new HashMap<>(); options.put("authenticationType", AuthenticationType.basic); options.put("username", "username"); options.put("passwor... | @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authenticationTypeObject); final AuthenticationType authenticationType = ... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... |
@Test public void shouldSetOAuth2AuthorizationHeader() throws Exception { final AuthenticationCustomizer customizer = new AuthenticationCustomizer(); final Map<String, Object> options = new HashMap<>(); options.put("authenticationType", AuthenticationType.oauth2); options.put("accessToken", "{{accessToken}}"); final Co... | @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authenticationTypeObject); final AuthenticationType authenticationType = ... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... |
@Test public void shouldSetParameterAuthenticationHeader() throws Exception { final AuthenticationCustomizer customizer = new AuthenticationCustomizer(); final Map<String, Object> options = new HashMap<>(); options.put("authenticationType", AuthenticationType.apiKey); options.put("authenticationParameterName", "apiKey"... | @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authenticationTypeObject); final AuthenticationType authenticationType = ... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... |
@Test public void shouldSetRefreshOAuth2Token() throws Exception { wiremock.givenThat(post("/oauth/authorize") .withRequestBody(equalTo("refresh_token=refresh-token&grant_type=refresh_token")) .willReturn(ok() .withBody("{\"access_token\":\"new-access-token\"}"))); final AuthenticationCustomizer customizer = new Authen... | @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authenticationTypeObject); final AuthenticationType authenticationType = ... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... |
@Test public void shouldSupportAllAuthenticationValues() { final ComponentProxyComponent component = new SwaggerProxyComponent("dataset-test", "dataset-test"); final ExtendedCamelContext context = mock(ExtendedCamelContext.class); component.setCamelContext(context); when(context.adapt(ExtendedCamelContext.class)).thenR... | @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authenticationTypeObject); final AuthenticationType authenticationType = ... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... |
@Test public void shouldAddLogProcessorWithCustomMessage() { final Step step = new Step.Builder().putConfiguredProperty("customText", "Log me baby one more time").build(); assertThat(handler.handle(step, route, NOT_USED, "1", "2")).contains(route); verify(route).log(LoggingLevel.INFO, "Log me baby one more time"); } | @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (step.getId().isPresent()) { String stepId = step.ge... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... |
@Test public void shouldSupportNamedAuthenticationValues() { final ComponentProxyComponent component = new SwaggerProxyComponent("dataset-test", "dataset-test"); final ExtendedCamelContext context = mock(ExtendedCamelContext.class); component.setCamelContext(context); when(context.adapt(ExtendedCamelContext.class)).the... | @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authenticationTypeObject); final AuthenticationType authenticationType = ... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... | AuthenticationCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) { consumeOption(options, "authenticationType", authenticationTypeObject -> { final String authenticationTypeAsString = String.valueOf(authentica... |
@Test public void retrieveQueuesListTest() { CamelContext context = new DefaultCamelContext(); AWSSNSMetaDataExtension extension = new AWSSNSMetaDataExtension(context); Map<String, Object> properties = new HashMap<>(); properties.put("accessKey", "accessKey"); properties.put("secretKey", "secretKey"); properties.put("r... | @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region = ConnectorOptions.extractOption(parameters, "region"); Amazo... | AWSSNSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSNSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSNSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSNSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... |
@Test public void noChannelTest() { CamelContext context = new DefaultCamelContext(); AWSSNSMetaDataExtension extension = new AWSSNSMetaDataExtension(context); Map<String, Object> properties = new HashMap<>(); properties.put("webhookurl", "token"); Optional<MetaDataExtension.MetaData> meta = extension.meta(properties);... | @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region = ConnectorOptions.extractOption(parameters, "region"); Amazo... | AWSSNSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSNSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSNSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSNSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... |
@Test public void generateJavaInspectionTest() throws Exception { DataShape source = new DataShape.Builder() .type(MyShape.class.getTypeName()) .kind(DataShapeKinds.JAVA) .build(); DataShape enriched = GenerateConnectorInspectionsMojo.generateInspections(new URL[0], source); assertThat(enriched.getSpecification()).isNo... | private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()) { Optional<DataShape> inputDataShape = action.getDescr... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... |
@Test public void generateJavaCollectionInspectionTest() throws Exception { DataShape source = new DataShape.Builder() .type(MyShape.class.getTypeName()) .kind(DataShapeKinds.JAVA) .collectionType(CollectionType.LIST.value()) .collectionClassName(ArrayList.class.getName()) .build(); DataShape enriched = GenerateConnect... | private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()) { Optional<DataShape> inputDataShape = action.getDescr... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... |
@Test public void generateJavaInspectionWithCompressionTest() throws Exception { DataShape source1 = new DataShape.Builder() .type(MyShape.class.getTypeName()) .kind(DataShapeKinds.JAVA) .build(); DataShape source2 = new DataShape.Builder() .type(MyShape.class.getTypeName()) .kind(DataShapeKinds.JAVA) .putMetadata(Data... | private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()) { Optional<DataShape> inputDataShape = action.getDescr... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... |
@Test public void generateJavaInspectionWithVariantTest() throws Exception { DataShape source = new DataShape.Builder() .type(MyShape.class.getTypeName()) .kind(DataShapeKinds.JAVA) .name("collection") .collectionType(CollectionType.LIST.value()) .collectionClassName(ArrayList.class.getName()) .putMetadata(DataShapeMet... | private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()) { Optional<DataShape> inputDataShape = action.getDescr... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... | GenerateConnectorInspectionsMojo extends AbstractMojo { private List<ConnectorAction> generateInspections(Connector connector) throws IOException, DependencyResolutionRequiredException, ClassNotFoundException { final List<ConnectorAction> actions = new ArrayList<>(); for (ConnectorAction action : connector.getActions()... |
@Test public void validFileAgainstSchema() throws Exception { GenerateConnectorInspectionsMojo mojo = new GenerateConnectorInspectionsMojo(); JsonNode jsonNode = mojo.validateWithSchema(getFile("/my-test-connector.json")); assertNotNull(jsonNode); } | public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.validate(jsonNode, true); if (! report.isSuccess()) { for (... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... |
@Test public void unformedFileAgainstSchema() throws Exception { GenerateConnectorInspectionsMojo mojo = new GenerateConnectorInspectionsMojo(); String unformedConnectorFile = "my-unformed-connector.json"; assertThatExceptionOfType(MojoExecutionException.class) .isThrownBy(() -> { mojo.validateWithSchema(getFile("/" + ... | public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.validate(jsonNode, true); if (! report.isSuccess()) { for (... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... |
@Test public void invalidFileAgainstSchema() throws Exception { GenerateConnectorInspectionsMojo mojo = new GenerateConnectorInspectionsMojo(); String invalidConnectorFile = "my-invalid-connector.json"; assertThatExceptionOfType(MojoExecutionException.class) .isThrownBy(() -> { mojo.validateWithSchema(getFile("/" + inv... | public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.validate(jsonNode, true); if (! report.isSuccess()) { for (... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... | GenerateConnectorInspectionsMojo extends AbstractMojo { public JsonNode validateWithSchema(File jsonFile) throws MojoExecutionException { InputStream jsonStream = null; try { jsonStream = new FileInputStream(jsonFile); JsonNode jsonNode = JsonUtils.reader().readTree(jsonStream); ProcessingReport report = jsonSchema.val... |
@Test public void shouldAddLogProcessorWithCustomMessageAndStepId() { final Step step = new Step.Builder().id("step-id") .putConfiguredProperty("customText", "Log me baby one more time").build(); assertThat(handler.handle(step, route, NOT_USED, "1", "2")).contains(route); verify(route).log(LoggingLevel.INFO, (String) n... | @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (step.getId().isPresent()) { String stepId = step.ge... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... |
@Test public void testStore() throws Exception { final KeyStoreHelper helper = new KeyStoreHelper(CertificateUtilTest.TEST_CERT, "test-cert"); helper.store(); assertThat(helper.getKeyStorePath()).isNotEmpty(); assertThat(helper.getPassword()).isNotEmpty(); } | public KeyStoreHelper store() { try { KeyStore keyStore = CertificateUtil.createKeyStore(certificate, alias); tempFile = Files.createTempFile(alias, ".ks", PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-------"))); password = generatePassword(); try (OutputStream stream = new FileOutputStream(... | KeyStoreHelper { public KeyStoreHelper store() { try { KeyStore keyStore = CertificateUtil.createKeyStore(certificate, alias); tempFile = Files.createTempFile(alias, ".ks", PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-------"))); password = generatePassword(); try (OutputStream stream = new ... | KeyStoreHelper { public KeyStoreHelper store() { try { KeyStore keyStore = CertificateUtil.createKeyStore(certificate, alias); tempFile = Files.createTempFile(alias, ".ks", PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-------"))); password = generatePassword(); try (OutputStream stream = new ... | KeyStoreHelper { public KeyStoreHelper store() { try { KeyStore keyStore = CertificateUtil.createKeyStore(certificate, alias); tempFile = Files.createTempFile(alias, ".ks", PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-------"))); password = generatePassword(); try (OutputStream stream = new ... | KeyStoreHelper { public KeyStoreHelper store() { try { KeyStore keyStore = CertificateUtil.createKeyStore(certificate, alias); tempFile = Files.createTempFile(alias, ".ks", PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-------"))); password = generatePassword(); try (OutputStream stream = new ... |
@Test public void testStringValue() { put(key, value); assertEquals(value, ConnectorOptions.extractOption(parameters, key)); assertNull(ConnectorOptions.extractOption(parameters, missingKey)); } | public static String extractOption(Map<String, ?> options, String key, String defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .orElse(defaultValue); } | ConnectorOptions { public static String extractOption(Map<String, ?> options, String key, String defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .orElse(defaultValue); } } | ConnectorOptions { public static String extractOption(Map<String, ?> options, String key, String defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .orElse(defaultValue); } private ConnectorOptions(); } | ConnectorOptions { public static String extractOption(Map<String, ?> options, String key, String defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .orElse(defaultValue); } private ConnectorOptions(); static Str... | ConnectorOptions { public static String extractOption(Map<String, ?> options, String key, String defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .orElse(defaultValue); } private ConnectorOptions(); static Str... |
@Test public void testStringValueWithDefault() { String defaultValue = "defaultValue"; put(key, value); assertEquals(value, ConnectorOptions.extractOption(parameters, key, defaultValue)); assertEquals(defaultValue, ConnectorOptions.extractOption(parameters, missingKey, defaultValue)); } | public static String extractOption(Map<String, ?> options, String key, String defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .orElse(defaultValue); } | ConnectorOptions { public static String extractOption(Map<String, ?> options, String key, String defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .orElse(defaultValue); } } | ConnectorOptions { public static String extractOption(Map<String, ?> options, String key, String defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .orElse(defaultValue); } private ConnectorOptions(); } | ConnectorOptions { public static String extractOption(Map<String, ?> options, String key, String defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .orElse(defaultValue); } private ConnectorOptions(); static Str... | ConnectorOptions { public static String extractOption(Map<String, ?> options, String key, String defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .orElse(defaultValue); } private ConnectorOptions(); static Str... |
@Test public void testStringValueAndMap() throws Exception { put(key, value); assertEquals((Long) 1L, ConnectorOptions.extractOptionAndMap(parameters, key, this::convertLong)); assertNull(ConnectorOptions.extractOptionAndMap(parameters, missingKey, this::convertLong)); } | public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .orElse(defaultValue);... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... |
@Test public void testStringValueAndMapWithDefault() { Long defaultValue = 2L; put(key, value); assertEquals((Long) 1L, ConnectorOptions.extractOptionAndMap(parameters, key, this::convertLong, defaultValue)); assertEquals(defaultValue, ConnectorOptions.extractOptionAndMap(parameters, missingKey, this::convertLong, defa... | public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .orElse(defaultValue);... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... |
@Test public void testStringValueAndMapToBooleanWithDefault() { put(key, Boolean.toString(true)); assertEquals(Boolean.TRUE, ConnectorOptions.extractOptionAndMap(parameters, key, Boolean::valueOf, false)); assertEquals(Boolean.FALSE, ConnectorOptions.extractOptionAndMap(parameters, missingKey, Boolean::valueOf, false))... | public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .orElse(defaultValue);... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... |
@Test public void testStringValueAndMapToIntWithDefault() throws Exception { put(key, 2); assertTrue(2 == ConnectorOptions.extractOptionAndMap(parameters, key, Integer::parseInt, 3)); assertTrue(3 == ConnectorOptions.extractOptionAndMap(parameters, missingKey, Integer::parseInt, 3)); put(key, "NotAnInt"); assertTrue(-1... | public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .orElse(defaultValue);... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... | ConnectorOptions { public static <T> T extractOptionAndMap(Map<String, ?> options, String key, Function<? super String, T> mappingFn, T defaultValue) { if (options == null) { return defaultValue; } try { return Optional.ofNullable(options.get(key)) .map(Object::toString) .filter(v -> v.length() > 0) .map(mappingFn) .or... |
@Test public void testValueAndConsumer() { put(key, value); final int[] cRun = new int[1]; final int[] success = new int[1]; Consumer<String> c = (String v) -> { cRun[0] = 1; if (v.equals(value)) { success[0] = 1; } }; cRun[0] = 0; success[0] = 0; ConnectorOptions.extractOptionAndConsume(parameters, key, c); assertEqua... | public static void extractOptionAndConsume(Map<String, ?> options, String key, Consumer<String> consumer) { if (options == null) { return; } try { Optional.ofNullable(options.get(key)) .map(Object::toString) .ifPresent(consumer); } catch (Exception ex) { LOG.error("Evaluation of option '" + key + "' failed.", ex); } } | ConnectorOptions { public static void extractOptionAndConsume(Map<String, ?> options, String key, Consumer<String> consumer) { if (options == null) { return; } try { Optional.ofNullable(options.get(key)) .map(Object::toString) .ifPresent(consumer); } catch (Exception ex) { LOG.error("Evaluation of option '" + key + "' ... | ConnectorOptions { public static void extractOptionAndConsume(Map<String, ?> options, String key, Consumer<String> consumer) { if (options == null) { return; } try { Optional.ofNullable(options.get(key)) .map(Object::toString) .ifPresent(consumer); } catch (Exception ex) { LOG.error("Evaluation of option '" + key + "' ... | ConnectorOptions { public static void extractOptionAndConsume(Map<String, ?> options, String key, Consumer<String> consumer) { if (options == null) { return; } try { Optional.ofNullable(options.get(key)) .map(Object::toString) .ifPresent(consumer); } catch (Exception ex) { LOG.error("Evaluation of option '" + key + "' ... | ConnectorOptions { public static void extractOptionAndConsume(Map<String, ?> options, String key, Consumer<String> consumer) { if (options == null) { return; } try { Optional.ofNullable(options.get(key)) .map(Object::toString) .ifPresent(consumer); } catch (Exception ex) { LOG.error("Evaluation of option '" + key + "' ... |
@Test public void testTypedValue() { Colours redValue = Colours.RED; put(key, redValue); assertEquals(redValue, ConnectorOptions.extractOptionAsType(parameters, key, Colours.class)); assertNull(ConnectorOptions.extractOptionAsType(parameters, missingKey, Colours.class)); } | public static <T> T extractOptionAsType(Map<String, ?> options, String key, Class<T> requiredClass, T defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .filter(requiredClass::isInstance) .map(requiredClass::cast) .orElse(defaultValue); } | ConnectorOptions { public static <T> T extractOptionAsType(Map<String, ?> options, String key, Class<T> requiredClass, T defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .filter(requiredClass::isInstance) .map(requiredClass::cast) .orElse(defaultValue); } } | ConnectorOptions { public static <T> T extractOptionAsType(Map<String, ?> options, String key, Class<T> requiredClass, T defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .filter(requiredClass::isInstance) .map(requiredClass::cast) .orElse(defaultValue); } privat... | ConnectorOptions { public static <T> T extractOptionAsType(Map<String, ?> options, String key, Class<T> requiredClass, T defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .filter(requiredClass::isInstance) .map(requiredClass::cast) .orElse(defaultValue); } privat... | ConnectorOptions { public static <T> T extractOptionAsType(Map<String, ?> options, String key, Class<T> requiredClass, T defaultValue) { if (options == null) { return defaultValue; } return Optional.ofNullable(options.get(key)) .filter(requiredClass::isInstance) .map(requiredClass::cast) .orElse(defaultValue); } privat... |
@Test public void testCreateKeyManagers() throws Exception { final KeyManager[] keyManagers = CertificateUtil.createKeyManagers(TEST_CERT, "test-cert"); assertThat(keyManagers).isNotNull().isNotEmpty(); } | public static KeyManager[] createKeyManagers(String clientCertificate, String alias) throws GeneralSecurityException, IOException { final KeyStore clientKs = createKeyStore(clientCertificate, alias); KeyManagerFactory kmFactory = KeyManagerFactory.getInstance("PKIX"); kmFactory.init(clientKs, null); return kmFactory.ge... | CertificateUtil { public static KeyManager[] createKeyManagers(String clientCertificate, String alias) throws GeneralSecurityException, IOException { final KeyStore clientKs = createKeyStore(clientCertificate, alias); KeyManagerFactory kmFactory = KeyManagerFactory.getInstance("PKIX"); kmFactory.init(clientKs, null); r... | CertificateUtil { public static KeyManager[] createKeyManagers(String clientCertificate, String alias) throws GeneralSecurityException, IOException { final KeyStore clientKs = createKeyStore(clientCertificate, alias); KeyManagerFactory kmFactory = KeyManagerFactory.getInstance("PKIX"); kmFactory.init(clientKs, null); r... | CertificateUtil { public static KeyManager[] createKeyManagers(String clientCertificate, String alias) throws GeneralSecurityException, IOException { final KeyStore clientKs = createKeyStore(clientCertificate, alias); KeyManagerFactory kmFactory = KeyManagerFactory.getInstance("PKIX"); kmFactory.init(clientKs, null); r... | CertificateUtil { public static KeyManager[] createKeyManagers(String clientCertificate, String alias) throws GeneralSecurityException, IOException { final KeyStore clientKs = createKeyStore(clientCertificate, alias); KeyManagerFactory kmFactory = KeyManagerFactory.getInstance("PKIX"); kmFactory.init(clientKs, null); r... |
@Test public void shouldGenerateMessages() { final Step step = new Step.Builder().putConfiguredProperty("customText", "Log me baby one more time").build(); assertThat(LogStepHandler.createMessage(step)).isEqualTo("Log me baby one more time"); final Step withContext = new Step.Builder().createFrom(step) .putConfiguredPr... | static String createMessage(Step l) { StringBuilder sb = new StringBuilder(128); String customText = getCustomText(l.getConfiguredProperties()); boolean isContextLoggingEnabled = isContextLoggingEnabled(l.getConfiguredProperties()); boolean isBodyLoggingEnabled = isBodyLoggingEnabled(l.getConfiguredProperties()); if (i... | LogStepHandler implements IntegrationStepHandler { static String createMessage(Step l) { StringBuilder sb = new StringBuilder(128); String customText = getCustomText(l.getConfiguredProperties()); boolean isContextLoggingEnabled = isContextLoggingEnabled(l.getConfiguredProperties()); boolean isBodyLoggingEnabled = isBod... | LogStepHandler implements IntegrationStepHandler { static String createMessage(Step l) { StringBuilder sb = new StringBuilder(128); String customText = getCustomText(l.getConfiguredProperties()); boolean isContextLoggingEnabled = isContextLoggingEnabled(l.getConfiguredProperties()); boolean isBodyLoggingEnabled = isBod... | LogStepHandler implements IntegrationStepHandler { static String createMessage(Step l) { StringBuilder sb = new StringBuilder(128); String customText = getCustomText(l.getConfiguredProperties()); boolean isContextLoggingEnabled = isContextLoggingEnabled(l.getConfiguredProperties()); boolean isBodyLoggingEnabled = isBod... | LogStepHandler implements IntegrationStepHandler { static String createMessage(Step l) { StringBuilder sb = new StringBuilder(128); String customText = getCustomText(l.getConfiguredProperties()); boolean isContextLoggingEnabled = isContextLoggingEnabled(l.getConfiguredProperties()); boolean isBodyLoggingEnabled = isBod... |
@Test public void testCreateTrustManagers() throws Exception { final TrustManager[] trustManagers = CertificateUtil.createTrustManagers(TEST_CERT, "test-cert"); assertThat(trustManagers).isNotNull().isNotEmpty(); } | public static TrustManager[] createTrustManagers(String brokerCertificate, String alias) throws GeneralSecurityException, IOException { TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("X509"); trustManagerFactory.init(createKeyStore(brokerCertificate, alias)); return trustManagerFactory.getTru... | CertificateUtil { public static TrustManager[] createTrustManagers(String brokerCertificate, String alias) throws GeneralSecurityException, IOException { TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("X509"); trustManagerFactory.init(createKeyStore(brokerCertificate, alias)); return trustMan... | CertificateUtil { public static TrustManager[] createTrustManagers(String brokerCertificate, String alias) throws GeneralSecurityException, IOException { TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("X509"); trustManagerFactory.init(createKeyStore(brokerCertificate, alias)); return trustMan... | CertificateUtil { public static TrustManager[] createTrustManagers(String brokerCertificate, String alias) throws GeneralSecurityException, IOException { TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("X509"); trustManagerFactory.init(createKeyStore(brokerCertificate, alias)); return trustMan... | CertificateUtil { public static TrustManager[] createTrustManagers(String brokerCertificate, String alias) throws GeneralSecurityException, IOException { TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("X509"); trustManagerFactory.init(createKeyStore(brokerCertificate, alias)); return trustMan... |
@Test public void shouldUnwrapArrayResponses() throws Exception { final Message in = new DefaultMessage(camelContext); exchange.setIn(in); in.setBody("{\"body\":[{\"b1\":\"c1\"},{\"b2\":\"c2\"}]}"); processor.process(exchange); assertThat(in.getBody()).isEqualTo("[{\"b1\":\"c1\"},{\"b2\":\"c2\"}]"); } | @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("parameters"); final JsonNode bodyData = data.get("body"); if... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... |
@Test public void shouldUnwrapResponses() throws Exception { final Message in = new DefaultMessage(camelContext); exchange.setIn(in); in.setBody("{\"parameters\":{\"h1\":\"v1\",\"h3\":\"v3\"},\"body\":{\"b1\":\"c1\",\"b2\":\"c2\"}}"); processor.process(exchange); assertThat(in.getHeaders()).containsOnly(entry("h1", "v1... | @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("parameters"); final JsonNode bodyData = data.get("body"); if... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... |
@Test public void simpleNonStringValuesShouldBeUnwrappedVerbatim() throws Exception { final Message in = new DefaultMessage(camelContext); exchange.setIn(in); in.setBody("{\"body\":123}"); processor.process(exchange); assertThat(in.getHeaders()).containsOnly(entry(Exchange.CONTENT_TYPE, "text/plain")); assertThat(in.ge... | @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("parameters"); final JsonNode bodyData = data.get("body"); if... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... |
@Test public void simpleValuesShouldBeUnwrappedVerbatim() throws Exception { final Message in = new DefaultMessage(camelContext); exchange.setIn(in); in.setBody("{\"body\":\"simple\"}"); processor.process(exchange); assertThat(in.getHeaders()).containsOnly(entry(Exchange.CONTENT_TYPE, "text/plain")); assertThat(in.getB... | @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("parameters"); final JsonNode bodyData = data.get("body"); if... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... | HttpRequestUnwrapperProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final JsonNode data = parseBody(body); if (data == null) { return; } final JsonNode paramMap = data.get("paramet... |
@Test public void shouldMapValuesFromMessageHeaders() throws Exception { String schemaStr = JsonUtils.writer().forType(JsonSchema.class).writeValueAsString(schema); JsonNode schemaNode = JsonUtils.reader().forType(JsonNode.class).readTree(schemaStr); final HttpRequestWrapperProcessor processor = new HttpRequestWrapperP... | @Override @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void process(Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final ObjectNode rootNode = JsonUtils.copyObjectMapperConfiguration().createObjectNode(); if (!parameters.i... | HttpRequestWrapperProcessor implements Processor { @Override @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void process(Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final ObjectNode rootNode = JsonUtils.copyObjectMapperCo... | HttpRequestWrapperProcessor implements Processor { @Override @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void process(Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final ObjectNode rootNode = JsonUtils.copyObjectMapperCo... | HttpRequestWrapperProcessor implements Processor { @Override @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void process(Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final ObjectNode rootNode = JsonUtils.copyObjectMapperCo... | HttpRequestWrapperProcessor implements Processor { @Override @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void process(Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final ObjectNode rootNode = JsonUtils.copyObjectMapperCo... |
@Test public void shouldMapValuesFromHttpRequest() throws Exception { final String schemaStr = JsonUtils.writer().forType(JsonSchema.class).writeValueAsString(schema); final JsonNode schemaNode = JsonUtils.reader().forType(JsonNode.class).readTree(schemaStr); final HttpRequestWrapperProcessor processor = new HttpReques... | @Override @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void process(Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final ObjectNode rootNode = JsonUtils.copyObjectMapperConfiguration().createObjectNode(); if (!parameters.i... | HttpRequestWrapperProcessor implements Processor { @Override @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void process(Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final ObjectNode rootNode = JsonUtils.copyObjectMapperCo... | HttpRequestWrapperProcessor implements Processor { @Override @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void process(Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final ObjectNode rootNode = JsonUtils.copyObjectMapperCo... | HttpRequestWrapperProcessor implements Processor { @Override @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void process(Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final ObjectNode rootNode = JsonUtils.copyObjectMapperCo... | HttpRequestWrapperProcessor implements Processor { @Override @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void process(Exchange exchange) throws Exception { final Message message = exchange.getIn(); final Object body = message.getBody(); final ObjectNode rootNode = JsonUtils.copyObjectMapperCo... |
@Test public void testJsonToMap() { assertThat(errorResponseCodeMappings.size()).isEqualTo(4); assertThat(errorResponseCodeMappings.containsKey("SQL_CONNECTOR_ERROR")).isTrue(); } | public static Map<String, Integer> jsonToMap(String property) { try { if (ObjectHelper.isEmpty(property)) { return Collections.emptyMap(); } return JsonUtils.reader().forType(STRING_MAP_TYPE).readValue(property); } catch (IOException e) { LOG.warn(String.format("Failed to read error code mapping property %s: %s", prope... | ErrorMapper { public static Map<String, Integer> jsonToMap(String property) { try { if (ObjectHelper.isEmpty(property)) { return Collections.emptyMap(); } return JsonUtils.reader().forType(STRING_MAP_TYPE).readValue(property); } catch (IOException e) { LOG.warn(String.format("Failed to read error code mapping property ... | ErrorMapper { public static Map<String, Integer> jsonToMap(String property) { try { if (ObjectHelper.isEmpty(property)) { return Collections.emptyMap(); } return JsonUtils.reader().forType(STRING_MAP_TYPE).readValue(property); } catch (IOException e) { LOG.warn(String.format("Failed to read error code mapping property ... | ErrorMapper { public static Map<String, Integer> jsonToMap(String property) { try { if (ObjectHelper.isEmpty(property)) { return Collections.emptyMap(); } return JsonUtils.reader().forType(STRING_MAP_TYPE).readValue(property); } catch (IOException e) { LOG.warn(String.format("Failed to read error code mapping property ... | ErrorMapper { public static Map<String, Integer> jsonToMap(String property) { try { if (ObjectHelper.isEmpty(property)) { return Collections.emptyMap(); } return JsonUtils.reader().forType(STRING_MAP_TYPE).readValue(property); } catch (IOException e) { LOG.warn(String.format("Failed to read error code mapping property ... |
@Test public void testEmptyMap() { SyndesisConnectorException sce = new SyndesisConnectorException("SQL_CONNECTOR_ERROR", "error msg test"); ErrorStatusInfo info = ErrorMapper.mapError(sce, Collections.emptyMap(), 200); assertThat(info.getHttpResponseCode()).isEqualTo(200); assertThat(info.getCategory()).isEqualTo("SQL... | public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException(exception, ht... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... |
@Test public void testSyndesisEntityNotFOund() { Exception e = new SyndesisConnectorException("SQL_ENTITY_NOT_FOUND_ERROR", "entity not found"); ErrorStatusInfo info = ErrorMapper.mapError(e, errorResponseCodeMappings, 200); assertThat(info.getHttpResponseCode()).isEqualTo(404); assertThat(info.getCategory()).isEqualTo... | public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException(exception, ht... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... |
@Test public void shouldNotAddLogProcessorWhenNotingIsSpecifiedToLog() { final Step step = new Step.Builder().build(); assertThat(handler.handle(step, route, NOT_USED, "1", "2")).isEmpty(); verifyZeroInteractions(route); } | @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (step.getId().isPresent()) { String stepId = step.ge... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... | LogStepHandler implements IntegrationStepHandler { @Override public Optional<ProcessorDefinition<?>> handle(Step step, ProcessorDefinition<?> route, IntegrationRouteBuilder builder, String flowIndex, String stepIndex) { final String message = createMessage(step); if (message.isEmpty()) { return Optional.empty(); } if (... |
@Test public void shouldPerformFiltering() throws ArtifactFilterException { final Set<Artifact> given = new HashSet<>(); given.add(included1); given.add(excluded); given.add(included2); assertThat(filter.filter(given)).containsOnly(included1, included2); } | @Override public Set<Artifact> filter(final Set<Artifact> artifacts) throws ArtifactFilterException { final Set<Artifact> included = new HashSet<>(); for (final Artifact given : artifacts) { if (isArtifactIncluded(given)) { included.add(given); } } return included; } | ExcludeFilter implements ArtifactsFilter { @Override public Set<Artifact> filter(final Set<Artifact> artifacts) throws ArtifactFilterException { final Set<Artifact> included = new HashSet<>(); for (final Artifact given : artifacts) { if (isArtifactIncluded(given)) { included.add(given); } } return included; } } | ExcludeFilter implements ArtifactsFilter { @Override public Set<Artifact> filter(final Set<Artifact> artifacts) throws ArtifactFilterException { final Set<Artifact> included = new HashSet<>(); for (final Artifact given : artifacts) { if (isArtifactIncluded(given)) { included.add(given); } } return included; } ExcludeFi... | ExcludeFilter implements ArtifactsFilter { @Override public Set<Artifact> filter(final Set<Artifact> artifacts) throws ArtifactFilterException { final Set<Artifact> included = new HashSet<>(); for (final Artifact given : artifacts) { if (isArtifactIncluded(given)) { included.add(given); } } return included; } ExcludeFi... | ExcludeFilter implements ArtifactsFilter { @Override public Set<Artifact> filter(final Set<Artifact> artifacts) throws ArtifactFilterException { final Set<Artifact> included = new HashSet<>(); for (final Artifact given : artifacts) { if (isArtifactIncluded(given)) { included.add(given); } } return included; } ExcludeFi... |
@Test public void testUnmappedException() { Exception e = new Exception("Unmapped Exception"); ErrorStatusInfo info = ErrorMapper.mapError(e, errorResponseCodeMappings, 200); assertThat(info.getHttpResponseCode()).isEqualTo(500); assertThat(info.getCategory()).isEqualTo(ErrorCategory.SERVER_ERROR); assertThat(info.getM... | public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException(exception, ht... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... |
@Test public void testFileAlreadyExistsException() { Exception e = new FileAlreadyExistsException("myfile"); ErrorStatusInfo info = ErrorMapper.mapError(e, errorResponseCodeMappings, 200); assertThat(info.getHttpResponseCode()).isEqualTo(500); assertThat(info.getCategory()).isEqualTo("SERVER_ERROR"); assertThat(info.ge... | public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException(exception, ht... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... | ErrorMapper { public static ErrorStatusInfo mapError(final Exception exception, final Map<String, Integer> httpResponseCodeMappings, final Integer defaultResponseCode) { SyndesisConnectorException sce; if (isOrCausedBySyndesisConnectorException(exception)) { sce = extract(exception); } else { sce = fromRuntimeException... |
@Test public void includeResourcesInBundle() throws Exception { Path bundle = FileSystems.getDefault().getPath("target/classes/META-INF/syndesis/schemas/dstu3/bundle.json"); String inspection; try (InputStream fileIn = Files.newInputStream(bundle)) { inspection = IOUtils.toString(fileIn, StandardCharsets.UTF_8); } Stri... | static String includeResources(String specification, String... resourceTypes) throws IOException { if (resourceTypes != null && resourceTypes.length != 0) { XmlDocument document = MAPPER.readValue(specification, XmlDocument.class); includeResources(null, document, resourceTypes); return MAPPER.writer((PrettyPrinter) nu... | FhirMetadataRetrieval extends ComponentMetadataRetrieval { static String includeResources(String specification, String... resourceTypes) throws IOException { if (resourceTypes != null && resourceTypes.length != 0) { XmlDocument document = MAPPER.readValue(specification, XmlDocument.class); includeResources(null, docume... | FhirMetadataRetrieval extends ComponentMetadataRetrieval { static String includeResources(String specification, String... resourceTypes) throws IOException { if (resourceTypes != null && resourceTypes.length != 0) { XmlDocument document = MAPPER.readValue(specification, XmlDocument.class); includeResources(null, docume... | FhirMetadataRetrieval extends ComponentMetadataRetrieval { static String includeResources(String specification, String... resourceTypes) throws IOException { if (resourceTypes != null && resourceTypes.length != 0) { XmlDocument document = MAPPER.readValue(specification, XmlDocument.class); includeResources(null, docume... | FhirMetadataRetrieval extends ComponentMetadataRetrieval { static String includeResources(String specification, String... resourceTypes) throws IOException { if (resourceTypes != null && resourceTypes.length != 0) { XmlDocument document = MAPPER.readValue(specification, XmlDocument.class); includeResources(null, docume... |
@Test public void includeResourcesInPatient() throws Exception { Path patient = FileSystems.getDefault().getPath("target/classes/META-INF/syndesis/schemas/dstu3/patient.json"); String inspection; try (InputStream fileIn = Files.newInputStream(patient)) { inspection = IOUtils.toString(fileIn, StandardCharsets.UTF_8); } ... | static String includeResources(String specification, String... resourceTypes) throws IOException { if (resourceTypes != null && resourceTypes.length != 0) { XmlDocument document = MAPPER.readValue(specification, XmlDocument.class); includeResources(null, document, resourceTypes); return MAPPER.writer((PrettyPrinter) nu... | FhirMetadataRetrieval extends ComponentMetadataRetrieval { static String includeResources(String specification, String... resourceTypes) throws IOException { if (resourceTypes != null && resourceTypes.length != 0) { XmlDocument document = MAPPER.readValue(specification, XmlDocument.class); includeResources(null, docume... | FhirMetadataRetrieval extends ComponentMetadataRetrieval { static String includeResources(String specification, String... resourceTypes) throws IOException { if (resourceTypes != null && resourceTypes.length != 0) { XmlDocument document = MAPPER.readValue(specification, XmlDocument.class); includeResources(null, docume... | FhirMetadataRetrieval extends ComponentMetadataRetrieval { static String includeResources(String specification, String... resourceTypes) throws IOException { if (resourceTypes != null && resourceTypes.length != 0) { XmlDocument document = MAPPER.readValue(specification, XmlDocument.class); includeResources(null, docume... | FhirMetadataRetrieval extends ComponentMetadataRetrieval { static String includeResources(String specification, String... resourceTypes) throws IOException { if (resourceTypes != null && resourceTypes.length != 0) { XmlDocument document = MAPPER.readValue(specification, XmlDocument.class); includeResources(null, docume... |
@Test public void testGetIntegrationMetricsSummary() throws Exception { final IntegrationMetricsSummary summary = metricsProvider.getIntegrationMetricsSummary(TEST_INTEGRATION_ID); assertThat(summary.getMessages()).isNotNull(); final Optional<List<IntegrationDeploymentMetrics>> deploymentMetrics = summary .getIntegrati... | @Override public IntegrationMetricsSummary getIntegrationMetricsSummary(String integrationId) { final Map<String, Long> totalMessagesMap = getMetricValues(integrationId, METRIC_TOTAL, deploymentVersionLabel, Long.class, PrometheusMetricsProviderImpl::sum); final Map<String, Long> failedMessagesMap = getMetricValues(int... | PrometheusMetricsProviderImpl implements MetricsProvider { @Override public IntegrationMetricsSummary getIntegrationMetricsSummary(String integrationId) { final Map<String, Long> totalMessagesMap = getMetricValues(integrationId, METRIC_TOTAL, deploymentVersionLabel, Long.class, PrometheusMetricsProviderImpl::sum); fina... | PrometheusMetricsProviderImpl implements MetricsProvider { @Override public IntegrationMetricsSummary getIntegrationMetricsSummary(String integrationId) { final Map<String, Long> totalMessagesMap = getMetricValues(integrationId, METRIC_TOTAL, deploymentVersionLabel, Long.class, PrometheusMetricsProviderImpl::sum); fina... | PrometheusMetricsProviderImpl implements MetricsProvider { @Override public IntegrationMetricsSummary getIntegrationMetricsSummary(String integrationId) { final Map<String, Long> totalMessagesMap = getMetricValues(integrationId, METRIC_TOTAL, deploymentVersionLabel, Long.class, PrometheusMetricsProviderImpl::sum); fina... | PrometheusMetricsProviderImpl implements MetricsProvider { @Override public IntegrationMetricsSummary getIntegrationMetricsSummary(String integrationId) { final Map<String, Long> totalMessagesMap = getMetricValues(integrationId, METRIC_TOTAL, deploymentVersionLabel, Long.class, PrometheusMetricsProviderImpl::sum); fina... |
@Test public void testGetTotalIntegrationMetricsSummary() throws Exception { final IntegrationMetricsSummary summary = metricsProvider.getTotalIntegrationMetricsSummary(); assertThat(summary.getMessages()).isNotNull(); final Optional<List<IntegrationDeploymentMetrics>> deploymentMetrics = summary .getIntegrationDeploym... | @Override public IntegrationMetricsSummary getTotalIntegrationMetricsSummary() { final Optional<Long> totalMessages = getSummaryMetricValue(METRIC_TOTAL, Long.class, "sum"); final Optional<Long> failedMessages = getSummaryMetricValue(METRIC_FAILED, Long.class, "sum"); final List<Pod> serverList = openShiftClient.pods()... | PrometheusMetricsProviderImpl implements MetricsProvider { @Override public IntegrationMetricsSummary getTotalIntegrationMetricsSummary() { final Optional<Long> totalMessages = getSummaryMetricValue(METRIC_TOTAL, Long.class, "sum"); final Optional<Long> failedMessages = getSummaryMetricValue(METRIC_FAILED, Long.class, ... | PrometheusMetricsProviderImpl implements MetricsProvider { @Override public IntegrationMetricsSummary getTotalIntegrationMetricsSummary() { final Optional<Long> totalMessages = getSummaryMetricValue(METRIC_TOTAL, Long.class, "sum"); final Optional<Long> failedMessages = getSummaryMetricValue(METRIC_FAILED, Long.class, ... | PrometheusMetricsProviderImpl implements MetricsProvider { @Override public IntegrationMetricsSummary getTotalIntegrationMetricsSummary() { final Optional<Long> totalMessages = getSummaryMetricValue(METRIC_TOTAL, Long.class, "sum"); final Optional<Long> failedMessages = getSummaryMetricValue(METRIC_FAILED, Long.class, ... | PrometheusMetricsProviderImpl implements MetricsProvider { @Override public IntegrationMetricsSummary getTotalIntegrationMetricsSummary() { final Optional<Long> totalMessages = getSummaryMetricValue(METRIC_TOTAL, Long.class, "sum"); final Optional<Long> failedMessages = getSummaryMetricValue(METRIC_FAILED, Long.class, ... |
@Test @Ignore public void readTest() { String podName = "dbtest1-2-3nvf3"; String integration = "DBTest1"; String integrationId = "-L5ApZneYNfmLWG-PKQt"; String version = "1"; PodMetricsReader reader = new PodMetricsReader( new DefaultKubernetesClient(), podName, integration, integrationId, version, new LogRawMetrics()... | @Override public void run() { try { LOGGER.debug("Collecting stats from integrationId: {}", integrationId); List<Map<String, String>> routeStats = getRoutes(integration, "[a-zA-z0-9_-]+"); routeStats.forEach( m -> { long messages = toLong(m.getOrDefault(EXCHANGES_TOTAL, "0")); long errors = toLong(m.getOrDefault(EXCHAN... | PodMetricsReader implements Runnable { @Override public void run() { try { LOGGER.debug("Collecting stats from integrationId: {}", integrationId); List<Map<String, String>> routeStats = getRoutes(integration, "[a-zA-z0-9_-]+"); routeStats.forEach( m -> { long messages = toLong(m.getOrDefault(EXCHANGES_TOTAL, "0")); lon... | PodMetricsReader implements Runnable { @Override public void run() { try { LOGGER.debug("Collecting stats from integrationId: {}", integrationId); List<Map<String, String>> routeStats = getRoutes(integration, "[a-zA-z0-9_-]+"); routeStats.forEach( m -> { long messages = toLong(m.getOrDefault(EXCHANGES_TOTAL, "0")); lon... | PodMetricsReader implements Runnable { @Override public void run() { try { LOGGER.debug("Collecting stats from integrationId: {}", integrationId); List<Map<String, String>> routeStats = getRoutes(integration, "[a-zA-z0-9_-]+"); routeStats.forEach( m -> { long messages = toLong(m.getOrDefault(EXCHANGES_TOTAL, "0")); lon... | PodMetricsReader implements Runnable { @Override public void run() { try { LOGGER.debug("Collecting stats from integrationId: {}", integrationId); List<Map<String, String>> routeStats = getRoutes(integration, "[a-zA-z0-9_-]+"); routeStats.forEach( m -> { long messages = toLong(m.getOrDefault(EXCHANGES_TOTAL, "0")); lon... |
@Test public void testGetRawMetrics() throws IOException { MetricsCollector collector = new MetricsCollector(null, jsondb, null); Map<String,RawMetrics> metrics = jsondbRM.getRawMetrics("intId1"); assertThat(metrics.size()).isEqualTo(3); assertThat(metrics.keySet()).contains("HISTORY1"); Set<String> livePodIds = new Ha... | @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } } | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); } | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); @PostConstruct @SuppressWarnings("Futur... | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); @PostConstruct @SuppressWarnings("Futur... |
@Test public void testGetIntegrationSummary() throws IOException, ParseException { String integrationId = "intId1"; Set<String> livePodIds = new HashSet<String>( Arrays.asList("pod1", "pod2", "pod3", "pod4", "pod5")); MetricsCollector collector = new MetricsCollector(null, jsondb, null); Map<String,RawMetrics> metrics ... | @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } } | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); } | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); @PostConstruct @SuppressWarnings("Futur... | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); @PostConstruct @SuppressWarnings("Futur... |
@Test public void testDeadPodCurator() throws IOException, ParseException { String integrationId = "intId1"; MetricsCollector collector = new MetricsCollector(null, jsondb, null); Set<String> livePodIds = new HashSet<String>( Arrays.asList("pod2", "pod3", "pod4", "pod5")); jsondb.update(JsonDBRawMetrics.path("intId1","... | @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } } | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); } | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); @PostConstruct @SuppressWarnings("Futur... | MetricsCollector implements Runnable, Closeable { @Override public void close() throws IOException { LOGGER.info("Stopping metrics collector."); close(scheduler); close(executor); } @Autowired MetricsCollector(DataManager dataManager, JsonDB jsonDB, KubernetesClient kubernetes); @PostConstruct @SuppressWarnings("Futur... |
@Test public void testIntegrationRouteBuilder() throws Exception { String configurationLocation = "classpath:syndesis/integration/integration.json"; IntegrationRouteBuilder routeBuilder = new IntegrationRouteBuilder(configurationLocation, Resources.loadServices(IntegrationStepHandler.class), policyFactories); routeBuil... | public IntegrationRouteBuilder(String configurationUri) { this(configurationUri, Resources.loadServices(IntegrationStepHandler.class)); } | IntegrationRouteBuilder extends RouteBuilder { public IntegrationRouteBuilder(String configurationUri) { this(configurationUri, Resources.loadServices(IntegrationStepHandler.class)); } } | IntegrationRouteBuilder extends RouteBuilder { public IntegrationRouteBuilder(String configurationUri) { this(configurationUri, Resources.loadServices(IntegrationStepHandler.class)); } IntegrationRouteBuilder(String configurationUri); IntegrationRouteBuilder(String configurationUri, Collection<IntegrationStepHandler> ... | IntegrationRouteBuilder extends RouteBuilder { public IntegrationRouteBuilder(String configurationUri) { this(configurationUri, Resources.loadServices(IntegrationStepHandler.class)); } IntegrationRouteBuilder(String configurationUri); IntegrationRouteBuilder(String configurationUri, Collection<IntegrationStepHandler> ... | IntegrationRouteBuilder extends RouteBuilder { public IntegrationRouteBuilder(String configurationUri) { this(configurationUri, Resources.loadServices(IntegrationStepHandler.class)); } IntegrationRouteBuilder(String configurationUri); IntegrationRouteBuilder(String configurationUri, Collection<IntegrationStepHandler> ... |
@Test public void testDeploy() throws InterruptedException, JsonProcessingException { final String name = "test-deployment"; final DeploymentData deploymentData = new DeploymentData.Builder() .addAnnotation("testName", testName.getMethodName()) .addLabel("type", "test") .addSecretEntry("secret-key", "secret-val") .with... | @Override public String deploy(String name, DeploymentData deploymentData) { final String sanitizedName = openshiftName(name); LOGGER.debug("Deploy {}", sanitizedName); ensureDeploymentConfig(sanitizedName, deploymentData); ensureSecret(sanitizedName, deploymentData); ensureExposure(sanitizedName, deploymentData); Depl... | OpenShiftServiceImpl implements OpenShiftService { @Override public String deploy(String name, DeploymentData deploymentData) { final String sanitizedName = openshiftName(name); LOGGER.debug("Deploy {}", sanitizedName); ensureDeploymentConfig(sanitizedName, deploymentData); ensureSecret(sanitizedName, deploymentData); ... | OpenShiftServiceImpl implements OpenShiftService { @Override public String deploy(String name, DeploymentData deploymentData) { final String sanitizedName = openshiftName(name); LOGGER.debug("Deploy {}", sanitizedName); ensureDeploymentConfig(sanitizedName, deploymentData); ensureSecret(sanitizedName, deploymentData); ... | OpenShiftServiceImpl implements OpenShiftService { @Override public String deploy(String name, DeploymentData deploymentData) { final String sanitizedName = openshiftName(name); LOGGER.debug("Deploy {}", sanitizedName); ensureDeploymentConfig(sanitizedName, deploymentData); ensureSecret(sanitizedName, deploymentData); ... | OpenShiftServiceImpl implements OpenShiftService { @Override public String deploy(String name, DeploymentData deploymentData) { final String sanitizedName = openshiftName(name); LOGGER.debug("Deploy {}", sanitizedName); ensureDeploymentConfig(sanitizedName, deploymentData); ensureSecret(sanitizedName, deploymentData); ... |
@Test public void apply() throws Exception { try { ListResult<Integer> filtered = new PaginationFilter<Integer>(new PaginationOptions() { @Override public int getPage() { return PaginationFilterTest.this.parameter.page; } @Override public int getPerPage() { return PaginationFilterTest.this.parameter.perPage; } }).apply... | @Override public ListResult<T> apply(ListResult<T> result) { List<T> list = result.getItems(); if (startIndex >= list.size()) { list = Collections.emptyList(); } else { list = list.subList(startIndex, Math.min(list.size(), endIndex)); } return new ListResult.Builder<T>().createFrom(result).items(list).build(); } | PaginationFilter implements Function<ListResult<T>, ListResult<T>> { @Override public ListResult<T> apply(ListResult<T> result) { List<T> list = result.getItems(); if (startIndex >= list.size()) { list = Collections.emptyList(); } else { list = list.subList(startIndex, Math.min(list.size(), endIndex)); } return new Lis... | PaginationFilter implements Function<ListResult<T>, ListResult<T>> { @Override public ListResult<T> apply(ListResult<T> result) { List<T> list = result.getItems(); if (startIndex >= list.size()) { list = Collections.emptyList(); } else { list = list.subList(startIndex, Math.min(list.size(), endIndex)); } return new Lis... | PaginationFilter implements Function<ListResult<T>, ListResult<T>> { @Override public ListResult<T> apply(ListResult<T> result) { List<T> list = result.getItems(); if (startIndex >= list.size()) { list = Collections.emptyList(); } else { list = list.subList(startIndex, Math.min(list.size(), endIndex)); } return new Lis... | PaginationFilter implements Function<ListResult<T>, ListResult<T>> { @Override public ListResult<T> apply(ListResult<T> result) { List<T> list = result.getItems(); if (startIndex >= list.size()) { list = Collections.emptyList(); } else { list = list.subList(startIndex, Math.min(list.size(), endIndex)); } return new Lis... |
@Test public void shouldCreateEditionFromProperties() { final ClientSideStateProperties properties = new ClientSideStateProperties(); properties.setAuthenticationAlgorithm("HmacSHA1"); properties.setAuthenticationKey("oID3dF6UovTkzMyr3a9dr0kgTnE="); properties.setEncryptionAlgorithm("AES/CBC/PKCS5Padding"); properties.... | @Override protected KeySource keySource() { return keySource; } | StaticEdition extends Edition { @Override protected KeySource keySource() { return keySource; } } | StaticEdition extends Edition { @Override protected KeySource keySource() { return keySource; } StaticEdition(final ClientSideStateProperties properties); } | StaticEdition extends Edition { @Override protected KeySource keySource() { return keySource; } StaticEdition(final ClientSideStateProperties properties); } | StaticEdition extends Edition { @Override protected KeySource keySource() { return keySource; } StaticEdition(final ClientSideStateProperties properties); } |
@Test public void shouldCreateEditionWithNonBase64Passwords() { final ClientSideStateProperties properties = new ClientSideStateProperties(); properties.setAuthenticationAlgorithm("HmacSHA1"); properties.setAuthenticationKey(RandomStringUtils.random(32, true, true)); properties.setEncryptionAlgorithm("AES/CBC/PKCS5Padd... | @Override protected KeySource keySource() { return keySource; } | StaticEdition extends Edition { @Override protected KeySource keySource() { return keySource; } } | StaticEdition extends Edition { @Override protected KeySource keySource() { return keySource; } StaticEdition(final ClientSideStateProperties properties); } | StaticEdition extends Edition { @Override protected KeySource keySource() { return keySource; } StaticEdition(final ClientSideStateProperties properties); } | StaticEdition extends Edition { @Override protected KeySource keySource() { return keySource; } StaticEdition(final ClientSideStateProperties properties); } |
@Test public void shouldPersistAsInRfcErrata() { final ClientSideState clientSideState = new ClientSideState(RFC_EDITION, ClientSideStateTest::rfcTime, ClientSideStateTest::rfcIV, ClientSideStateTest::serialize, ClientSideStateTest::deserialize, ClientSideState.DEFAULT_TIMEOUT); final NewCookie cookie = clientSideState... | @SuppressWarnings("JdkObsolete") public NewCookie persist(final String key, final String path, final Object value) { final Date expiry = Date.from(ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(timeout).toInstant()); return new NewCookie(key, protect(value), path, null, Cookie.DEFAULT_VERSION, null, timeout, expiry, tru... | ClientSideState { @SuppressWarnings("JdkObsolete") public NewCookie persist(final String key, final String path, final Object value) { final Date expiry = Date.from(ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(timeout).toInstant()); return new NewCookie(key, protect(value), path, null, Cookie.DEFAULT_VERSION, null, ti... | ClientSideState { @SuppressWarnings("JdkObsolete") public NewCookie persist(final String key, final String path, final Object value) { final Date expiry = Date.from(ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(timeout).toInstant()); return new NewCookie(key, protect(value), path, null, Cookie.DEFAULT_VERSION, null, ti... | ClientSideState { @SuppressWarnings("JdkObsolete") public NewCookie persist(final String key, final String path, final Object value) { final Date expiry = Date.from(ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(timeout).toInstant()); return new NewCookie(key, protect(value), path, null, Cookie.DEFAULT_VERSION, null, ti... | ClientSideState { @SuppressWarnings("JdkObsolete") public NewCookie persist(final String key, final String path, final Object value) { final Date expiry = Date.from(ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(timeout).toInstant()); return new NewCookie(key, protect(value), path, null, Cookie.DEFAULT_VERSION, null, ti... |
@Test public void testUnmarshalXML() { String rawMsg = read("/HttpClientErrorException.xml"); assertThat(ErrorMap.from(rawMsg)).isEqualTo("Desktop applications only support the oauth_callback value 'oob'"); } | public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); static String from(String rawMsg); } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); static String from(String rawMsg); } |
@Test public void testUnmarshalJSON() { String rawMsg = read("/HttpClientErrorException.json"); assertThat(ErrorMap.from(rawMsg)).isEqualTo("Could not authenticate you."); } | public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); static String from(String rawMsg); } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); static String from(String rawMsg); } |
@Test public void testUnmarshalJSONVaryingFormats() { assertThat(ErrorMap.from("{\"error\": \"some error\"}")).isEqualTo("some error"); assertThat(ErrorMap.from("{\"message\": \"some message\"}")).isEqualTo("some message"); } | public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); static String from(String rawMsg); } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); static String from(String rawMsg); } |
@Test public void testUnmarshalImpossible() { String rawMsg = "This is just some other error format"; assertThat(ErrorMap.from(rawMsg)).isEqualTo(rawMsg); } | public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); static String from(String rawMsg); } | ErrorMap { public static String from(String rawMsg) { if (rawMsg.matches("^\\s*\\<.*")) { return parseWith(rawMsg, new XmlMapper()); } if (rawMsg.matches("^\\s*\\{.*")) { return parseWith(rawMsg, new ObjectMapper()); } return rawMsg; } private ErrorMap(); static String from(String rawMsg); } |
@Test public void shouldTryToLookupInJson() { final JsonNodeFactory factory = JsonNodeFactory.instance; final ObjectNode obj = factory.objectNode(); obj.set("a", factory.arrayNode().add("b").add("c")); obj.set("x", factory.objectNode().set("y", factory.objectNode().put("z", "!"))); assertThat(ErrorMap.tryLookingUp(obj,... | static Optional<String> tryLookingUp(final JsonNode node, final String... pathElements) { JsonNode current = node; for (String pathElement : pathElements) { current = current.get(pathElement); if (current != null && current.isArray() && current.iterator().hasNext()) { current = current.iterator().next(); } if (current ... | ErrorMap { static Optional<String> tryLookingUp(final JsonNode node, final String... pathElements) { JsonNode current = node; for (String pathElement : pathElements) { current = current.get(pathElement); if (current != null && current.isArray() && current.iterator().hasNext()) { current = current.iterator().next(); } i... | ErrorMap { static Optional<String> tryLookingUp(final JsonNode node, final String... pathElements) { JsonNode current = node; for (String pathElement : pathElements) { current = current.get(pathElement); if (current != null && current.isArray() && current.iterator().hasNext()) { current = current.iterator().next(); } i... | ErrorMap { static Optional<String> tryLookingUp(final JsonNode node, final String... pathElements) { JsonNode current = node; for (String pathElement : pathElements) { current = current.get(pathElement); if (current != null && current.isArray() && current.iterator().hasNext()) { current = current.iterator().next(); } i... | ErrorMap { static Optional<String> tryLookingUp(final JsonNode node, final String... pathElements) { JsonNode current = node; for (String pathElement : pathElements) { current = current.get(pathElement); if (current != null && current.isArray() && current.iterator().hasNext()) { current = current.iterator().next(); } i... |
@Test public void testMultiFlowIntegrationRouteBuilder() throws Exception { String configurationLocation = "classpath:syndesis/integration/multi-flow-integration.json"; IntegrationRouteBuilder routeBuilder = new IntegrationRouteBuilder(configurationLocation, Resources.loadServices(IntegrationStepHandler.class), policyF... | @Override public void configure() throws Exception { final Integration integration = loadIntegration(); final List<Flow> flows = integration.getFlows(); for (int f = 0; f < flows.size(); f++) { configureFlow(flows.get(f), String.valueOf(f)); } } | IntegrationRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { final Integration integration = loadIntegration(); final List<Flow> flows = integration.getFlows(); for (int f = 0; f < flows.size(); f++) { configureFlow(flows.get(f), String.valueOf(f)); } } } | IntegrationRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { final Integration integration = loadIntegration(); final List<Flow> flows = integration.getFlows(); for (int f = 0; f < flows.size(); f++) { configureFlow(flows.get(f), String.valueOf(f)); } } IntegrationRouteBuilder(Str... | IntegrationRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { final Integration integration = loadIntegration(); final List<Flow> flows = integration.getFlows(); for (int f = 0; f < flows.size(); f++) { configureFlow(flows.get(f), String.valueOf(f)); } } IntegrationRouteBuilder(Str... | IntegrationRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { final Integration integration = loadIntegration(); final List<Flow> flows = integration.getFlows(); for (int f = 0; f < flows.size(); f++) { configureFlow(flows.get(f), String.valueOf(f)); } } IntegrationRouteBuilder(Str... |
@Test public void shouldCreateMetaDataFromPreviousStep() throws IOException { Step firstStep = new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .inputDataShape(StepMetadataHelper.NO_SHAPE) .outputDataShape(new DataShape.Builder() .kind(D... | @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataShape.flatMap(Step::inputDataShape) .orElse(StepMetadat... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... |
@Test public void shouldCreateMetaDataFromAnyShape() { Step previousStep = new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .inputDataShape(StepMetadataHelper.NO_SHAPE) .outputDataShape(StepMetadataHelper.ANY_SHAPE) .build()) .build()) .... | @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataShape.flatMap(Step::inputDataShape) .orElse(StepMetadat... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... |
@Test public void shouldCreateMetaDataFromEmptyPreviousSteps() { DynamicActionMetadata metadata = metadataHandler.createMetadata(splitStep, Collections.emptyList(), Collections.emptyList()); Assert.assertEquals(StepMetadataHelper.NO_SHAPE, metadata.inputShape()); Assert.assertEquals(StepMetadataHelper.NO_SHAPE, metadat... | @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataShape.flatMap(Step::inputDataShape) .orElse(StepMetadat... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { Optional<Step> previousStepWithDataShape = StepMetadataHelper.getLastWithOutputShape(previousSteps); DataShape inputShape = previousStepWithDataS... |
@Test public void shouldExtractJavaElementVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(new DataShape.Builder() .kind(DataShapeKinds.JAVA) .specification(getSpecification("person-list-spec.json")) .description("p... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJsonSchemaShape(dataShape)) { dataShape = new DataShape.Bu... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... |
@Test public void shouldExtractJsonSchemaElementVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_SCHEMA) .specification(getSpecification("person-list-schema.json")) ... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJsonSchemaShape(dataShape)) { dataShape = new DataShape.Bu... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... |
@Test public void shouldAutoConvertAndExtractJsonSchemaElement() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_SCHEMA) .specification(getSpecification("person-list-schema.j... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJsonSchemaShape(dataShape)) { dataShape = new DataShape.Bu... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... |
@Test public void shouldExtractAlreadyGivenJsonSchemaVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_SCHEMA) .specification(getSpecification("person-schema.json")) ... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJsonSchemaShape(dataShape)) { dataShape = new DataShape.Bu... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... |
@Test public void shouldExtractJsonInstanceElementVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_INSTANCE) .specification(getSpecification("person-list-instance.js... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJsonSchemaShape(dataShape)) { dataShape = new DataShape.Bu... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... |
@Test public void shouldAutoConvertAndExtractJsonInstanceElement() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_INSTANCE) .specification(getSpecification("person-list-inst... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJsonSchemaShape(dataShape)) { dataShape = new DataShape.Bu... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... |
@Test public void shouldExtractAlreadyGivenJsonInstanceVariant() throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(StepMetadataHelper.NO_SHAPE) .outputShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_INSTANCE) .specification(getSpecification("person-instance.js... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJsonSchemaShape(dataShape)) { dataShape = new DataShape.Bu... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... |
@Test public void testGenerateProject() throws Exception { TestResourceManager resourceManager = new TestResourceManager(); Integration integration = resourceManager.newIntegration( new Step.Builder() .stepKind(StepKind.endpoint) .connection(new Connection.Builder() .id("timer-connection") .connector(TestConstants.TIME... | @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedInputStream is = new PipedInputStream(); final ExecutorServi... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... | ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedIn... |
@Test @Parameters({"person-unified-schema.json", "person-unified-schema-draft-4.json", "person-unified-schema-draft-6.json"}) public void shouldAutoConvertAndExtractUnifiedJsonSchemaElement(final String schemaPath) throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Builder() .inputShape(Ste... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJsonSchemaShape(dataShape)) { dataShape = new DataShape.Bu... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... |
@Test @Parameters({"person-list-unified-schema.json", "person-list-unified-schema-draft-4.json", "person-list-unified-schema-draft-6.json"}) public void shouldAutoConvertAndExtractUnifiedJsonArraySchemaElement(final String schemaPath) throws IOException { DynamicActionMetadata metadata = new DynamicActionMetadata.Build... | @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJsonSchemaShape(dataShape)) { dataShape = new DataShape.Bu... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... | SplitMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata handle(DynamicActionMetadata metadata) { try { if (metadata.outputShape() != null) { DataShape dataShape = new DataShape.Builder() .createFrom(metadata.outputShape()) .decompress() .build(); if (StepMetadataHelper.isUnifiedJson... |
@Test public void shouldCreateMetaDataFromSurroundingSteps() { Step previousStep = new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .inputDataShape(StepMetadataHelper.NO_SHAPE) .outputDataShape(new DataShape.Builder() .kind(DataShapeKind... | @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); return new DynamicActionMetadata.Builder() .inpu... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... |
@Test public void shouldCreateMetaDataFromAnyShapes() { Step previousStep = new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .inputDataShape(StepMetadataHelper.NO_SHAPE) .outputDataShape(StepMetadataHelper.ANY_SHAPE) .build()) .build()) ... | @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); return new DynamicActionMetadata.Builder() .inpu... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... |
@Test public void shouldCreateMetaDataFromEmptySurroundingSteps() { DynamicActionMetadata metadata = metadataHandler.createMetadata(choiceStep, Collections.emptyList(), Collections.emptyList()); Assert.assertEquals(StepMetadataHelper.NO_SHAPE, metadata.inputShape()); Assert.assertEquals(StepMetadataHelper.ANY_SHAPE, me... | @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); return new DynamicActionMetadata.Builder() .inpu... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... | ChoiceMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_S... |
@Test public void shouldSelectElementVariantForSplitStep() { final DynamicActionMetadata givenMetadata = new DynamicActionMetadata.Builder() .outputShape(new DataShape.Builder() .createFrom(collectionShape) .addVariant(elementShape) .addVariant(dummyShape()) .build()) .build(); final Response response = handler.enrichS... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldKeepElementVariantForSplitStep() { final DynamicActionMetadata givenMetadata = new DynamicActionMetadata.Builder() .outputShape(new DataShape.Builder() .createFrom(elementShape) .addVariant(collectionShape) .addVariant(dummyShape()) .build()) .build(); final Response response = handler.enrichSte... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldSelectCollectionVariantForAggregateStep() { final DynamicActionMetadata givenMetadata = new DynamicActionMetadata.Builder() .outputShape(new DataShape.Builder() .createFrom(elementShape) .addVariant(collectionShape) .addVariant(dummyShape()) .build()) .build(); final Response response = handler.... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldKeepCollectionVariantForAggregateStep() { final DynamicActionMetadata givenMetadata = new DynamicActionMetadata.Builder() .outputShape(new DataShape.Builder() .createFrom(collectionShape) .addVariant(elementShape) .addVariant(dummyShape()) .build()) .build(); final Response response = handler.en... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
@Test public void shouldHandleVariantCompression() { final DynamicActionMetadata givenMetadata = new DynamicActionMetadata.Builder() .outputShape(new DataShape.Builder() .createFrom(collectionShape) .addVariant(new DataShape.Builder() .createFrom(elementShape) .putMetadata(DataShapeMetaData.SHOULD_COMPRESS, "true") .co... | @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(responseCode = "200", content = @Content(array... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... | StepActionHandler extends BaseHandler { @POST @Path("/descriptor") @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " + "defined with respect to the given shape variants") @ApiResponse(respon... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.