protected void onResponse(ClientResponse response) {
assertThat(response.getStatus(), is(200)); // Ok
assertJaxbUnmarshal(response,
ContainerTranslationStatistics.class);
ContainerTranslationStatistics stats =
jaxbUnmarshal(response,
ContainerTranslationStatistics.class);
assertThat(stats.getId(), is("my/path/document.txt"));
assertThat(stats.getRefs().size(), greaterThan(0));
// assertThat(stats.getDetailedStats().size(), greaterThan(0));
// // No detailed stats (maybe later)
assertThat(stats.getStats().size(), greaterThan(0));
for (TranslationStatistics transStat : stats.getStats()) {
// make sure counts are sane
assertThat(
transStat.getUntranslated() + transStat.getDraft()
+ transStat.getTranslatedAndApproved(),
equalTo(transStat.getTotal()));
}
// Results returned only for specified locales
String[] expectedLocales = new String[] { "en-US", "as", "es" };
for (TranslationStatistics transStat : stats.getStats()) {
assertThat(Arrays.asList(expectedLocales),
hasItem(transStat.getLocale()));
// make sure counts are sane
assertThat(transStat.getDraft() + transStat.getApproved()
+ transStat.getUntranslated(),