Search in sources :

Example 1 with ReconJudgeOneCellCommand

use of com.google.refine.commands.recon.ReconJudgeOneCellCommand in project OpenRefine by OpenRefine.

the class ReconJudgeOneCellCommandTest method setUp.

@BeforeMethod
public void setUp() {
    project = createCSVProject("reconciled column,unreconciled column\n" + "a,b\n" + "c,d\n");
    Column reconciled = project.columnModel.columns.get(0);
    ReconConfig config = new StandardReconConfig("http://my.recon.service/api", "http://my.recon.service/rdf/space", "http://my.recon.service/rdf/schema", "type3894", "octopus", true, Collections.emptyList(), 5);
    reconciled.setReconConfig(config);
    request = mock(HttpServletRequest.class);
    response = mock(HttpServletResponse.class);
    when(request.getParameter("project")).thenReturn(String.valueOf(project.id));
    when(request.getParameter("csrf_token")).thenReturn(Command.csrfFactory.getFreshToken());
    writer = mock(PrintWriter.class);
    try {
        when(response.getWriter()).thenReturn(writer);
    } catch (IOException e1) {
        Assert.fail();
    }
    command = new ReconJudgeOneCellCommand();
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) StandardReconConfig(com.google.refine.model.recon.StandardReconConfig) Column(com.google.refine.model.Column) StandardReconConfig(com.google.refine.model.recon.StandardReconConfig) ReconConfig(com.google.refine.model.recon.ReconConfig) HttpServletResponse(javax.servlet.http.HttpServletResponse) ReconJudgeOneCellCommand(com.google.refine.commands.recon.ReconJudgeOneCellCommand) IOException(java.io.IOException) PrintWriter(java.io.PrintWriter) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

ReconJudgeOneCellCommand (com.google.refine.commands.recon.ReconJudgeOneCellCommand)1 Column (com.google.refine.model.Column)1 ReconConfig (com.google.refine.model.recon.ReconConfig)1 StandardReconConfig (com.google.refine.model.recon.StandardReconConfig)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 BeforeMethod (org.testng.annotations.BeforeMethod)1