Avoid dependency on test code from different module.
@@ -5,7 +5,7 @@ import com.yahoo.processing.Processor;
import com.yahoo.processing.Request;
import com.yahoo.processing.Response;
import com.yahoo.processing.execution.Execution;
-import com.yahoo.processing.test.ProcessorLibrary;
+import com.yahoo.processing.response.AbstractData;
import static com.yahoo.application.container.docprocs.Rot13DocumentProcessor.rot13;
@@ -13,6 +13,25 @@ import static com.yahoo.application.container.docprocs.Rot13DocumentProcessor.ro
* @author Einar M R Rosenvinge
*/
public class Rot13Processor extends Processor {
+ public static class StringData extends AbstractData {
+
+ private String string;
+
+ public StringData(Request request, String string) {
+ super(request);
+ this.string = string;
+ }
+
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ @Override
+ public String toString() {
+ return string;
+ }
+
+ }
@SuppressWarnings("unchecked")
@Override
@@ -21,7 +40,7 @@ public class Rot13Processor extends Processor {
Response response = new Response(request);
if (fooObj != null) {
- response.data().add(new ProcessorLibrary.StringData(request, rot13(fooObj.toString())));
+ response.data().add(new StringData(request, rot13(fooObj.toString())));
}
return response;
}
