use of com.jcabi.github.Contents in project jcabi-github by jcabi.
the class MkContentTest method fetchesJsonRepresentation.
/**
* MkContent should be able to fetch its JSON representation.
*
* @throws Exception if some problem inside
*/
@Test
public void fetchesJsonRepresentation() throws Exception {
final Contents contents = new MkGithub().randomRepo().contents();
final String path = "fake.txt";
final Content content = contents.create(jsonContent(path, "for json", "json test"));
MatcherAssert.assertThat(// @checkstyle MultipleStringLiterals (1 line)
content.json().getString("name"), Matchers.is(path));
}
use of com.jcabi.github.Contents in project jcabi-github by jcabi.
the class MkContentTest method canGetOwnPath.
/**
* MkContent should be able to fetch its own path.
*
* @throws Exception if some problem inside
*/
@Test
public void canGetOwnPath() throws Exception {
final Contents contents = new MkGithub().randomRepo().contents();
final String path = "dummy.txt";
final Content content = contents.create(jsonContent(path, "for path", "path test"));
MatcherAssert.assertThat(content.path(), Matchers.is(path));
}
Aggregations