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
|
// Make a client using those creds
|
||||||
final CloseableHttpClient client = HttpClients.custom().setDefaultCookieStore(cookieStore).setDefaultCredentialsProvider(credsProvider).build();
|
final CloseableHttpClient client = HttpClients.custom().setDefaultCookieStore(cookieStore).setDefaultCredentialsProvider(credsProvider).build();
|
||||||
|
|
||||||
// And make a call to the URL we are after
|
// And make a call to the URL we are after
|
||||||
final HttpGet httpget = new HttpGet("http://httpbin.org/digest-auth/auth/user/passwd");
|
final HttpGet httpget = new HttpGet("http://httpbin.org/digest-auth/auth/user/passwd");
|
||||||
|
|
||||||
@ -127,6 +127,7 @@ public class SandboxTest {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
System.out.println("----------------------------------------");
|
System.out.println("----------------------------------------");
|
||||||
|
System.out.println(responseGood.getStatusLine());
|
||||||
assertEquals(200, responseGood.getStatusLine().getStatusCode());
|
assertEquals(200, responseGood.getStatusLine().getStatusCode());
|
||||||
} finally {
|
} finally {
|
||||||
responseGood.close();
|
responseGood.close();
|
||||||
|
@ -32,17 +32,9 @@ public class Application {
|
|||||||
public CourseRepository createStubCourses() {
|
public CourseRepository createStubCourses() {
|
||||||
Map<Integer, Course> courses = new HashMap<>();
|
Map<Integer, Course> courses = new HashMap<>();
|
||||||
|
|
||||||
Course course1 = Course.newBuilder()
|
Course course1 = Course.newBuilder().setId(1).setCourseName("REST with Spring").addAllStudent(createStubStudents()).build();
|
||||||
.setId(1)
|
|
||||||
.setCourseName("REST with Spring")
|
|
||||||
.addAllStudent(createStubStudents())
|
|
||||||
.build();
|
|
||||||
|
|
||||||
Course course2 = Course.newBuilder()
|
Course course2 = Course.newBuilder().setId(2).setCourseName("Learn Spring Security").addAllStudent(new ArrayList<>()).build();
|
||||||
.setId(2)
|
|
||||||
.setCourseName("Learn Spring Security")
|
|
||||||
.addAllStudent(new ArrayList<>())
|
|
||||||
.build();
|
|
||||||
|
|
||||||
courses.put(course1.getId(), course1);
|
courses.put(course1.getId(), course1);
|
||||||
courses.put(course2.getId(), course2);
|
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 {
|
public class CourseRepository {
|
||||||
|
|
||||||
private final Map<Integer, Course> courses;
|
private final Map<Integer, Course> courses;
|
||||||
|
|
||||||
public CourseRepository (Map<Integer, Course> courses) {
|
public CourseRepository(Map<Integer, Course> courses) {
|
||||||
this.courses = courses;
|
this.courses = courses;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Course getCourse(int id) {
|
public Course getCourse(int id) {
|
||||||
return courses.get(id);
|
return courses.get(id);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user