minor formatting work

This commit is contained in:
eugenp 2016-06-18 23:52:26 +03:00
parent c77a992a52
commit b1bdeb92d6
4 changed files with 2479 additions and 2616 deletions

View File

@ -108,7 +108,7 @@ public class SandboxTest {
// Make a client using those creds
final CloseableHttpClient client = HttpClients.custom().setDefaultCookieStore(cookieStore).setDefaultCredentialsProvider(credsProvider).build();
// And make a call to the URL we are after
final HttpGet httpget = new HttpGet("http://httpbin.org/digest-auth/auth/user/passwd");
@ -127,6 +127,7 @@ public class SandboxTest {
try {
System.out.println("----------------------------------------");
System.out.println(responseGood.getStatusLine());
assertEquals(200, responseGood.getStatusLine().getStatusCode());
} finally {
responseGood.close();

View File

@ -32,17 +32,9 @@ public class Application {
public CourseRepository createStubCourses() {
Map<Integer, Course> courses = new HashMap<>();
Course course1 = Course.newBuilder()
.setId(1)
.setCourseName("REST with Spring")
.addAllStudent(createStubStudents())
.build();
Course course1 = Course.newBuilder().setId(1).setCourseName("REST with Spring").addAllStudent(createStubStudents()).build();
Course course2 = Course.newBuilder()
.setId(2)
.setCourseName("Learn Spring Security")
.addAllStudent(new ArrayList<>())
.build();
Course course2 = Course.newBuilder().setId(2).setCourseName("Learn Spring Security").addAllStudent(new ArrayList<>()).build();
courses.put(course1.getId(), course1);
courses.put(course2.getId(), course2);

View File

@ -7,11 +7,11 @@ import java.util.Map;
public class CourseRepository {
private final Map<Integer, Course> courses;
public CourseRepository (Map<Integer, Course> courses) {
public CourseRepository(Map<Integer, Course> courses) {
this.courses = courses;
}
public Course getCourse(int id) {
return courses.get(id);
}