Skip to content
This repository was archived by the owner on Jun 21, 2019. It is now read-only.

Wiremock #5

Merged
merged 24 commits into from
Oct 7, 2017
Merged

Wiremock #5

merged 24 commits into from
Oct 7, 2017

Conversation

MrCustomizer
Copy link
Collaborator

I've added test cases, which cover most of the http calls of the classes, which extend from AMatrixHttpClient.

Could you please have a look at it and tell me, if this can be merged or if I should make some adjustments, first?

@MrCustomizer
Copy link
Collaborator Author

The regex fix in the class MatrixHttpContent, we've talked about yesterday, is also included.

@@ -45,7 +45,7 @@

private Logger log = LoggerFactory.getLogger(MatrixHttpContent.class);

private final Pattern filenamePattern = Pattern.compile("filename=\"?(?<filename>.+)\"?;?");
private final Pattern filenamePattern = Pattern.compile("filename=\"?(?<filename>.+[^\";])");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the pattern be filename=\"?(?<filename>[^\";]+) instead?

public class MatrixHttpContentTest extends MatrixHttpTest {
private URI address = new URI("mxc://localhost/testAddress.txt");

public MatrixHttpContentTest() throws URISyntaxException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left over code?

// checkErrorInfo403(e);
return;
}
fail("In this case, an exception has to be thrown.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use @Test(expected = ....)

// checkErrorInfo429(e);
return;
}
fail("In this case, an exception has to be thrown.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use @test(expected = ....)

checkErrorInfo403(e);
return;
}
fail("In this case, an exception has to be thrown.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go after createRoomObject()... in the try {}.

createRoomObject().getTopic();
} catch (MatrixClientRequestException e) {
checkErrorInfo403(e);
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed if we refactor the fail() (see next comment)

@maxidorius maxidorius merged commit 0160179 into kamax-matrix:master Oct 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants