You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/03/26 08:17:43 UTC
[GitHub] [camel-quarkus] zbendhiba opened a new pull request #2387: DigitalOcean native support #1594
zbendhiba opened a new pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387
[ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
[ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
[ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
[ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
[ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
[ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r603498334
##########
File path: integration-tests/digitalocean/src/main/java/org/apache/camel/quarkus/component/digitalocean/it/DigitaloceanRoute.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.digitalocean.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Named;
+import javax.ws.rs.Produces;
+
+import com.myjeeva.digitalocean.impl.DigitalOceanClient;
+import io.quarkus.arc.Unremovable;
+import org.apache.camel.builder.RouteBuilder;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+@ApplicationScoped
+public class DigitaloceanRoute extends RouteBuilder {
+ @ConfigProperty(name = "DIGITALOCEAN_AUTH_TOKEN", defaultValue = "NONE")
+ String oAuthToken;
+
+ /**
+ * We need to implement some conditional configuration of the {@link DigitalOceanClient} thus we create it
+ * programmatically
+ *
+ * @return a configured {@link DigitalOceanClient}
+ */
+ @Produces
+ @ApplicationScoped
+ @Unremovable
+ @Named("digitalOceanClient")
+ DigitalOceanClient intiDigitalOceanClient(MockApiService mockApiService) {
+ final String wireMockUrl = System.getProperty("wiremock.url.ssl");
+ if (wireMockUrl != null) {
+ DigitalOceanClient digitalOceanClient = mockApiService.createDigitalOceanClient(wireMockUrl, oAuthToken);
+ digitalOceanClient.setAuthToken(oAuthToken);
+ digitalOceanClient.setApiVersion("V2");
+ return digitalOceanClient;
+ }
+ return new DigitalOceanClient(oAuthToken);
+ }
+
+ @Override
+ public void configure() throws Exception {
+ from("direct:droplet")
+ .to(String.format("digitalocean:droplets?oAuthToken=%s&digitalOceanClient=#digitalOceanClient", oAuthToken));
Review comment:
For the purpose of sharing tips, `.toF("digitalocean:....")` might be a good shortcut in such cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] zbendhiba commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
zbendhiba commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r603493034
##########
File path: integration-tests-support/wiremock/src/main/java/org/apache/camel/quarkus/test/wiremock/WireMockTestResourceLifecycleManager.java
##########
@@ -217,6 +219,9 @@ private WireMockServer createServer() {
// Read mapping resources from the classpath in playback mode
configuration.fileSource(new CamelQuarkusFileSource());
}
+
Review comment:
@aldettinger thanks for the tips. I'll use that!!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r603497322
##########
File path: integration-tests/digitalocean/src/main/java/org/apache/camel/quarkus/component/digitalocean/it/DigitaloceanRoute.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.digitalocean.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Named;
+import javax.ws.rs.Produces;
+
+import com.myjeeva.digitalocean.impl.DigitalOceanClient;
+import io.quarkus.arc.Unremovable;
+import org.apache.camel.builder.RouteBuilder;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+@ApplicationScoped
+public class DigitaloceanRoute extends RouteBuilder {
+ @ConfigProperty(name = "DIGITALOCEAN_AUTH_TOKEN", defaultValue = "NONE")
+ String oAuthToken;
+
+ /**
+ * We need to implement some conditional configuration of the {@link DigitalOceanClient} thus we create it
+ * programmatically
+ *
+ * @return a configured {@link DigitalOceanClient}
+ */
+ @Produces
+ @ApplicationScoped
+ @Unremovable
+ @Named("digitalOceanClient")
+ DigitalOceanClient intiDigitalOceanClient(MockApiService mockApiService) {
Review comment:
small typo here ? init
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r603498334
##########
File path: integration-tests/digitalocean/src/main/java/org/apache/camel/quarkus/component/digitalocean/it/DigitaloceanRoute.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.digitalocean.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Named;
+import javax.ws.rs.Produces;
+
+import com.myjeeva.digitalocean.impl.DigitalOceanClient;
+import io.quarkus.arc.Unremovable;
+import org.apache.camel.builder.RouteBuilder;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+@ApplicationScoped
+public class DigitaloceanRoute extends RouteBuilder {
+ @ConfigProperty(name = "DIGITALOCEAN_AUTH_TOKEN", defaultValue = "NONE")
+ String oAuthToken;
+
+ /**
+ * We need to implement some conditional configuration of the {@link DigitalOceanClient} thus we create it
+ * programmatically
+ *
+ * @return a configured {@link DigitalOceanClient}
+ */
+ @Produces
+ @ApplicationScoped
+ @Unremovable
+ @Named("digitalOceanClient")
+ DigitalOceanClient intiDigitalOceanClient(MockApiService mockApiService) {
+ final String wireMockUrl = System.getProperty("wiremock.url.ssl");
+ if (wireMockUrl != null) {
+ DigitalOceanClient digitalOceanClient = mockApiService.createDigitalOceanClient(wireMockUrl, oAuthToken);
+ digitalOceanClient.setAuthToken(oAuthToken);
+ digitalOceanClient.setApiVersion("V2");
+ return digitalOceanClient;
+ }
+ return new DigitalOceanClient(oAuthToken);
+ }
+
+ @Override
+ public void configure() throws Exception {
+ from("direct:droplet")
+ .to(String.format("digitalocean:droplets?oAuthToken=%s&digitalOceanClient=#digitalOceanClient", oAuthToken));
Review comment:
For the purpose of sharing tips, toF might be a good shortcut in such cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger commented on pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
aldettinger commented on pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#issuecomment-809592645
This is quite a PR. It's on the right track :+1:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r602104430
##########
File path: extensions/digitalocean/deployment/src/main/java/org/apache/camel/quarkus/component/digitalocean/deployment/DigitaloceanProcessor.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.digitalocean.deployment;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import org.jboss.jandex.IndexView;
+
+class DigitaloceanProcessor {
+
+ private static final String FEATURE = "camel-digitalocean";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ ExtensionSslNativeSupportBuildItem activateSslNativeSupport() {
+ return new ExtensionSslNativeSupportBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+ IndexView index = combinedIndex.getIndex();
+ // register Digitalocean model classes for JSON serialize/deserialize
+ String[] dtos = index.getKnownClasses().stream().map(ci -> ci.name().toString())
+ .filter(n -> n.startsWith("com.myjeeva.digitalocean.pojo")
+ || n.startsWith("com.myjeeva.digitalocean.common"))
+ .sorted()
+ .toArray(String[]::new);
+
+ return new ReflectiveClassBuildItem(true, true, dtos);
+ }
Review comment:
Jandex!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r603453378
##########
File path: extensions/digitalocean/deployment/src/main/java/org/apache/camel/quarkus/component/digitalocean/deployment/DigitaloceanProcessor.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.digitalocean.deployment;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import org.jboss.jandex.IndexView;
+
+class DigitaloceanProcessor {
+
+ private static final String FEATURE = "camel-digitalocean";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ ExtensionSslNativeSupportBuildItem activateSslNativeSupport() {
+ return new ExtensionSslNativeSupportBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+ IndexView index = combinedIndex.getIndex();
+ // register Digitalocean model classes for JSON serialize/deserialize
+ String[] dtos = index.getKnownClasses().stream().map(ci -> ci.name().toString())
+ .filter(n -> n.startsWith("com.myjeeva.digitalocean.pojo")
+ || n.startsWith("com.myjeeva.digitalocean.common"))
+ .sorted()
Review comment:
Maybe we don't need sort them ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] zbendhiba commented on pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
zbendhiba commented on pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#issuecomment-811991590
@ppalaga @aldettinger can we merge this one? Are you okay with the changes? The failing test is related to camel-quarkus-examples quarkus.log file
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r603456648
##########
File path: integration-tests-support/wiremock/src/main/java/org/apache/camel/quarkus/test/wiremock/WireMockTestResourceLifecycleManager.java
##########
@@ -217,6 +219,9 @@ private WireMockServer createServer() {
// Read mapping resources from the classpath in playback mode
configuration.fileSource(new CamelQuarkusFileSource());
}
+
Review comment:
I read it like HTTPs is enabled for all tests. It reminds me that we added the possibility to customize the configuration in specific cases with `customizeWiremockConfiguration()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] zbendhiba commented on pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
zbendhiba commented on pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#issuecomment-808031694
I've created an issue to add more tests https://github.com/apache/camel-quarkus/issues/2388
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] zbendhiba commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
zbendhiba commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r602111905
##########
File path: integration-tests/digitalocean/src/test/java/org/apache/camel/quarkus/component/digitalocean/it/DigitaloceanTest.java
##########
@@ -0,0 +1,231 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.digitalocean.it;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.TimeUnit;
+
+import com.github.tomakehurst.wiremock.WireMockServer;
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.apache.camel.quarkus.test.wiremock.MockServer;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
+
+import static io.restassured.RestAssured.given;
+import static org.awaitility.Awaitility.await;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.Matchers.hasKey;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@QuarkusTest
+@QuarkusTestResource(DigitaloceanTestResource.class)
+class DigitaloceanTest {
+
+ @MockServer
+ WireMockServer server;
+
+ @Test
+ @DisabledIfEnvironmentVariable(named = "DIGITALOCEAN_AUTH_TOKEN", matches = ".+")
Review comment:
Maybe the main test, I just have to get the same timeout
But for the 2 other tests : Kernels and Neighbors, I couldn't get the responses with my basic test from Digitalocean. I did a mock using their examples
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#issuecomment-809251372
Master is on 1.9.0-SNAPSHOT now. Could you plz rebase and change the since native version to 1.9.0?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] zbendhiba commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
zbendhiba commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r603135557
##########
File path: integration-tests/digitalocean/src/test/java/org/apache/camel/quarkus/component/digitalocean/it/DigitaloceanTest.java
##########
@@ -0,0 +1,231 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.digitalocean.it;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.TimeUnit;
+
+import com.github.tomakehurst.wiremock.WireMockServer;
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.apache.camel.quarkus.test.wiremock.MockServer;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
+
+import static io.restassured.RestAssured.given;
+import static org.awaitility.Awaitility.await;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.Matchers.hasKey;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@QuarkusTest
+@QuarkusTestResource(DigitaloceanTestResource.class)
+class DigitaloceanTest {
+
+ @MockServer
+ WireMockServer server;
+
+ @Test
+ @DisabledIfEnvironmentVariable(named = "DIGITALOCEAN_AUTH_TOKEN", matches = ".+")
Review comment:
FYI, I'm updating this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga merged pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
ppalaga merged pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r602109829
##########
File path: integration-tests/digitalocean/src/test/java/org/apache/camel/quarkus/component/digitalocean/it/DigitaloceanTest.java
##########
@@ -0,0 +1,231 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.digitalocean.it;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.TimeUnit;
+
+import com.github.tomakehurst.wiremock.WireMockServer;
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.apache.camel.quarkus.test.wiremock.MockServer;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
+
+import static io.restassured.RestAssured.given;
+import static org.awaitility.Awaitility.await;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.Matchers.hasKey;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@QuarkusTest
+@QuarkusTestResource(DigitaloceanTestResource.class)
+class DigitaloceanTest {
+
+ @MockServer
+ WireMockServer server;
+
+ @Test
+ @DisabledIfEnvironmentVariable(named = "DIGITALOCEAN_AUTH_TOKEN", matches = ".+")
Review comment:
1. Disabled if not-empty sounds strange - should that really be that way?
2. You say in the readme "By default, the Digitalocean integration tests use WireMock to stub the API interactions." which sounds like `DIGITALOCEAN_AUTH_TOKEN` is not needed if I want to run against wiremock. But with this `@DisabledIfEnvironmentVariable`, the test does not run at all against wiremock. Or I am misunderstanding something?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #2387: DigitalOcean native support #1594
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #2387:
URL: https://github.com/apache/camel-quarkus/pull/2387#discussion_r603453378
##########
File path: extensions/digitalocean/deployment/src/main/java/org/apache/camel/quarkus/component/digitalocean/deployment/DigitaloceanProcessor.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.digitalocean.deployment;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import org.jboss.jandex.IndexView;
+
+class DigitaloceanProcessor {
+
+ private static final String FEATURE = "camel-digitalocean";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ ExtensionSslNativeSupportBuildItem activateSslNativeSupport() {
+ return new ExtensionSslNativeSupportBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+ IndexView index = combinedIndex.getIndex();
+ // register Digitalocean model classes for JSON serialize/deserialize
+ String[] dtos = index.getKnownClasses().stream().map(ci -> ci.name().toString())
+ .filter(n -> n.startsWith("com.myjeeva.digitalocean.pojo")
+ || n.startsWith("com.myjeeva.digitalocean.common"))
+ .sorted()
Review comment:
Maybe we don't need to sort them ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org