GetTileRequestBuilderREST implements GetTileRequestBuilder { public String build() { StringBuilder sb = new StringBuilder(); int templateCounter = 0; for (String part : parts) { if (part == null) { int index = templateIndexes[templateCounter++]; part = getString(index); } if (part != null) { sb.append(part); } } return sb.toString(); } GetTileRequestBuilderREST(String template); GetTileRequestBuilderREST layer(String layer); GetTileRequestBuilderREST style(String style); GetTileRequestBuilderREST tileMatrixSet(String tileMatrixSet); GetTileRequestBuilderREST tileMatrix(String tileMatrix); GetTileRequestBuilderREST tileRow(int tileRow); GetTileRequestBuilderREST tileCol(int tileCol); String build();  }
@Test public void unknownKeyInTemplateIsHandledAsText() { GetTileRequestBuilderREST builder = new GetTileRequestBuilderREST("foo/{bar}/baz"); String expected = "foo/{bar}/baz"; String actual = builder.build(); assertEquals(expected, actual); }