Skip to content

Commit

Permalink
changes all url string to URI type
Browse files Browse the repository at this point in the history
Fixes #77

refactor strings to URI changes

arrange two more imports
  • Loading branch information
DarthKipsu authored and wakr committed Sep 13, 2015
1 parent 097db2e commit 2c72761
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Course call() throws TmcCoreException, URISyntaxException {

if (!course.isPresent()) {
throw new TmcCoreException(
"Attempted to fetch nonexistent course " + urlWithApiVersion);
"Attempted to fetch nonexistent course " + urlWithApiVersion);
}

return course.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import fi.helsinki.cs.tmc.core.domain.Course;
import fi.helsinki.cs.tmc.core.domain.ProgressObserver;
import fi.helsinki.cs.tmc.core.domain.submission.SubmissionResult;
import fi.helsinki.cs.tmc.core.exceptions.ExpiredException;
import fi.helsinki.cs.tmc.core.exceptions.TmcCoreException;
import fi.helsinki.cs.tmc.core.testhelpers.ExampleJson;

Expand Down Expand Up @@ -185,7 +186,7 @@ public void submitWithTmcCore() throws Exception {
}

@Test
public void testSubmissionWithObserver() throws Exception{
public void testSubmissionWithObserver() throws Exception {
when(submitterMock.submit(eq(path), eq(observer))).thenReturn(URI.create("xkcd.com"));
submitWithObserver.call();
verify(submitterMock).submit(eq(path), eq(observer));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ public void testSubmitWithOneParam()
this.courseSubmitter =
new ExerciseSubmitter(rootFinder, langs, urlCommunicator, tmcApi, settings);
rootFinder.setReturnValue(testPath);
URI submissionPath = URI.create(
"http://127.0.0.1:8080/submissions/1781.json?api_version=7");
URI submissionPath = URI.create
("http://127.0.0.1:8080/submissions/1781.json?api_version=7");
URI result = courseSubmitter.submit(testPath);
assertEquals(submissionPath, result);
}
Expand Down Expand Up @@ -316,8 +316,8 @@ public void testSubmitterUsesProgressObserverIfGiven() throws Exception {
this.courseSubmitter =
new ExerciseSubmitter(rootFinder, langs, urlCommunicator, tmcApi, settings);
rootFinder.setReturnValue(testPath);
URI submissionPath = URI.create(
"http://127.0.0.1:8080/submissions/1781.json?api_version=7");
URI submissionPath = URI.create
("http://127.0.0.1:8080/submissions/1781.json?api_version=7");
URI result = courseSubmitter.submit(testPath, observer);
verify(observer).progress("zipping exercise");
verify(observer).progress("submitting exercise");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class SubmissionPollerTest {

private SubmissionPoller submissionPoller;
private URI url = URI.create(
"https://tmc.mooc.fi/staging/submissions/1764.json?api_version=7&client=tmc_cli&client_version=1");
"https://example.com/staging/submissions/1764.json?api_version=7&client=tmc_cli&client_version=1");
private CoreTestSettings settings;
private TmcApi tmcApi;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
public class ReviewTest {

private static final URI updateUrl =
URI.create("http://test.mooc.duck.fi/courses/47/reviews/8");
URI.create("http://example.com/courses/47/reviews/8");
private static final URI putUrl = URI.create(updateUrl + ".json?api_version=7");
private Review review;

Expand Down

0 comments on commit 2c72761

Please sign in to comment.