Skip to content

Oded sol #13

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

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f0911ba
Update pom.xml
Oded3012 Jul 7, 2022
78e429a
Update pom.xml
Oded3012 Jul 7, 2022
c901ed8
Update pom.xml
Oded3012 Jul 7, 2022
2c2efa5
Update pom.xml
Oded3012 Jul 7, 2022
e7c4d3e
Update pom.xml
Oded3012 Jul 7, 2022
a484fed
Update pom.xml
Oded3012 Jul 7, 2022
137359c
Update pom.xml
Oded3012 Jul 7, 2022
b41ff81
Update pom.xml
Oded3012 Jul 7, 2022
4bb4330
Update pom.xml
Oded3012 Jul 7, 2022
e2ecca2
Update pom.xml
Oded3012 Jul 7, 2022
755c2ec
Update pom.xml
Oded3012 Jul 7, 2022
5bba295
Update pom.xml
Oded3012 Jul 7, 2022
43400c6
Update pom.xml
Oded3012 Jul 7, 2022
6b82541
Update pom.xml
Oded3012 Jul 7, 2022
bf55e9f
Update pom.xml
Oded3012 Jul 7, 2022
ae1b0be
Update pom.xml
Oded3012 Jul 7, 2022
17f8ac3
Update pom.xml
Oded3012 Jul 7, 2022
3d38c26
Update pom.xml
Oded3012 Jul 7, 2022
e393d96
Update pom.xml
Oded3012 Jul 7, 2022
ec1b37a
Update pom.xml
Oded3012 Jul 7, 2022
5ad9bc7
Update pom.xml
Oded3012 Jul 7, 2022
1c294f8
Update pom.xml
Oded3012 Jul 7, 2022
319f3a0
Update pom.xml
Oded3012 Jul 7, 2022
28429a0
Create Example.java
Oded3012 Jul 7, 2022
c4a8dc7
Update pom.xml
Oded3012 Jul 7, 2022
e7397a7
Update pom.xml
Oded3012 Jul 7, 2022
e138a2d
Delete Example.java
Oded3012 Jul 7, 2022
703bede
Create Example.java
Oded3012 Jul 7, 2022
aed8bcf
Delete Example.java
Oded3012 Jul 7, 2022
8f59723
Update pom.xml
Oded3012 Jul 7, 2022
ba4bad9
Update HelloWorldControlerTests.java
Oded3012 Jul 7, 2022
94725c6
Update ApplicationTests.java
Oded3012 Jul 7, 2022
b797c48
Update HelloWorldController.java
Oded3012 Jul 7, 2022
f76c13b
Update Application.java
Oded3012 Jul 7, 2022
cdcc191
Delete ServletInitializer.java
Oded3012 Jul 7, 2022
70be475
Rename Application.java to HelloWorldApplication.java
Oded3012 Jul 7, 2022
1126087
Rename ApplicationTests.java to HelloWorldApplicationTests.java
Oded3012 Jul 7, 2022
76b0af4
Delete HelloTests.java
Oded3012 Jul 7, 2022
4effca9
Rename HelloWorldControlerTests.java to HelloWorldControlerTest.java
Oded3012 Jul 7, 2022
961ce15
Update HelloWorldControlerTest.java
Oded3012 Jul 7, 2022
27e1feb
Update HelloWorldControlerTest.java
Oded3012 Jul 7, 2022
edad461
Update HelloWorldControlerTest.java
Oded3012 Jul 7, 2022
1c1fb3b
Update HelloWorldControlerTest.java
Oded3012 Jul 7, 2022
a29a6f6
target fix Code
Oded3012 Jul 7, 2022
4acfb7d
Update pom.xml
Oded3012 Jul 7, 2022
9963198
Target changed
Oded3012 Jul 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 40 additions & 58 deletions spring-boot-package-war/pom.xml
Original file line number Diff line number Diff line change
@@ -1,67 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.neo</groupId>
<artifactId>spring-boot-package-war</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.5</version>
</parent>

<name>spring-boot-package-war</name>
<description>Demo project for Spring Boot package war</description>
<groupId>com.example</groupId>
<artifactId>hello-world</artifactId>
<version>0.0.2-SNAPSHOT</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<name>hello-world</name>
<description>A simple Spring Boot app to send hello world message to a user</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
</properties>
<properties>
<java.version>1.8</java.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
12 changes: 0 additions & 12 deletions spring-boot-package-war/src/main/java/com/neo/Application.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.helloworld;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class HelloWorldApplication {

public static void main(String[] args) {
SpringApplication.run(HelloWorldApplication.class, args);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.neo.controller;
package com.example.helloworld.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorldController {
@RequestMapping("/hello")
public String index() {
return "Hello World xx";

@GetMapping("/hello")
public String sendGreetings() {
return "Hello, World!";
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.example.helloworld;

import com.example.helloworld.controller.HelloWorldController;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import static org.junit.jupiter.api.Assertions.assertNotNull;


@SpringBootTest
class HelloWorldApplicationTests {

@Autowired
private HelloWorldController helloWorldController;

@Test
void contextLoads() {
// to ensure that controller is getting created inside the application context
assertNotNull(helloWorldController);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.example.helloworld.controller;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.MockMvc;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@SpringBootTest
@AutoConfigureMockMvc
class HelloWorldControllerTest {

@Autowired
private MockMvc mockMvc;

@Test
public void shouldReturnExpectedMessage() throws Exception {

mockMvc.perform(get("/hello"))
.andExpect(status().isOk())
.andExpect(content().string("Hello, World!"));
}
}

This file was deleted.

Empty file.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
com\example\helloworld\controller\HelloWorldController.class
com\example\helloworld\HelloWorldApplication.class
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
C:\Repo\repo1\spring-boot-examples\spring-boot-package-war\src\main\java\com\neo\HelloWorldApplication.java
C:\Repo\repo1\spring-boot-examples\spring-boot-package-war\src\main\java\com\neo\controller\HelloWorldController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
com\example\helloworld\HelloWorldApplicationTests.class
com\example\helloworld\controller\HelloWorldControllerTest.class
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
C:\Repo\repo1\spring-boot-examples\spring-boot-package-war\src\test\java\com\neo\HelloWorldApplicationTests.java
C:\Repo\repo1\spring-boot-examples\spring-boot-package-war\src\test\java\com\neo\controller\HelloWorldControlerTest.java
Loading