### Question:
DatabaseUrlProvider { public String getSearchUrl(final long from, final long to, final Integer maxResult) { final UriComponentsBuilder builder = UriComponentsBuilder.fromUri(baseUri).pathSegment("v1") .pathSegment("getInfraActiveRequests").queryParam("from", from).queryParam("to", to); if (maxResult != null) { return builder.queryParam("maxResult", maxResult).build().toString(); } return builder.build().toString(); } DatabaseUrlProvider(final String baseUrl); String getSearchUrl(final long from, final long to, final Integer maxResult);  }### Answer:
@Test public void test_maxResultNull() { final long from = System.currentTimeMillis(); final long to = System.currentTimeMillis(); final String actualUrl = objUnderTest.getSearchUrl(from, to, null); assertEquals(URL + "v1/getInfraActiveRequests?from=" + from + "&to=" + to, actualUrl); }
@Test public void test_maxResultNotNull() { final long from = System.currentTimeMillis(); final long to = System.currentTimeMillis(); final String actualUrl = objUnderTest.getSearchUrl(from, to, MAX_RESULT); assertEquals(URL + "v1/getInfraActiveRequests?from=" + from + "&to=" + to + "&maxResult=" + MAX_RESULT, actualUrl); }