adding spring controller changes (#493)

* adding spring controller changes

* changing package name to baledung

* removing test package

* adding changes in pom for spring junit testing

* adding test classes for controller

* adding equals and hashcode for student for test cases

* adding changes for running test cases
This commit is contained in:
prashant1067
2016-07-15 01:15:56 +05:30
committed by Grzegorz Piwowarek
parent 5b3afb4c0d
commit 0f6218ec91
10 changed files with 370 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package com.baledung.controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baledung.student.Student;
@RestController
public class RestAnnotatedController
{
@RequestMapping(value="/annotated/student/{studentId}")
public Student getData(@PathVariable Integer studentId)
{
Student student = new Student();
student.setName("Peter");
student.setId(studentId);
return student;
}
}