Underc0de

Foros Generales => Dudas y pedidos generales => Mensaje iniciado por: LoKogan en Septiembre 13, 2020, 06:42:00 PM

Título: Error en test de QA
Publicado por: LoKogan en Septiembre 13, 2020, 06:42:00 PM
Buenas ,tengo este error cuando corro el código de testeo y no tengo idea a qué se refiere


When realizo una petición 'POST' a 'ANALYSIS' al endpoint de analisis - 'request/cat_analisis' # CatSteps.realizoUnaPeticiónOperationAEntityAlEndpoi
ntDeAnalisisRequest(String,String,String)
      java.lang.NoSuchMethodException: services.AnalisisService.post(api.model.Analysis)
        at java.base/java.lang.Class.getMethod(Class.java:2108)
        at ar.steps.CatSteps.realizoUnaPeticiónOperationAEntityAlEndpointDeAnalisisRequest(CatSteps.java:59)
        at ?.realizo una petición 'POST' a 'ANALYSIS' al endpoint de analisis - 'request/cat_analisis'(file:src/test/resources/features/cat_categories.f
eature:22)

    Then obtengo el status code '401'                                                              # CatSteps.obtengoElStatusCodeStatusCode(int)
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.049 s <<< FAILURE! - in TestSuite
[ERROR] ApiExampleProjectTestRunner.runScenario  Time elapsed: 1.24 s  <<< FAILURE!
java.lang.NoSuchMethodException: services.AnalisisService.post(api.model.Analysis)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   ApiExampleProjectTestRunner.runScenario » NoSuchMethod services.AnalisisServic...
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[WARNING] Could not delete temp directory C:\Users\Usuario\AppData\Local\Temp\surefire9777909246201055538 because Directory C:\Users\Usuario\AppData\Loc
al\Temp\surefire9777909246201055538 unable to be deleted.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.420 s
[INFO] Finished at: 2020-09-13T18:40:55-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test) on project lippia-api-example-project: There
are test failures.
[ERROR]
[ERROR] Please refer to D:\UTN\Autodidacta\Crowdar\Lippia-API-sample-project-master\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
"cmd" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

Título: Re:Error en test de QA
Publicado por: ANTRAX en Septiembre 13, 2020, 06:58:43 PM
Hola @LoKogan (https://underc0de.org/foro/index.php?action=profile;u=113009)
Como estas ejecutando los tests?

Saludos

Título: Re:Error en test de QA
Publicado por: LoKogan en Septiembre 13, 2020, 07:07:52 PM
mvn -P academy "-Dcucumber.tags=@AnalysisCat" test
con esa instrucción, no se si responde a tu pregunta..
Título: Re:Error en test de QA
Publicado por: ANTRAX en Septiembre 14, 2020, 07:34:26 AM
Proba dandole click derecho al testng.xml y ponele RUN.
Es otra forma de correrlo, como para ir descartando.

Saludos!
Título: Re:Error en test de QA
Publicado por: LoKogan en Septiembre 14, 2020, 12:41:29 PM
Me sigue tirando el mismo error, aparentemente está en esta linea

@When("realizo una petición '(.*)' a '(.*)' al endpoint de analisis - '(.*)'")
    public void realizoUnaPeticiónOperationAEntityAlEndpointDeAnalisisRequest(String operation, String entity, String request) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        EntityConfiguration.valueOf(entity).getEntityService().
                getMethod(operation.toLowerCase(), Analysis.class)
                .invoke("", request);

    }
}
pero no entiendo por qué si está igual a las otras