diff --git a/build.gradle b/build.gradle index fad5e04ad..3753e5eae 100644 --- a/build.gradle +++ b/build.gradle @@ -145,7 +145,7 @@ dependencies { 'io.jsonwebtoken:jjwt-jackson:0.12.5', 'org.keycloak:keycloak-installed-adapter:24.0.3', 'com.squareup.retrofit2:converter-jackson:2.11.0', - 'com.google.code.gson:gson:2.10.1') + 'com.google.code.gson:gson:2.11.0') testImplementation( 'org.junit.platform:junit-platform-launcher:1.10.2', 'org.mockito:mockito-core:5.11.0', diff --git a/src/it/java/org/jboss/tools/intellij/openshift/utils/odo/OdoCliComponentTest.java b/src/it/java/org/jboss/tools/intellij/openshift/utils/odo/OdoCliComponentTest.java index 6f97c0c07..2400c2919 100644 --- a/src/it/java/org/jboss/tools/intellij/openshift/utils/odo/OdoCliComponentTest.java +++ b/src/it/java/org/jboss/tools/intellij/openshift/utils/odo/OdoCliComponentTest.java @@ -136,8 +136,8 @@ public void checkCreateComponentAndDebug() throws IOException, ExecutionExceptio @Test public void checkCreateComponentStarter() throws IOException, ExecutionException, InterruptedException { createProject(project); - odo.createComponent("nodejs", REGISTRY_NAME, component, - Files.newTemporaryFolder().getAbsolutePath(), null, "nodejs-starter"); + odo.createComponent("go", REGISTRY_NAME, component, + Files.newTemporaryFolder().getAbsolutePath(), null, "go-starter"); List components = odo.getComponents(project); assertNotNull(components); assertEquals(0, components.size()); diff --git a/src/it/java/org/jboss/tools/intellij/openshift/utils/odo/OdoCliTest.java b/src/it/java/org/jboss/tools/intellij/openshift/utils/odo/OdoCliTest.java index 1ce407cf3..b098751c6 100644 --- a/src/it/java/org/jboss/tools/intellij/openshift/utils/odo/OdoCliTest.java +++ b/src/it/java/org/jboss/tools/intellij/openshift/utils/odo/OdoCliTest.java @@ -33,7 +33,7 @@ public abstract class OdoCliTest extends BasePlatformTestCase { - public static final String COMPONENT_PATH = "src/it/projects/nodejs"; + public static final String COMPONENT_PATH = "src/it/projects/go"; // see https://operatorhub.io/operator/cloud-native-postgresql/ STABLE channel for versions public static final String SERVICE_TEMPLATE = "cloud-native-postgresql"; @@ -101,7 +101,7 @@ protected void createProject(String project) throws IOException, ExecutionExcept protected void createComponent(String project, String component, ComponentFeature feature) throws IOException, ExecutionException, InterruptedException { createProject(project); cleanLocalProjectDirectory(); - odo.createComponent("nodejs", REGISTRY_NAME, component, + odo.createComponent("go", REGISTRY_NAME, component, new File(COMPONENT_PATH).getAbsolutePath(), null, null); if (feature != null) { AtomicBoolean started = new AtomicBoolean(); diff --git a/src/it/projects/go/.gitignore b/src/it/projects/go/.gitignore new file mode 100644 index 000000000..25b9d2a1f --- /dev/null +++ b/src/it/projects/go/.gitignore @@ -0,0 +1,6 @@ +.odo/env +.odo/odo-file-index.json +main +main.exe + +.odo \ No newline at end of file diff --git a/src/it/projects/go/README.md b/src/it/projects/go/README.md new file mode 100644 index 000000000..24e8dc1c3 --- /dev/null +++ b/src/it/projects/go/README.md @@ -0,0 +1,3 @@ +# devfile-stack-go + +A starter project for go diff --git a/src/it/projects/go/go.mod b/src/it/projects/go/go.mod new file mode 100644 index 000000000..86933fe9e --- /dev/null +++ b/src/it/projects/go/go.mod @@ -0,0 +1,3 @@ +module github.com/devfile-samples/devfile-stack-go + +go 1.16 diff --git a/src/it/projects/go/main.go b/src/it/projects/go/main.go new file mode 100644 index 000000000..41eb67fa9 --- /dev/null +++ b/src/it/projects/go/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "net/http" +) + +func main() { + http.HandleFunc("/", HelloServer) + http.ListenAndServe("0.0.0.0:8080", nil) +} + +func HelloServer(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hello, %s!", r.URL.Path[1:]) +}