@Test public void testBuildEmptyResponse() { NpmSearchResponse response = underTest.buildEmptyResponse(); assertThat(response.getObjects(), is(empty())); assertThat(response.getTime(), not(nullValue())); assertThat(response.getTotal(), is(0)); }
public NpmSearchResponse buildEmptyResponse() { NpmSearchResponse response = new NpmSearchResponse(); response.setObjects(emptyList()); response.setTime(formatSearchResponseDate(DateTime.now())); response.setTotal(0); return response; }
NpmSearchResponseFactory extends ComponentSupport { public NpmSearchResponse buildEmptyResponse() { NpmSearchResponse response = new NpmSearchResponse(); response.setObjects(emptyList()); response.setTime(formatSearchResponseDate(DateTime.now())); response.setTotal(0); return response; } }
NpmSearchResponseFactory extends ComponentSupport { public NpmSearchResponse buildEmptyResponse() { NpmSearchResponse response = new NpmSearchResponse(); response.setObjects(emptyList()); response.setTime(formatSearchResponseDate(DateTime.now())); response.setTotal(0); return response; } @Inject  NpmSearchResponseFactory(final NpmSearchHitExtractor npmSearchHitExtractor); }
NpmSearchResponseFactory extends ComponentSupport { public NpmSearchResponse buildEmptyResponse() { NpmSearchResponse response = new NpmSearchResponse(); response.setObjects(emptyList()); response.setTime(formatSearchResponseDate(DateTime.now())); response.setTotal(0); return response; } @Inject  NpmSearchResponseFactory(final NpmSearchHitExtractor npmSearchHitExtractor); NpmSearchResponse buildEmptyResponse(); NpmSearchResponse buildResponseForResults(final List<Terms.Bucket> buckets, final int size, final int from); NpmSearchResponse buildResponseForObjects(final List<NpmSearchResponseObject> objects); }
NpmSearchResponseFactory extends ComponentSupport { public NpmSearchResponse buildEmptyResponse() { NpmSearchResponse response = new NpmSearchResponse(); response.setObjects(emptyList()); response.setTime(formatSearchResponseDate(DateTime.now())); response.setTotal(0); return response; } @Inject  NpmSearchResponseFactory(final NpmSearchHitExtractor npmSearchHitExtractor); NpmSearchResponse buildEmptyResponse(); NpmSearchResponse buildResponseForResults(final List<Terms.Bucket> buckets, final int size, final int from); NpmSearchResponse buildResponseForObjects(final List<NpmSearchResponseObject> objects);  }