Skip to content

Commit

Permalink
code cleanup and removed unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
germanattanasio committed Jun 6, 2016
1 parent de1655f commit 9be6936
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@
import java.util.List;
import java.util.Map;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.junit.Before;
import org.junit.Test;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.ibm.watson.developer_cloud.WatsonServiceTest;
import com.ibm.watson.developer_cloud.language_translation.v2.model.CreateModelOptions;
import com.ibm.watson.developer_cloud.language_translation.v2.model.IdentifiableLanguage;
import com.ibm.watson.developer_cloud.language_translation.v2.model.IdentifiedLanguage;
import com.ibm.watson.developer_cloud.language_translation.v2.model.TranslationModel;
import com.ibm.watson.developer_cloud.language_translation.v2.model.Language;
import com.ibm.watson.developer_cloud.language_translation.v2.model.TranslationResult;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,21 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.mockserver.model.HttpRequest.request;
import static org.mockserver.model.HttpResponse.response;

import java.io.File;
import java.io.FileInputStream;
import java.lang.reflect.Type;
import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.ibm.watson.developer_cloud.service.exception.BadRequestException;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import org.junit.Before;
import org.junit.Test;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import com.google.gson.reflect.TypeToken;
import com.ibm.watson.developer_cloud.WatsonServiceUnitTest;
import com.ibm.watson.developer_cloud.http.HttpMediaType;
Expand All @@ -49,9 +42,12 @@
import com.ibm.watson.developer_cloud.language_translation.v2.model.TranslationModel;
import com.ibm.watson.developer_cloud.language_translation.v2.model.TranslationModels;
import com.ibm.watson.developer_cloud.language_translation.v2.model.TranslationResult;
import com.ibm.watson.developer_cloud.service.exception.BadRequestException;
import com.ibm.watson.developer_cloud.util.GsonSingleton;

import io.netty.handler.codec.http.HttpHeaders;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;

/**
* The Class LanguageTranslationTest.
Expand Down Expand Up @@ -309,11 +305,4 @@ private static MockResponse jsonResponse(Object o) {
.addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_JSON)
.setBody(GSON.toJson(o));
}

private static MockResponse jsonResponse(String key, Object o) {
return new MockResponse()
.addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_JSON)
.setBody(GSON.toJson(ImmutableMap.of(key, o)));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@
package com.ibm.watson.developer_cloud.text_to_speech.v1;


import static io.netty.handler.codec.http.HttpHeaders.Names.CONTENT_TYPE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.List;
import java.util.Map;

import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;

import org.junit.Assert;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Files;
Expand All @@ -25,27 +51,12 @@
import com.ibm.watson.developer_cloud.text_to_speech.v1.util.WaveUtils;
import com.ibm.watson.developer_cloud.util.GsonSingleton;
import com.ibm.watson.developer_cloud.util.TestUtils;

import okhttp3.HttpUrl;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import okio.Buffer;
import org.junit.Assert;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;
import java.io.*;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.List;
import java.util.Map;

import static io.netty.handler.codec.http.HttpHeaders.Names.CONTENT_TYPE;
import static org.junit.Assert.*;

/**
* The Class TextToSpeechTest.
Expand Down Expand Up @@ -180,6 +191,7 @@ public void testGetVoice() {
* @throws IOException
* @throws InterruptedException
*/
@SuppressWarnings("resource")
@Test
public void testSynthesize() throws IOException, InterruptedException {
final File audio = new File("src/test/resources/speech_to_text/sample1.wav");
Expand Down

0 comments on commit 9be6936

Please sign in to comment.