minor formatting work
This commit is contained in:
parent
c77a992a52
commit
b1bdeb92d6
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue