Skip to content

Commit bb4eed9

Browse files
committed
reformatted some code
1 parent ff480b0 commit bb4eed9

File tree

2 files changed

+61
-13
lines changed

2 files changed

+61
-13
lines changed

src/main/java/org/javaee7/sample/Person.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@
99
@RequestScoped
1010
@Path("persons")
1111
public class Person {
12-
13-
@Inject PersonDatabase database;
14-
15-
@GET
16-
public String get() {
17-
return database.currentList().toString();
18-
}
19-
20-
@GET
21-
@Path("{id}")
22-
public String get(@PathParam("id")int id) {
23-
return database.getPerson(id);
24-
}
12+
13+
@Inject
14+
PersonDatabase database;
15+
16+
@GET
17+
public String get() {
18+
return database.currentList().toString();
19+
}
20+
21+
@GET
22+
@Path("{id}")
23+
public String get(@PathParam("id") int id) {
24+
return database.getPerson(id);
25+
}
2526
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package org.javaee7.sample;
2+
3+
import org.junit.After;
4+
import org.junit.AfterClass;
5+
import org.junit.Before;
6+
import org.junit.BeforeClass;
7+
import org.junit.Test;
8+
import static org.junit.Assert.*;
9+
10+
/**
11+
* @author arungupta
12+
*/
13+
public class PersonTest {
14+
15+
public PersonTest() {
16+
}
17+
18+
/**
19+
* Test of get method, of class Person.
20+
*/
21+
@Test
22+
public void testGetAll() {
23+
System.out.println("get");
24+
Person instance = new Person();
25+
String expResult = "";
26+
String result = instance.get();
27+
assertEquals(expResult, result);
28+
// TODO review the generated test code and remove the default call to fail.
29+
fail("The test case is a prototype.");
30+
}
31+
32+
/**
33+
* Test of get method, of class Person.
34+
*/
35+
@Test
36+
public void testGetOne() {
37+
System.out.println("get");
38+
int id = 0;
39+
Person instance = new Person();
40+
String expResult = "";
41+
String result = instance.get(id);
42+
assertEquals(expResult, result);
43+
// TODO review the generated test code and remove the default call to fail.
44+
fail("The test case is a prototype.");
45+
}
46+
47+
}

0 commit comments

Comments
 (0)