profile
viewpoint

luvarqpp/asciidoctor-maven-plugin 0

A Maven plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.

luvarqpp/asciidoctor.org 0

:globe_with_meridians: Asciidoctor project site. Composed in AsciiDoc. Baked with Awestruct.

luvarqpp/automator-maven-plugin 0

the jamo automator maven plugin

luvarqpp/docker 0

Docker official jenkins repo

luvarqpp/documentation 0

📘 Nextcloud documentation

luvarqpp/hibernate-orm 0

Hibernate's core Object/Relational Mapping functionality

luvarqpp/hibernate-types 0

The Hibernate Types repository gives you extra types that are not supported by the Hibernate ORM core.

luvarqpp/jOOQ 0

jOOQ is the best way to write SQL in Java

luvarqpp/jqwik 0

Property-Based Testing on the JUnit Platform

issue commentgatling/gatling

HTTP Recorder: IllegalArgumentException if URI in Request consists of path and query, only

Here it is:

05:49:13.781 [WARN ] i.n.c.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.IllegalArgumentException: http:///mockCiselnikAdapterServiceBinding/ciselnik-method could not be parsed into a proper Uri, missing host
	at io.gatling.http.client.uri.Uri.create(Uri.java:95)
	at io.gatling.http.client.uri.Uri.create(Uri.java:84)
	at io.gatling.recorder.http.flows.Remote$.fromAbsoluteUri(MitmActorFSM.scala:37)
	at io.gatling.recorder.http.ServerHandler.channelRead(ServerHandler.scala:56)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:830)

SoapUI:

  • proxy in settings set to None
  • inside I have running mock server on port 8088
  • I was calling directly gatling recorder, address http://localhost:8000/mockCiselnikAdapterServiceBinding/ciselnik-method

Gatling recorder:

  • running on port 8000
  • started from Recorder.scala helper class from Intelij IDE

No request hit the mock server in SoapUI and in Intelij run console, given exception is the only log message printed.

I can provide also tcp dump if needed. Just say so.

cschabl

comment created time in 6 days

pull request commentgatling/gatling-highcharts-maven-archetype

Compile scala code by maven

@slandelle no problem, done.

PS: making 3.4.0-M1 things in branch would be a bit more clear for me. I was searching for changes for IDEPathHelper and Engine after updating to latest milestone (due to https://github.com/gatling/gatling/issues/3822 fix).

PS2: Thanks for great product.

luvarqpp

comment created time in 7 days

push eventluvarqpp/gatling-highcharts-maven-archetype

luvarqpp

commit sha d76caf39135ca455f916dc62a11aafb5d842e491

Update pom.xml

view details

push time in 7 days

pull request commentgatling/gatling-highcharts-maven-archetype

Compile scala code by maven

@slandelle thanks for info. I have tried testSourceDirectory property and it is working (at least with 2020.1 Beta intelij).

luvarqpp

comment created time in 7 days

issue commentgatling/gatling

HTTP Recorder: IllegalArgumentException if URI in Request consists of path and query, only

I was trying SoapUI client on SoapUI mock server. I have made direct http request from SoapUI to gatling recorder. It has triggered this exception. After I have found information that proxy servers should receive absolute urls, I have changed endpoint url back to SoapUI mock server (localhost:8088) and I have configured SoapUI to use http proxy (gatling recorder running on localhost:8000).

cschabl

comment created time in 7 days

issue commentgatling/gatling

HTTP Recorder: IllegalArgumentException if URI in Request consists of path and query, only

@luvarqpp How is the message not explicit enough? Could you please elaborate on your pain points?

java.lang.IllegalArgumentException: /foo/v1/customers?firstName=Fred&lastName=Flintstone&phoneNo=%2B12+345+678+448+56
could not be parsed into a proper Uri, missing scheme

I would like to include possible causes/solutions. At least info about that relative url was used instead of absolute one and perhaps info that absolute urls are mandatory when there is correct proxy communication used.

I know that solutions in exceptions are not always correct (can be more confusing than relevant sometimes), but it could sometimes save some "google query" for new newbies.

What do you think?

cschabl

comment created time in 7 days

issue commentgatling/gatling

HTTP Recorder: IllegalArgumentException if URI in Request consists of path and query, only

Just some hint (at least in source code) would be helpful. Do you like idea of adding some sentence to exception? I would make PR.

cschabl

comment created time in 7 days

PR opened gatling/gatling-highcharts-maven-archetype

Compile scala code by maven

Make resulting project use of scala-maven-plugin according https://gatling.io/docs/current/installation#with-maven manual and compile projects scala source files by scala out-of-the-box. IntelijIdea is now able to run generated object files (it knows that it is scala compiled) and also maven can compile generated project.

+29 -0

0 comment

1 changed file

pr created time in 7 days

push eventluvarqpp/gatling-highcharts-maven-archetype

luvarqpp

commit sha ceda1f035272d5b62fcabef384122619d67051b4

Compile scala code by maven Make resulting project use of `scala-maven-plugin` according https://gatling.io/docs/current/installation#with-maven manual and compile projects scala source files by scala out-of-the-box. IntelijIdea is now able to run generated object files (it knows that it is scala compiled) and also maven can compile generated project.

view details

push time in 7 days

push eventluvarqpp/spring-restdocs

luvarqpp

commit sha abb49cd538f964b5aabe1e179e0d14d1e302a7cf

Update pom.xml

view details

push time in 10 days

push eventluvarqpp/spring-restdocs

luvarqpp

commit sha 7b853ff136a6932988151939d3704e4c9250fca9

Update pom.xml

view details

push time in 10 days

push eventluvarqpp/spring-restdocs

luvarqpp

commit sha 59d51b329cef3dabbd3a9113281292da1191abe8

Update pom.xml

view details

push time in 10 days

PR opened spring-projects/spring-restdocs

Add plugin repo and update dependencies

Please review my changes, at least commenting out spring-restdocs.version property (if it is in line with repo casual usage).

+15 -3

0 comment

1 changed file

pr created time in 10 days

push eventluvarqpp/spring-restdocs

luvarqpp

commit sha e02d9dce8302223ad3a6d0d4bc4a8424a78fb511

Add plugin repo and update dependencies

view details

push time in 10 days

issue commentasciidoctor/asciidoctor-intellij-plugin

Non breaking space

I think that ROUNDED_BOX effect could be nice (on single space character). If it would be too disturbing, IMHO colored background would be enough. Inspection would be also handy in some cases.

luvarqpp

comment created time in 12 days

issue commentspring-projects/spring-security

Nullable parameter throws NPE

I have setup with .sessionCreationPolicy(SessionCreationPolicy.STATELESS), custom .authenticationEntryPoint(new RestAuthenticationEntryPoint()), .oauth2Login(), custom .userInfoEndpoint().userService(customOAuth2UserService) and also custom auth filter http.addFilterBefore(tokenAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);. I have triggered this NPE by using webTestClientBuilder.build().mutateWith(csrf()) call (failed in SecurityMockServerConfigurers.CsrfMutator, like this issue).

On the other side, it seems OK, to have csrf disabled, when using Authorization header with Bearer token and having redirect restriction (due "referrer" header) on authorization server.

mikhail-putilov

comment created time in 14 days

issue commentspring-projects/spring-security

ReactiveSecurityContextHolder.getContext().block() is null with custom AuthenticationToken (Sample provided)

I have an issue, which pointed me here. I am trying to use CsrfMutator and it fails on NPE. Can this issue be connected to https://github.com/spring-projects/spring-security/issues/7778 ?

eximius313

comment created time in 16 days

issue commentasciidoctor/asciidoctor-intellij-plugin

Non breaking space

Folding of {nbsp} is working. I will stick to AltGr+Space perhaps, but I like folding is present.

luvarqpp

comment created time in 16 days

issue commentasciidoctor/asciidoctor-intellij-plugin

Non breaking space

Thanks for fast response. I have done additional research. My setup: ubuntu 18.04 linux, i3wm (tiling window manager), intelij idea 2019.3.4.

I have found that inserting space by pressing AltGr+Space (learned from wikipedia) will actually insert character with C2 A0 codes (two bytes). I have turned settings->editor->appearance->general->show whitespaces (all) to on. Visualization is done slightly differently, so I can distinguish normal space and non breaking one.

settings

Normal space is visualized as small dot and AltGr+Space is visualized as "nothing, just space". See attached image: sampleVisualization For ordinary humans, without magnifying glass, there is no "dot" after "of" and "the" word. After other words, there is a tiny dot.

PS: I like folding thing. I will try it when I have some spare time.

I think, this issue can be closed. I have only one think left. I need to remap Ctrl+Shift+Space to AltGr+Space in my head.

luvarqpp

comment created time in 17 days

issue openedasciidoctor/asciidoctor-intellij-plugin

Non breaking space

  1. I have need for non breaking space. I am using UTF-8 character for that: " ". I expect, that plugin will correctly handle it.

  2. Second thing is that from libreoffice, I am used to insert nbsp with Shift+Ctrl+Space. It would be handy to have given shortcut declared.

Please provide a minimal Asciidoctor example for the problem. Of course I do not like breaks to occur just after the "short words" (definite article, preposition, ...). It depends on your preview window width if you trigger wrapping of nbps.

Plugin is through working ok with "{nbsp}" macro, described here.

Perhaps, this "issue" can be solved by learning, what to use as non breaking space. IMHO macro "{nbsp}" is ugly in raw text and it is "unreadable". Is there any other working non-breaking space character, which is being rendered as "space" in raw text, in plugin preview and also correctly in final html?

AsciiDoc Plugin Version: 0.30.42

IDE Name and Version: IntelliJ IDEA 2019.3.4 (Community Edition) Build #IC-193.6911.18, built on March 17, 2020 Runtime version: 11.0.6+8-b520.43 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 5.3.0-40-generic GC: ParNew, ConcurrentMarkSweep Memory: 1910M Cores: 8 Registry: Non-Bundled Plugins: DBN, Docker, Lombook Plugin, com.intellij.lang.jsgraphql, com.oliverlockwood.plugins.jenkinsfile, im.jeanfrancois.ideaplugins.ideafullscreen, net.seesharpsoft.intellij.plugins.csv, org.asciidoctor.intellij.asciidoc, org.intellij.scala, training

created time in 18 days

PR opened ivarprudnikov/test-spring-jpa-repository-query-exposed-through-http

Use left join instead of cartesian product

Use left join instead of Cartesian product. It is a bit more readable and it makes a bit easier life of database planner. See https://stackoverflow.com/questions/25271333/sql-speed-increase-left-join-or-cartesian-product-where-clause

PS: Note, that I have not tried this change on my pc, I have done edit through web.

+1 -1

0 comment

1 changed file

pr created time in 24 days

push eventluvarqpp/test-spring-jpa-repository-query-exposed-through-http

luvarqpp

commit sha 6dc6f286cfc443b4c0c8371e5ed6ec50cf10aa01

Use left join instead of cartesian product Use left join instead of Cartesian product. It is a bit more readable and it makes a bit easier life of database planner. See https://stackoverflow.com/questions/25271333/sql-speed-increase-left-join-or-cartesian-product-where-clause

view details

push time in 24 days

startedpostgres/postgres

started time in 2 months

issue commentodrotbohm/spring-restbucks

Integrate Spring-RESTDocs

You can have a look at restdocs branch of this project. There is some stub of documentation.

Some official sample apps (smaller than restbucks through) is listed on official documentation, https://docs.spring.io/spring-restdocs/docs/2.0.x/reference/html5/#getting-started-sample-applications

otrosien

comment created time in 2 months

issue openedspring-projects/rest-shell

list command appends one more '/'

When I start latest (1.2.1, from 2012) rest-shell and enter commands:

baseUri http://localhost:9091/api
headers set --name Accept --value application/hal+json

than list command will end with error:

Command failed org.springframework.web.client.HttpServerErrorException: 500 null

Server side (spring boot with current versions of all things) will log:

2020-02-13 14:32:21.810 DEBUG 2421 --- [nio-9091-exec-2] o.a.c.authenticator.AuthenticatorBase    : Security checking request GET /api//
2020-02-13 14:32:21.810 DEBUG 2421 --- [nio-9091-exec-2] org.apache.catalina.realm.RealmBase      :   No applicable constraints defined
2020-02-13 14:32:21.810 DEBUG 2421 --- [nio-9091-exec-2] o.a.c.authenticator.AuthenticatorBase    : Not subject to any constraint
2020-02-13 14:32:21.811 ERROR 2421 --- [nio-9091-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception

org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL contained a potentially malicious String "//"
	at org.springframework.security.web.firewall.StrictHttpFirewall.rejectedBlacklistedUrls(StrictHttpFirewall.java:369) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.firewall.StrictHttpFirewall.getFirewalledRequest(StrictHttpFirewall.java:336) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:194) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:108) ~[spring-boot-actuator-2.2.4.RELEASE.jar:2.2.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:103) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1598) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.30.jar:9.0.30]
	at java.base/java.lang.Thread.run(Thread.java:830) ~[na:na]

Notice, that list command does issue get on server with suffix like // and this uri does not pass security check.

PS: discover command does not generally work. get without parameters can be helpful through.

SIde question: Is there some more recent project with similar functionality? I mean some cli with help in navigating RESTfull service built using spring-data-rest (hateoas) on latest springboot?

created time in 2 months

issue commentspring-projects/rest-shell

Add HAL-support

Also setting Accept header can help sometimes.

In rest-shell:

headers set --name Accept --value application/hal+json
lazee

comment created time in 2 months

issue commentjlink/jqwik

Support for Lifecycle Hooks and Annotations

Is there any possibility to mess with random seed?

Currently it can only be read. What scenario do you have in mind for changing it?

It is just hypothetical scenario, which have visited my mind when I have read about lifecycle hooks: There are sometime build setups which are running on CI/CD services, which does not persist workspace folder (i.e. folder with project). For example temporal jenkins nodes, or utilizing docker for build (similar like hateoas jenkins file shows). In such environments, .jqwik-database would not be persisted between builds. There are also organizations, where they does not heard about DevOps and builds are done using single "weBuildAnythingRightTM" script, which cannot be customized. In such minor scenario, I would try to use lifecycle hooks to save last failing seed after suite to external storage (database, "ftp", or something like webdav for example) and than use it in BeforeSuite to insert into jqwik.

Have on mind, that this is just hypothetical scenario and I have no need for it now.

emmmile

comment created time in 2 months

issue commentjlink/jqwik

Support for Lifecycle Hooks and Annotations

Is there any possibility to mess with random seed? i.e. to have last failed seed saved somewhere else than .jqwik-database file? I would expect something like @BeforeSuite possible and @AfterSuite with required data passed to methods.

Feedback: delegation over inheritance is very welcome.

emmmile

comment created time in 2 months

delete branch luvarqpp/jqwik

delete branch : patch-javadocStatistics

delete time in 2 months

pull request commentjlink/jqwik

Extend javadoc around Statistics usage

Hi, I am a bit confused by github review functionality... I have seen coding style guide somewhere in contribution part of jqwik project and I have forgot. Sorry. Currently I have imported style in my idea and I have rebased my pull request branch (and force pushed). Code formatting on Statistics.java does no change now (against thing in my branch).

Question: is there any common (like mvn clean test) test command for gradle project, which should I do before commit/push?

luvarqpp

comment created time in 2 months

push eventluvarqpp/jqwik

Johannes Link

commit sha 81d2cc5310c4bc6ad9ab5b3a888dec9910e6c6c8

Some progress with duplicate shrinking but strange behaviour (failing tests)

view details

Johannes Link

commit sha bb2eb944490cc84f1c56f8973475afc6503a9a58

More failing tests

view details

Johannes Link

commit sha 1db8b0b025f290df33fdd12731f8dacd026defb7

Duplicate shrinking works (more or less)

view details

Johannes Link

commit sha 2d3893a7665833a8679a92aeab09a898c3d40804

Simplified checking for shrunk values. One test still sporadically failing.

view details

Johannes Link

commit sha 586bc993a3f3dc993171e41018c7635d138620e3

Starting work on completing shrinkingSuggestions() - tests failing

view details

Johannes Link

commit sha 3eafb84a9e5de50a5e59b56be65a53600547e412

Added more shrinkingSuggestions() implementations

view details

Johannes Link

commit sha 392d4d7b31c991c0849bd7029d7e43bab10f9c2e

Improved shrinkingSuggestions() for ShrinkableContainer

view details

Johannes Link

commit sha 49527d0310c5642d1f6114c6bd5f86dab0346e49

Improved javadoc of Arbitrary.sample

view details

Johannes Link

commit sha 376a974e96501cee5cbd9ffcd20f1a1f29ac0dfb

Implemented shrinkingSuggestions() for unique()

view details

Johannes Link

commit sha c54486490abdee0c83acc9a551771786e9540049

Implemented shrinkingSuggestions() for lazy()

view details

Johannes Link

commit sha d61e79814defdc45acebcde93675cd85a4133c35

Finished ShrinkingSuggestionsTests

view details

Johannes Link

commit sha 9f7977633f1d174dc9c0f36ed1a6b992f1a0c95d

Finished work on duplicate values shrinking

view details

Ľubomír Varga

commit sha 56daa846dce8d2a644a621c60d286579317da675

Make StatisticsCollector.collect return this reference

view details

Johannes Link

commit sha 84ec2ec2e1226ada92bdd6e23ade7d63bd5ef418

Removed Statistics.coverageOf()

view details

Johannes Link

commit sha 25cf223400dd5874823cd4a332d0af0ac93520cf

made ActionSequenceInvariantTests more robust against flaky condition

view details

Ľubomír Varga

commit sha 33feb9d999cce576912ae606649d39b090d9043e

Extend javadoc around Statistics usage Link to documentation inspired by project lombok style, see https://github.com/rzwitserloot/lombok/blob/master/src/core/lombok/Builder.java#L55

view details

push time in 2 months

push eventluvarqpp/jqwik

Johannes Link

commit sha 81d2cc5310c4bc6ad9ab5b3a888dec9910e6c6c8

Some progress with duplicate shrinking but strange behaviour (failing tests)

view details

Johannes Link

commit sha bb2eb944490cc84f1c56f8973475afc6503a9a58

More failing tests

view details

Johannes Link

commit sha 1db8b0b025f290df33fdd12731f8dacd026defb7

Duplicate shrinking works (more or less)

view details

Johannes Link

commit sha 2d3893a7665833a8679a92aeab09a898c3d40804

Simplified checking for shrunk values. One test still sporadically failing.

view details

Johannes Link

commit sha 586bc993a3f3dc993171e41018c7635d138620e3

Starting work on completing shrinkingSuggestions() - tests failing

view details

Johannes Link

commit sha 3eafb84a9e5de50a5e59b56be65a53600547e412

Added more shrinkingSuggestions() implementations

view details

Johannes Link

commit sha 392d4d7b31c991c0849bd7029d7e43bab10f9c2e

Improved shrinkingSuggestions() for ShrinkableContainer

view details

Johannes Link

commit sha 49527d0310c5642d1f6114c6bd5f86dab0346e49

Improved javadoc of Arbitrary.sample

view details

Johannes Link

commit sha 376a974e96501cee5cbd9ffcd20f1a1f29ac0dfb

Implemented shrinkingSuggestions() for unique()

view details

Johannes Link

commit sha c54486490abdee0c83acc9a551771786e9540049

Implemented shrinkingSuggestions() for lazy()

view details

Johannes Link

commit sha d61e79814defdc45acebcde93675cd85a4133c35

Finished ShrinkingSuggestionsTests

view details

Johannes Link

commit sha 9f7977633f1d174dc9c0f36ed1a6b992f1a0c95d

Finished work on duplicate values shrinking

view details

Ľubomír Varga

commit sha 56daa846dce8d2a644a621c60d286579317da675

Make StatisticsCollector.collect return this reference

view details

Johannes Link

commit sha 84ec2ec2e1226ada92bdd6e23ade7d63bd5ef418

Removed Statistics.coverageOf()

view details

Johannes Link

commit sha 25cf223400dd5874823cd4a332d0af0ac93520cf

made ActionSequenceInvariantTests more robust against flaky condition

view details

push time in 2 months

issue commentjlink/jqwik

Implement coverage checking for statistical values

In #89 I am delivering the goods. Please review it at least for grammar and style.

In #90 I have tried to "return this" for collect method. If you reconsider its value, you can just use it. It is through extra simple change.

jlink

comment created time in 2 months

PR opened jlink/jqwik

Make StatisticsCollector.collect return this reference

Overview

Addressing another "issue" from https://github.com/jlink/jqwik/issues/75

Making possible:

        Statistics.label("passwdLength").collect(pwdLen).coverage(checker -> {
            checker.check("zero").count(x -> x > 10);
            checker.check("9..13").count(x -> x > 10);
            checker.check("more than 13").count(x -> x > 10);
        });

Details

Note, that behavior of this code is somewhat questionable:

        Statistics.label("labelFizz").collect(3L).coverageOf("buzz", checker -> {
            checker.check(5L).count(x -> x > 10);
        });

Should it be "fixed" by prohibiting making coverageOf unavailable in "LabeledStatisticsCollector"?


I hereby agree to the terms of the jqwik Contributor Agreement.

+3 -2

0 comment

2 changed files

pr created time in 2 months

create barnchluvarqpp/jqwik

branch : patch-fluentCollectMethod

created branch time in 2 months

push eventluvarqpp/jqwik

Johannes Link

commit sha 788a7d7c639c8daadebefc2e6e6f7a2cf683cfa1

Update TODO

view details

Johannes Link

commit sha 6bb1c6a550af4eda1d52b2bc3a008256783447c2

Update TODO

view details

luvarqpp

commit sha 202f27f602fa7a65e9f6e9fb93c7e32dbf939699

fix wrong link Link for example was not correct. Now it points to https://github.com/jlink/jqwik/blob/1.1.2/documentation/src/test/java/net/jqwik/docs/types/TypeArbitraryExamples.java instead of https://github.com/jlink/jqwik/blob/1.2.1/documentation/src/test/java/net/jqwik/docs/types/PersonProperties.java . Fix was applied to actual document and also template file and a few other versions of doc.

view details

Johannes Link

commit sha 80357ee7a5f7dbb3ce9b153d76929df90087e398

Deprecated Arbitraries.samples()

view details

Johannes Link

commit sha 6a6281bb56ec0d1569625ecebbebd788907ed22e

Update Gradle to 5.6.4

view details

Johannes Link

commit sha 09402da6989636aba0c39402b07c724bbf8ae435

Introduced Arbitrary.sample() and Arbitrary.sampleStream()

view details

Johannes Link

commit sha 1a54b1f0d8e57964b0b2d7456b63f8ad1f42eccd

Added snapshot documentation for recent features

view details

Johannes Link

commit sha e3ffb3d3fdb981db7148b270fcd59b9530cdeb83

Minor changes in Gradle files and Gradle how-to

view details

Johannes Link

commit sha 6cd7a98f81a7e947017d3e99b3f5b6a735c48e8e

Renamed "model" to "state" in state-based testing code and examples

view details

Johannes Link

commit sha 1cfcb3d0045929c1f444dea61ea0d003bad6f92f

Fixed issue 79: forType() can be used outside a property

view details

Johannes Link

commit sha 4364b6a21048de2185f75e8de03cd6053f756c2f

Removed deprecated references in ArchitectureTests

view details

Johannes Link

commit sha 006cfa1ff3ce9aa6e5c8f9e88dfff486652455af

Arbitraries.oneOf now accepts covariant arbitraries

view details

Johannes Link

commit sha 566b7d369cb39e10a0a51b935610f1b0c4bed8e2

Update TODO after researching options to solve open issue 74

view details

Johannes Link

commit sha 9df6f3f4fe9f9c941e0aae45f16f26683e33cb07

Minor refactoring in TypeUsageImpl

view details

Johannes Link

commit sha 80dad891502bbb74f2dea1feed9fe30b9f1343cc

Configurators can now be used to filter out arbitraries

view details

Johannes Link

commit sha c8c10f5fd64ce1e8867da26f9943cb13c34247f2

Added TypeUsage.getContainer()

view details

Johannes Link

commit sha c77d022bc473e3dda191f4098473984127f3684a

Configuration can also be invoked by annotation in container

view details

Johannes Link

commit sha bc0938f28da508a73ee6c1e5a362904cb7b66831

Removed TypeUsage.getContainer()

view details

Johannes Link

commit sha 2c10237c072a278310c15d75ea62497610caa547

Update TODO

view details

Johannes Link

commit sha 8719f74423eebe4b772294d50fdfc3c3852b94aa

Set version to 1.2.2

view details

push time in 2 months

PR opened jlink/jqwik

Extend javadoc around Statistics usage

Overview

Patch proposal for javadoc for https://github.com/jlink/jqwik/issues/75

Link to documentation inspired by project lombok style, see https://github.com/rzwitserloot/lombok/blob/master/src/core/lombok/Builder.java#L55


I hereby agree to the terms of the jqwik Contributor Agreement.

+59 -5

0 comment

1 changed file

pr created time in 2 months

create barnchluvarqpp/jqwik

branch : patch-javadocStatistics

created branch time in 2 months

issue commentjlink/jqwik

Add Checking Information to Statistics Report

Sidenote: I expect that CoverageChecker.count/percentage with Consumer as parameter will not mark line in report as "#checked...".

Why not? Using assertions (Consumer) or a predicate looks equivalent to me.

My (initial) view is that when I am using Consumer, I am not able to "not fulfill check". It can be used for example for some legal issues, as consuming actual count of tries and saving it to database (or sending it by email) as an evidence that test has been done given number of times. This does not involve any sort of check. Just saving some information.

Predicate on the other hand, does directly influence result of "being checked". It does actually return boolean value of check result.

i.e. I feel that mark "#checked..." should be shown only on statistics lines, which have been checked by some Predicate.

PS: My view is now forked, because after some reasoning... If info about marking given statistics as "#checked..." is placed in javadoc also for Consumer version of method, It is imho OK to mark also those lines (i.e. your point of view). Name of method in both types of parameters is named check, so what I am complaining about :)

jlink

comment created time in 2 months

issue commentjlink/jqwik

Add Checking Information to Statistics Report

Seems fair. Sidenote: I expect that CoverageChecker.count/percentage with Consumer as parameter will not mark line in report as "#checked...".

PS: Feel free to suggest other type of mark. My mind is seeing ascii color as background in case that tests are run from supported console, but I think that there are no support for detecting such case in junit. Have a look at maven as an example.

jlink

comment created time in 2 months

issue commentjlink/jqwik

Implement coverage checking for statistical values

@jlink hi, I have put Statistics to work just now and I have some small things. If they are worth of separate issue, I can make them.

  1. using labels and collect was not "intuitive" without having a look at userguide. I think, that javadoc can be improved (on the other hand, verbosity in javadoc can lead to other problems, so be strict in review). PR is on its way and perhaps today will be sent.

  2. Some CoverageChecker.count methods does have wrong description of its parameter (and I am not sure about Predicate versus Consumer disproportion).

  3. What about fluent usage of label, collect and coverage? Now there are two possibilities:

        Statistics.label("passwdLength").collect(pwdLen);
        Statistics.label("passwdLength").coverage(checker -> {
            checker.check("zero").count(x -> x > 10);
            checker.check("more than 13").count(x -> x > 10);
        });
        Statistics.label("passwdLength").collect(pwdLen);
        Statistics.coverageOf("passwdLength", checker -> {
            checker.check("zero").count(x -> x > 10);
            checker.check("more than 13").count(x -> x > 10);
        });

I think that using more fluent approach can be handy and perhaps enough as the only way of writing it to code:

        Statistics.label("passwdLength")
                .collect(pwdLen)
                .coverageOf(checker -> {
                    checker.check("zero").count(x -> x > 10);
                    checker.check("more than 13").count(x -> x > 10);
        });

What do you think?

  1. Just cherry on the top of cake, what about to report statistics like this?:
timestamp = 2020-01-29T15:01:29.600693, [SignUpTests:arbitraryQaronUserIsAlwaysValid] (2000) passwdLength = 
    more than 13 (1360) : 68 %       #checked by "percentage > 3.14"
    9..13        ( 228) : 11 %
    4..8         ( 222) : 11 %
    1..3         ( 124) :  6 %
    zero         (  66) :  3 %                #checked by "count > 10"

I am not sure, how easy it would be to put natural language (or exact source code string) there (like "checked that arbitraries count is higher than 10") there, but at least some mark, that any check is present, would be nice.

PS: Great work on statistics. I like it just from beginning. Current report printout is very readable and also javadoc of things is handy in many cases. Thanks.

jlink

comment created time in 2 months

issue commentjlink/jqwik

`genSize` documentation

@jlink I am not sure, if I will find time to investigate this issue in near time and also if I have enough knowledge about topic (genSize). If it can wait about one month, I will try it.

luvarqpp

comment created time in 2 months

issue commentjlink/jqwik

Rework jqwik.net Homepage

I have this in my low priority TODO list and I hope that 3.2.2020 I will make some draft pull request for main page of jqwik.

jlink

comment created time in 2 months

issue commentjlink/jqwik

Support coverage-guided fuzzing

Sidenote, if program does use intensive logging (at least in business part of code), it can be 1:1 match to instrumentation of branch coverage. I.e. using logger and source code+line from log events can be used in FizzBuzz example and perhaps also in real project with some level of usefulness.

vlsi

comment created time in 2 months

issue commentjlink/jqwik

Support for ad hoc usage

Note, Arbitrary<T> type now have experimental methods Arbitrary<T>.sample() and Arbitrary<T>.samplesStream() for convenient use. See https://github.com/jlink/jqwik/issues/76#issuecomment-566958263 for some discussion and its introduction.

PS: Do not be mistaken by Arbitraries.samples(...) method, which is similar by syntax, but does have way different purpose (it creates Arbitrary instance with passed possible values). Example usage in "oneliner": Arbitraries.samples("asdf", "qwertz", "qwerty").sampleStream().limit(42).forEach(x -> System.out.println(x));

thyming

comment created time in 2 months

issue commentjlink/jqwik

Support coverage-guided fuzzing

Would be cool. When do you have time this week?

Feel free to select a suitable timeslot (15-20-30 min?) at https://doodle.com/vlsi

Please, post some "key points" as result of talk if possible. It is nice reading and interesting approach getting alive :)

vlsi

comment created time in 3 months

issue commentjlink/jqwik

Support coverage-guided fuzzing

I have spring-data-rest real world project (in alpha version through) which will reach its customers this year and testing is one of our priority.

I'm not sure the current Zest/JQF supports multi-threaded applications :-/

Jop, you are right, through using it when business logic is in main thread only, would be OK. See https://github.com/rohanpadhye/jqf/issues/41. On the other side, this is not my case. In spring-data-rest there is some tomcat in main thread (perhaps), or main thread is my web test client (http client, which is sending http requests from jqwik test).

vlsi

comment created time in 3 months

issue commentjlink/jqwik

Support coverage-guided fuzzing

Does it mean that tuning properties to coverage various cases would not be needed generally?

Frankly speaking, I have no idea at this point. In general, it looks to be useful even without tuning knobs. ZestGuidance itself has multiple hard-coded parameters that might need to be configurable in the future. I want to try the thing with real code, and then we could see what needs to be tuned.

Thanks for info. I can use it (when integrated with jqwik) as soon as there is something to test. I have spring-data-rest real world project (in alpha version through) which will reach its customers this year and testing is one of our priority.

The use cases I have in mind are Apache Calcite (RexNode fuzzing or even full SQL fuzzing), and PostgreSQL JDBC driver (e.g. JDBC API fuzzing).

To find bugs more easily, you can try also "reactive jdbc driver". See its postgresql client code for example: https://github.com/r2dbc/r2dbc-postgresql

vlsi

comment created time in 3 months

issue commentjlink/jqwik

Support coverage-guided fuzzing

I would like to see annotation in line with existing approach. For example:

@Property(shrinking = ShrinkingMode.FULL, tries = 4000, generation = GenerationMode.ZEST_DRIVEN)
@Report(Reporting.COVERAGE)
void arbitraryUserIsAlwaysValidForSerDes(@ForAll("arbitraryUser") UserForTests arbitraryUser) {
}

PS: I like proposed idea. Does it mean that tuning properties to coverage various cases would not be needed generally? (genetics programming can be good in many cases)

vlsi

comment created time in 3 months

issue commentjlink/jqwik

Implement coverage checking for statistical values

  1. Sometimes there are more than single parameter. How it will look for a such case? Would be something like this?:
@Property(generation = GenerationMode.RANDOMIZED)
void labeledStatistics(@ForAll @IntRange(min = 1, max = 10) Integer anInt, @ForAll @IntRange(min = 41, max = 43) Integer answerInt) {
	String range = anInt < 3 ? "small" : "large";
        String combinedComplexity = Math.round(Math.log(55.4 * anInt / answerInt));

	Statistics.label("range").collect(range);
	Statistics.label("value").collect(anInt);
        Statistics.label("value2").collect(answerInt);
        Statistics.label("combinedComplexity").collect(combinedComplexity);


	Statistics.coverageOf("range", coverage -> coverage.check("small").percentage(p -> p > 20.0));
        // ensure at least single example with anInt = 0:
        Statistics.coverageOf("value", coverage -> coverage.check(0).count(c -> c > 0));
        // I expect at least two different combinedComplexity values (it would get values 4 and 5)
	Statistics.coverageOf("combinedComplexity", coverage -> coverage.valuesCount(c -> c >= 2));
}
  1. Does Statistics.check(...) influence number of examples tested? If I remember correctly, John Hughes has mentioned something like running so much tests, that framework can be "certain", that it is not just bad luck to not have enough percentage of samples to pass check.

  2. What about Statistics.printHistogram() with optional parameter for label? Nice and simple "ascii art" histogram is shown here for example. I would like to see after finishing all iterations on given test, what was distribution.

  3. Is there any option to not include statistics/label/coverage code in testing code block? I.e. using annotation parameters for this?

Or searching for each test for method named "${originalTestName}Stats" with same parameters (signature), which is not annotated and is private with returning value of type "CoverageRestrictions"? For example something like this:

@Property(generation = GenerationMode.RANDOMIZED)
void simpleStats(@ForAll RoundingMode mode) {
	Statistics.collect(mode);
	Statistics.coverage(coverage -> {
		coverage.check(RoundingMode.CEILING).percentage(p -> p > 5.0);
		coverage.check(RoundingMode.FLOOR).count(c -> c > 2);
	});
}

private CoverageRestrictions simpleStatsStats(RoundingMode mode) {
	Statistics.collect(mode);
        Statistics.printHistogram();
        // perhaps consuming histogram by own code can be nice and we could that way check for deviation of arbitrates values over test runs...
        return Statistics.noCoverageRestrictions();
}

Hmm, what is right balance between "magic naming" and method boilerplate? I address this issue due to small LOC of testing methods, which can be doubled just by adding handful number of Statistics lines.

jlink

comment created time in 3 months

issue commentspring-projects/spring-restdocs

SnippetException despite all links are documented

Regarding to referenced code, it does pass two snippets to document method and second snippet need to know about first one (to not raise undocumented exception). Would it be possible to use "and" approach here, or some SnippetMerger to handle this usecase?

Note, I just want to have separate "lego" puzzles (one documenting links and some documenting actual payload parts). No dependencies between them (i.e. documenter of payload does have to know a list of already documented subsections, like links).

Is this correct approach?

luvarqpp

comment created time in 3 months

issue commentspring-projects/spring-restdocs

SnippetException despite all links are documented

My assumptions first (before reply). Please correct me if I am wrong:

  • document method takes varargs of snippets (type Snippet)
  • it is expected to pass documentation for: ** request part of request/response tuple: *** request headers *** request path parameters(requestParameters(parameterWithName(...)) *** request fields (documenting post body) ** response part *** response headers *** response body *** perhaps cookies and other things I have missed
  • when I pass some Snippet to document method, it is able to check only single part of it. For example responseFields(..) will look into response payload only and it will ensue that it is documented as whole
  • document method should have in reality maximally X Snippet parameters to make sense. Each documenting its own part of req/resp.
  • to document just part of payload (or headers, or other part of req/resp), one can use ResponseFieldsSnippet.and(..) method. So documenting or response with list users can be done as (pseudocode only):
val USER_FIELDS = fieldWithPath("email").description("email");
val COMMON_FIELDS = {
    fieldWithPath("lastEditDate").description("aaa"),
    fieldWithPath("createdDate").description("aaa")
  };
val PAGINATION_FIELDS = {
    fieldWithPath("currentPage").description("aaa"),
    fieldWithPath("ItemsOnCurrentPage").description("aaa")
  };

document("aaa",
  responseFields(
    USER_FIELDS,
    COMMON_FIELDS
  ).and(
    PAGINATION_FIELDS
  )
  //, requestParameters(
  //, requestFields(
)

Is this intended usage?

Thanks for fast reply. Is it possible to to mention this in javadoc for given methods?

What methods are you referring to?

I would expect that "overwriting" checked part of req/resp tuple would be documented briefly in document(String, Snippet...) method. Mentioning that each snippet should document whole part of thing.

Perhaps writing warning to log, when two snippets for same "response part" is used?

A warning wouldn't be appropriate here. Using the two snippets as you have done and as the sample does is a typical and expected way to use REST Docs.

I mean detecting when two Snippet instances passed as parameter does check same part of req/resp tuple and thus both instances should check whole part. I.e. when checking response body, do document/check whole body.

luvarqpp

comment created time in 3 months

issue commentspring-projects/spring-restdocs

SnippetException despite all links are documented

This is the expected behaviour. The links and response fields are two separate snippets. Each has no knowledge of what has or has not been documented by the other snippet. You may want to consider using subsectionWithPath to document the links in the response fields snippet as shown in the samples.

Thanks for fast reply. Is it possible to to mention this in javadoc for given methods? Perhaps writing warning to log, when two snippets for same "response part" is used?

luvarqpp

comment created time in 3 months

issue commentspring-projects/spring-restdocs

SnippetException despite all links are documented

Note, that I have tried to search for existing tests for similar problems. I was pleased by amazingly fast unit tests and quantity of them. After adding this code to SnippetException:

	public SnippetException(String message) {
		super(message);
		StackTraceElement[] a = Thread.currentThread().getStackTrace();
		for (int i = 0; i < a.length; i++) {
			StackTraceElement b = a[i];
			if (b.getClassName().endsWith("Tests") || b.getClassName().endsWith("Test")) {
				System.out.println("BBBBBB " + b.getClassName() + " \t" + b.getMethodName());
				break;
			}
		}
	}

and run of spring-restdocs-core tests from my ide (intelij idea), it has shown me 38 tests that are testing this exception. Nice mental exercise to fing out that there was no test testing invocation of this exception in other packages...

Than I have tried to make "integration" test instead of unit test inspired by some existing ones. All tests was too trivial and without enough interactions to show problem.

My attempt to use Consumer<ExchangeResult> produced by WebTestClientRestDocumentation.document method failed on missing configuration. It was too internal thing for me to replicate it from debugging my real world testing scenario. My attempt has finished like this:

		String testBody = "{\n" +
				"  \"dataField\": \"valuableData\",\n" +
				"  \"_links\": {\n" +
				"    \"self\": {\n" +
				"      \"href\": \"https://example.com:433/api/user/1\"\n" +
				"    },\n" +
				"    \"user\": {\n" +
				"      \"href\": \"https://example.com:433/api/user/1\"\n" +
				"    }\n" +
				"  }\n" +
				"}";

		HttpHeaders hh = new HttpHeaders();
		hh.add(WebTestClient.WEBTESTCLIENT_REQUEST_ID, "0");

		EntityExchangeResult<String> real = Mockito.mock(EntityExchangeResult.class);
		Mockito.when(real.getResponseBody()).thenReturn(testBody);
		Mockito.when(real.getRequestHeaders()).thenReturn(
				HttpHeaders.EMPTY
		);

		Consumer<ExchangeResult> reqRespConsumer = WebTestClientRestDocumentation.document(
				"path/id",
				HypermediaDocumentation.links(
						halLinks(),
						linkWithRel("self").description("The link to self..."),
						linkWithRel("curies").optional().ignored()
				)
		);
		reqRespConsumer.accept(real);

If it is easy to write such a high level testcase, please provide me some clues.

luvarqpp

comment created time in 3 months

issue openedspring-projects/spring-restdocs

SnippetException despite all links are documented

I keep getting org.springframework.restdocs.snippet.SnippetException: The following parts of the payload were not documented: exception, despite I have documented all links. What is weird, when I omit documenting response fields, no exception is thrown.

My simplified usage:

        var userBody = this.webClient.get().uri("/api/users/search/findByEmail?email={email}","a@example.com")
                .accept(MediaTypes.HAL_JSON)
                .exchange().expectStatus().isOk()
                .expectHeader().contentType(MediaTypes.HAL_JSON)
                .expectBody(String.class)
                .consumeWith(document("users/search/findByEmail",
                        HypermediaDocumentation.links(
                                HypermediaDocumentation.halLinks(),
                                linkWithRel("self").description("link to self..."),
                                linkWithRel("user").description("another helpful desc")
                        ),
                        requestParameters(
                                parameterWithName("sort").description("Optional sort style. You specify column name and optionaly direction of sort. Format is more specifically defined as '($propertyname,)+[asc|desc]?'. For more info, have a look at sample usage in <<Get test cases sorted>>, or go to https://docs.spring.io/spring-data/rest/docs/3.1.8.RELEASE/reference/html/#paging-and-sorting.sorting[spring reference documentation].").optional(),
                                parameterWithName("page").description("Optional page (default 0, i.e. first one) number to be returned.").optional(),
                                parameterWithName("size").description("Optional size of page (default 20), i.e. number of resources (entities) that will be returned at once.").optional()
                                ).and(
                                parameterWithName("email").description("TODO search by email. At most, single result can be returned (email have to be unique).")
                        ),
                        // "FIX 1", do not provide next argument (response fields snippet documentation)...
                        responseFields(
                                fieldWithPath("email").description("Email for given User resource. This does represent natural (business) ID for account. Note that email field of User have to be unique.")
                        )
                        /* "FIX 2", document links as response fields (addition for previous parameter)
                                .andWithPrefix("_links.",
                                        fieldWithPath("self.href").ignored(),
                                        fieldWithPath("user.href").ignored()
                                        )*/
                ))
                .returnResult().getResponseBody();

Exception that I get:

org.springframework.restdocs.snippet.SnippetException: The following parts of the payload were not documented:
{
  "_links" : {
    "self" : {
      "href" : "https://example.com:433/api/users/1"
    },
    "user" : {
      "href" : "https://example.com:433/api/users/1"
    }
  }
}

	at org.springframework.restdocs.payload.AbstractFieldsSnippet.validateFieldDocumentation(AbstractFieldsSnippet.java:218)
	at org.springframework.restdocs.payload.AbstractFieldsSnippet.createModel(AbstractFieldsSnippet.java:160)
	at org.springframework.restdocs.snippet.TemplatedSnippet.document(TemplatedSnippet.java:78)
	at org.springframework.restdocs.generate.RestDocumentationGenerator.handle(RestDocumentationGenerator.java:191)
	at org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation.lambda$document$0(WebTestClientRestDocumentation.java:77)
	at org.springframework.test.web.reactive.server.DefaultWebTestClient$DefaultBodySpec.lambda$consumeWith$4(DefaultWebTestClient.java:437)
	at org.springframework.test.web.reactive.server.ExchangeResult.assertWithDiagnostics(ExchangeResult.java:206)
	at org.springframework.test.web.reactive.server.DefaultWebTestClient$DefaultBodySpec.consumeWith(DefaultWebTestClient.java:437)
	at sk.qpp.asdf.repository.ReleaseRepositoryHttpTest.createNewRelease(ReleaseRepositoryHttpTest.java:93)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:675)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:125)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:132)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:124)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:74)
	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:104)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:62)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:43)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:35)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:202)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:198)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
	at org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:171)
	at org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService.invokeAll(ForkJoinPoolHierarchicalTestExecutorService.java:115)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
	at org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:171)
	at org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService.invokeAll(ForkJoinPoolHierarchicalTestExecutorService.java:115)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
	at org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:171)
	at java.base/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

created time in 3 months

startedodrotbohm/moduliths

started time in 3 months

issue openedodrotbohm/moduliths

Property based testing of module

Property based testing (PBT) does count that test is fast and can be run many times during single test suite execution. This project (moduliths) provide (as side thing) possibility to write faster tests. It provides possibility to write unit test, where unit is module. It is smaller part as integration test, or system test and in my projects there are many modules suitable for unit testing using PBT technique.

I call for adding support for easily starting application context for some module. This way it could be used with https://jqwik.net/ for example, to run PBT suites. I think that @jlink would be also interested in such usage, as it is requested in https://github.com/jlink/jqwik/issues/41 for whole spring application also.

created time in 3 months

issue commentjlink/jqwik

scalacheck case clases fluent experience

I added a few points to the Javadoc: https://github.com/jlink/jqwik/blob/master/api/src/main/java/net/jqwik/api/Arbitrary.java#L356-L375

Does it cover your concerns?

Absolutely.

Should I close this issue, or do you have some established workflow? Imho this is done.

luvarqpp

comment created time in 3 months

issue commentjlink/jqwik

scalacheck case clases fluent experience

I see no issues till now with Arbitrary.sample() method. I am happy with its functionality, through javadoc could have mention also consequences (if any from last discussion still apply) and intended usage (to provide sample values in integration tests, as a replacement of test data builders, as generator of prepared Builder, e.t.c.).

From my point, this issue is closeable. Thanks a lot for fast response and project improvement.

luvarqpp

comment created time in 3 months

more