Skip to content

leosavio/test-javaweek3-lp

Repository files navigation

Fork of infra-gitpod-template

Description

  • A simple springboot api using H2 in memory, java 19 using sdk/springboot cli tools, Gitpod and Thunder Extension
  • Enjoy

install springboot cli

sdk install springboot
spring init --dependencies=web,jpa,h2 --java-version=20 --build=maven myprojectname

Add to application.properties to enable h2 console

spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.h2.console.settings.trace=false
spring.h2.console.settings.web-allow-others=false

H2 url

  • Check the gitpod url on Ports tab
http://gitpod-url:8080/h2-console

Get the h2 url in application startup

##H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:9914428f-357d-4992-a8a0-ac78a1e6805e'

Create all classes from repo

Change ApplicationStartup.java values

Run application

mvn spring-boot:run

Access the get method of api on browser to get json

{"nome":"CHANGEALLVALUES","preco":1200.0,"pessoaInstrutora":"CHANGEALLVALUES"}

On thunder client at gitpod configure ALL methods of api and test:

Sample return:

{
  "id": 2,
  "nome": "CHANGEALLVALUES",
  "preco": 1200.0,
  "pessoaInstrutora": "CHANGEALLVALUES"
}

You can run the update references to import Thunder collection

chmod +x updateGitpodRefsUrl.sh 
./updateGitpodRefsUrl.sh ./thunder-collection_Javaweek.json

Export the collection of Thunder client into project folder

thunder-collection_Javaweek.json

Commit

./git-push-all.sh 

Its done

Troubleshooting

Erros with java plugins:

Try cleaning the Java language server workspace:

Cmd + Shift + P  to show the command palette
Choose or type "Java: Clean the Java language server workspace"
Restart and Delete
It just worked for me.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published