Giter VIP home page Giter VIP logo

vidhya03 / http-patch-jax-rs Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 4.0 8.44 MB

A simple HTTP REST service web application also called as Person API

Home Page: http://http-patch-vidhya.1d35.starter-us-east-1.openshiftapps.com/

License: MIT License

Java 93.52% HTML 0.62% Shell 0.13% Gherkin 4.56% JavaScript 1.17%
spotbugs coverage cobertura jacoco maven openshift karate swagger api jax-rs

http-patch-jax-rs's Introduction

Person API

Build Status codecov License: MIT HitCount GitHub issues PRs Welcome

A simple HTTP REST service web application also called as Person API

Heads up

Development

  • checkout
  git clone https://github.com/vidhya03/http-patch-jax-rs.git
  • compile
  cd  http-patch-jax-rs.git
  mvn compile
  • Spotbugs SpotBugs is a program which uses static analysis to look for bugs in Java code.

    Spotbugs can be triggred via compile time.

  mvn -Pspotbugs compile

Spotbugs can also be check by using the below command.

  mvn -Pspotbugs spotbugs:check

Debug the spotbugs error via the following command.

  mvn -Pspotbugs spotbugs:gui

The above command will popup spotbugs errors in GUI like this spotbugs error view in GUI

Rest API testing using karate

  • To run test against production
  mvn test
  • To run test against local deployment
  mvn test -Dkarate.env=dev

and the HTML reports would be output to /target/surefire-reports/TEST-com.labkit.test.personapi.PersonApi.html karate test Report

Code Coverage using Cobertura

  • To run test and perform code coverage
  mvn cobertura:cobertura

and the HTML reports would be output to target/site/cobertura/index.html Cobertura Code Coverage Report

Code Coverage using Jacoco

  • To run test and perform code coverage
  mvn clean test -Pcoverage

and the HTML reports would be output to target/site/jacoco/index.html Jacoco Code Coverage Report

License

Credits

http-patch-jax-rs's People

Contributors

sam1502 avatar vidhya03 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

http-patch-jax-rs's Issues

Running AppRunner.java throws - jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "karate" is not defined

Running the standalone AppRunner.java throws the below error

jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "karate" is not defined
`

Building HTTP-PATCH-JAX-RS Web APP 1.0-SNAPSHOT

--- exec-maven-plugin:1.2.1:exec (default-cli) @ HTTP-PATCH-JAX-RS ---
00:02:15.465 [JavaFX Application Thread] ERROR com.intuit.karate.ui.AppSession - javascript function call failed, arg: null
function() {
var env = karate.env; // get system property 'karate.env'
karate.log('karate.env system property was:', env);
if (!env) {
env = 'live';
}
var config = {
env: env,
apiUrl: 'http://http-patch-vidhya.1d35.starter-us-east-1.openshiftapps.com/v1/'
};
if (env === 'dev') {
// customize
config.apiUrl = 'http://localhost:18080/http-patch-jax-rs/v1';
} else if (env === 'e2e') {
// customize
}
//Right now commenting the below for future use
// config.myObject = karate.read('classpath:test.json');
return config;
}
jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "karate" is not defined
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)
at jdk.nashorn.internal.objects.Global.noSuchProperty(Global.java:1426)
at jdk.nashorn.internal.scripts.Script$Recompilation$4$11$^eval_.L:1(:2)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117)
at com.intuit.karate.Script.evalFunctionCall(Script.java:1491)
at com.intuit.karate.Script.call(Script.java:1449)
at com.intuit.karate.Script.callAndUpdateConfigAndAlsoVarsIfMapReturned(Script.java:1564)
at com.intuit.karate.ScriptContext.(ScriptContext.java:144)
at com.intuit.karate.StepDefs.(StepDefs.java:81)
at com.intuit.karate.cucumber.KarateObjectFactory.getInstance(KarateObjectFactory.java:80)
at com.intuit.karate.cucumber.KarateObjectFactory.getStepDefs(KarateObjectFactory.java:87)
at com.intuit.karate.cucumber.KarateBackend.getStepDefs(KarateBackend.java:104)
at com.intuit.karate.ui.AppSession.getVars(AppSession.java:150)
at com.intuit.karate.ui.VarsPanel.(VarsPanel.java:62)
at com.intuit.karate.ui.AppSession.(AppSession.java:104)
at com.intuit.karate.ui.AppSession.(AppSession.java:69)
at com.intuit.karate.ui.App.initUi(App.java:63)
at com.intuit.karate.ui.App.start(App.java:102)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: evaluation of karate-config.js failed:
at com.intuit.karate.ScriptContext.(ScriptContext.java:153)
at com.intuit.karate.StepDefs.(StepDefs.java:81)
at com.intuit.karate.cucumber.KarateObjectFactory.getInstance(KarateObjectFactory.java:80)
at com.intuit.karate.cucumber.KarateObjectFactory.getStepDefs(KarateObjectFactory.java:87)
at com.intuit.karate.cucumber.KarateBackend.getStepDefs(KarateBackend.java:104)
at com.intuit.karate.ui.AppSession.getVars(AppSession.java:150)
at com.intuit.karate.ui.VarsPanel.(VarsPanel.java:62)
at com.intuit.karate.ui.AppSession.(AppSession.java:104)
at com.intuit.karate.ui.AppSession.(AppSession.java:69)
at com.intuit.karate.ui.App.initUi(App.java:63)
at com.intuit.karate.ui.App.start(App.java:102)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
... 1 more
Caused by: com.intuit.karate.exception.KarateException:
ReferenceError: "karate" is not defined
at com.intuit.karate.Script.evalFunctionCall(Script.java:1497)
at com.intuit.karate.Script.call(Script.java:1449)
at com.intuit.karate.Script.callAndUpdateConfigAndAlsoVarsIfMapReturned(Script.java:1564)
at com.intuit.karate.ScriptContext.(ScriptContext.java:144)
... 19 more

BUILD FAILURE

Total time: 2.729s
Finished at: Wed Jan 24 00:02:15 IST 2018
Final Memory: 8M/153M
`

Build failure because of patch method. however when i try to run test against glassfish server it works.

Reproducible steps

https://travis-ci.org/vidhya03/http-patch-jax-rs/builds/329809916

Steps to reproduce locally
Run the PersonAPITestRunner , the Scenario: Test for PATCH METHOD alone fails
and getting the below error
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: [B@1aec7185; line: 1, column: 2]

hope this might be route cause in wildfly server

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.