-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added a simple spring boot java app example #21
Conversation
This seems like a lot for a Hello World app...was a lot of it auto-generated or something? @jcscottiii Being our resident Java expert, mind taking a look? |
There are a few spring examples in https://github.com/cloudfoundry-samples. Speaking of which, could we contribute our examples to |
Nice! Had no idea that existed. #22 |
@afeld, couple of files were definitely autogenerated by |
@johnscancella Thoughts about your implementation, vs. something like https://github.com/cloudfoundry-samples/hello-spring? Maybe we transfer this pull request there instead...? |
@afeld The difference between this example, and the example at cloudfoundry-samples could set off a holy war.. Maven vs Gradle. ;-) Also, this example is Spring Boot, the other is Spring MVC. Both Spring, but slightly different. Boot is current gen tech, and can configure/integrate MVC. |
Given that some of the files are generated, is it necessary to include the |
@DavidEBest yeah you need those two. essentially, if you don't have gradle installed locally yourself, you can just run the one for your OS and it'll be fine |
|
||
@Test | ||
public void getHello() throws Exception { | ||
mvc.perform(MockMvcRequestBuilders.get("/").accept(MediaType.APPLICATION_JSON)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two options:
- you can remove the
.accept(MediaType.APPLICATION_JSON)
part - or you also check the ContentType
.andExpect(content().contentType()
@johnscancella this looks good. :) just need you to also include the files from the |
…g gradle wrapper files
@afeld Yeah it is a bit verbose, but I didn't want anyone to have to install gradle. If you(or @jmcarp, @LinuxBozo, @jcscottiii) think that is an ok requirement to install gradle I can remove them. |
Ohh and @LinuxBozo yes definitely holy war when it comes to maven vs. gradle. I much prefer gradle, but if you think it will make a difference I can try and generate a maven pom file. |
This works—we can always iterate, and maybe transfer this to a |
Thanks @johnscancella for the contribution, and thanks everyone for the input! |
no problem, glad I could help. +1 on merging with the cloudfoundry-samples at some point |
A very simple hello world using java and spring boot