Permalink
Browse files

fix: remove compiler warnings (#388)

  • Loading branch information...
aeng committed Jun 11, 2017
1 parent d5a4f15 commit 51597b3bb0c255c4f8832f4f19847b024f6b3c45
@@ -43,16 +43,23 @@
MockStatisticsResource.class,
MockFileResource.class,
MockProjectsResource.class,
MockProjectIterationResource.class,
MockProjectResource.class,
MockGlossaryResource.class,
MockCopyTransResource.class,
MockAccountResource.class,
MockAsynchronousProcessResource.class
);
addDeprecatedResource(builder);
services = builder.build();
}
@SuppressWarnings("deprecation")
//TODO: replace with MockProjectVersionResource
private static void addDeprecatedResource(
ImmutableSet.Builder<Class<?>> builder) {
builder.add(MockProjectIterationResource.class);
}
@Override
public Set<Class<?>> getClasses() {
return services;
@@ -27,7 +27,7 @@
private int parameterIndex = 0;
private List<T> parameters;
public ParameterRule(T... parameters) {
public ParameterRule(List<T> parameters) {
this.parameters = ImmutableList.copyOf(parameters);
}
@@ -3,6 +3,7 @@
import java.io.StringWriter;
import java.net.URL;
import com.google.common.collect.Lists;
import org.hamcrest.CoreMatchers;
import org.junit.Before;
import org.junit.Rule;
@@ -33,9 +34,10 @@
@RunWith(PowerMockRunner.class)
public class ZanataClientTest {
@Rule
public ParameterRule<String> cmdNameRule = new ParameterRule<String>(
"list-remote", "pull", "push", "put-project", "put-user",
"put-version", "stats");
public ParameterRule<String> cmdNameRule = new ParameterRule<>(
Lists.newArrayList("list-remote", "pull", "push", "put-project",
"put-user",
"put-version", "stats"));
private StringWriter out;
private StringWriter err;
@@ -145,8 +145,7 @@ private void logOutputLines(List<String> output) {
private static List<String> getOutput(Process process) throws IOException {
try (
InputStream in = process.getInputStream();
InputStream stdErr = process.getErrorStream();
OutputStream ignored2 = process.getOutputStream()) {
InputStream stdErr = process.getErrorStream()) {
List<String> output = IOUtils.readLines(in, Charsets.UTF_8);
output.addAll(IOUtils.readLines(stdErr, Charsets.UTF_8));
return output;
@@ -130,7 +130,7 @@ public void testTranslatedJSONDocument() throws Exception {
File originalFile = getTestFile("test-json-untranslated.json");
OutputStream outputStream = new ByteArrayOutputStream();
IFilterWriter writer = createWriter(outputStream);
((JsonAdapter) adapter).generateTranslatedFile(originalFile.toURI(), translations,
adapter.generateTranslatedFile(originalFile.toURI(), translations,
this.localeId, writer, Optional.absent());
assertThat(outputStream.toString()).isEqualTo("{\n"+
@@ -153,7 +153,7 @@ public void onDocStatUpdateTest() {
eq(projectSlug), eq(versionSlug), eq(strDocId), eq(localeId),
eq(contentStates), captor.capture());
assertThat(captor.getValue().size(), is(1));
assertThat(((WebHook) captor.getValue().get(0)).getTypes(),
assertThat((captor.getValue().get(0)).getTypes(),
contains(WebhookType.DocumentStatsEvent));
}
}

0 comments on commit 51597b3

Please sign in to comment.