GivenJongoCollection implements Given { @Override public void toString(StringBuilder sb) { sb.append(" - collection: ").append(collection).append("\n"); if (!Strings.isNullOrEmpty(path) && !path.equals("data: sb.append(" path: ").append(path).append("\n"); } if (!data.isEmpty()) { sb.append(" data: |\n").append(reindent(data.trim(), 8)).append("\n"); } if (!sequence.isEmpty()) { sb.append(" sequence: "); Joiner.on(", ").appendTo(sb, sequence); sb.append("\n"); } } GivenJongoCollection(String collection, String path, String data, ImmutableList<String> sequence); @Override void toString(StringBuilder sb); String getCollection(); String getPath(); String getData(); ImmutableList<String> getSequence(); GivenJongoCollection addSequenceId(String id); static final String DB_URI; }
@Test public void should_generate_yaml() throws Exception { RestxSpec testCase = restxSpecLoader.load( "restx/tests/restx_test_case_example_1.yaml"); String actual = testCase.toString(); System.out.println("actual = " + actual); assertThat(actual).isEqualTo(MoreFiles.removeWindowsCarriageReturnsBeforeLF( Resources.toString(Resources.getResource("restx/tests/expected_restx_case_example_1.yaml"), Charsets.UTF_8) )); }