[jira] [Resolved] (SLING-10002) command servlet improvement

2020-12-14 Thread Nicolas Peltier (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-10002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nicolas Peltier resolved SLING-10002.
-
Fix Version/s: Pipes 4.1.0
 Assignee: Nicolas Peltier
   Resolution: Fixed

> command servlet improvement
> ---
>
> Key: SLING-10002
> URL: https://issues.apache.org/jira/browse/SLING-10002
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Pipes 4.0.0
>Reporter: Nicolas Peltier
>Assignee: Nicolas Peltier
>Priority: Major
> Fix For: Pipes 4.1.0
>
>
> commnand servlet should not be a concatenation of pipes outputs, but merged 
> into one either json or csv, depending on the extension (we should thus 
> remove txt extension)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: [VOTE] Release Apache Sling Servlets Resolver 2.7.12

2020-12-14 Thread Nicolas Peltier
+1

Le lun. 14 déc. 2020 à 16:53, Radu Cotescu  a écrit :

> +1
>
> > On 11 Dec 2020, at 16:31, Karl Pauls  wrote:
> >
> > Please vote to approve this release:
> >
> >  [ ] +1 Approve the release
> >  [ ]  0 Don't care
> >  [ ] -1 Don't release, because ...
>
>


Re: [VOTE] Release Apache Sling Servlets Resolver 2.7.12

2020-12-14 Thread Radu Cotescu
+1

> On 11 Dec 2020, at 16:31, Karl Pauls  wrote:
> 
> Please vote to approve this release:
> 
>  [ ] +1 Approve the release
>  [ ]  0 Don't care
>  [ ] -1 Don't release, because ...



[jira] [Commented] (SLING-9896) change statuscode in SlingPostServlet for PersistenceException

2020-12-14 Thread Bertrand Delacretaz (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17249047#comment-17249047
 ] 

Bertrand Delacretaz commented on SLING-9896:


As discussed on our dev list I would prefer a 409 (Conflict) status than a 405 
which really means "you shouldn't have done a POST" and is cacheable by default.

> change statuscode in SlingPostServlet for PersistenceException
> --
>
> Key: SLING-9896
> URL: https://issues.apache.org/jira/browse/SLING-9896
> Project: Sling
>  Issue Type: Improvement
>  Components: Servlets
>Affects Versions: Servlets Post 2.3.36
>Reporter: Jörg Hoh
>Priority: Major
>  Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> When the SlingPostServlet receives a PersistenceExceptions while trying to 
> persist the changes, it should not throw an internal server error, but a 
> statuscode of 405, because this behavior is expected.
> Example stacktrace:
> {noformat}
> 11.11.2020 11:18:38.418 *ERROR* [172.16.123.101 [1605093518414] POST 
> /foo/bar.html HTTP/1.1] 
> org.apache.sling.servlets.post.impl.operations.ModifyOperation
> Exception during response processing.
> org.apache.sling.api.resource.PersistenceException: Unable to create node at 
> /foo/bar.html
> at 
> org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.create(JcrResourceProvider.java:477)
>  [org.apache.sling.jcr.resource:3.0.22]
> at 
> org.apache.sling.resourceresolver.impl.providers.stateful.AuthenticatedResourceProvider.create(AuthenticatedResourceProvider.java:182)
>  [org.apache.sling.resourceresolver:1.7.0]
> at 
> org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl.create(ResourceResolverControl.java:381)
>  [org.apache.sling.resourceresolver:1.7.0]
> at 
> org.apache.sling.resourceresolver.impl.ResourceResolverImpl.create(ResourceResolverImpl.java:979)
>  [org.apache.sling.resourceresolver:1.7.0]
> at 
> org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.deepGetOrCreateResource(AbstractCreateOperation.java:598)
>  [org.apache.sling.servlets.post:2.3.36]
> at 
> org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.processCreate(AbstractCreateOperation.java:146)
>  [org.apache.sling.servlets.post:2.3.36]
> at 
> org.apache.sling.servlets.post.impl.operations.ModifyOperation.doRun(ModifyOperation.java:83)
>  [org.apache.sling.servlets.post:2.3.36]
> at 
> org.apache.sling.servlets.post.impl.operations.AbstractPostOperation.run(AbstractPostOperation.java:99)
>  [org.apache.sling.servlets.post:2.3.36]
> at 
> org.apache.sling.servlets.post.impl.SlingPostServlet.doPost(SlingPostServlet.java:233)
>  [org.apache.sling.servlets.post:2.3.36]
> at 
> org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:146)
>  [org.apache.sling.api:2.22.0]
> at 
> org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:342)
>  [org.apache.sling.api:2.22.0]
>   [...]
> Caused by: javax.jcr.nodetype.ConstraintViolationException: No default node 
> type available for /foo/bar.html
> at 
> org.apache.jackrabbit.oak.plugins.tree.TreeUtil.addChild(TreeUtil.java:234) 
> [org.apache.jackrabbit.oak-security-spi:1.35.0]
> at 
> org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate.addChild(NodeDelegate.java:690)
>  [org.apache.jackrabbit.oak-jcr:1.35.0]
> at 
> org.apache.jackrabbit.oak.jcr.session.NodeImpl$5.perform(NodeImpl.java:314) 
> [org.apache.jackrabbit.oak-jcr:1.35.0]
> at 
> org.apache.jackrabbit.oak.jcr.session.NodeImpl$5.perform(NodeImpl.java:280) 
> [org.apache.jackrabbit.oak-jcr:1.35.0]
> at 
> org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:209)
>  [org.apache.jackrabbit.oak-jcr:1.35.0]
> at 
> org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(ItemImpl.java:112) 
> [org.apache.jackrabbit.oak-jcr:1.35.0]
> at 
> org.apache.jackrabbit.oak.jcr.session.NodeImpl.addNode(NodeImpl.java:280) 
> [org.apache.jackrabbit.oak-jcr:1.35.0]
> at 
> org.apache.jackrabbit.oak.jcr.session.NodeImpl.addNode(NodeImpl.java:265) 
> [org.apache.jackrabbit.oak-jcr:1.35.0]
> at 
> org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.create(JcrResourceProvider.java:448)
>  [org.apache.sling.jcr.resource:3.0.22]
> ... 154 common frames omitted
> {noformat}
> Discussion at 
> https://www.mail-archive.com/dev@sling.apache.org/msg100122.html (dev@sling)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: SlingPostServlet should not throw 500 on any exception

2020-12-14 Thread Bertrand Delacretaz
Hi,

I'm coming late to this discussion, with a smallish thing..

On Wed, Nov 11, 2020 at 1:10 PM Jörg Hoh  wrote:
> ...Having that in mind, I would nevertheless argue to switch the behavior of
> the SlingPostServlet to return a 405 "Method not allowed" in the case of a
> PersistenceError [2]...

I would much prefer a 409 "Conflict" status which as per rfc7231
indicates "a conflict with the current state of the target resource"
where "the user might be able to resolve the conflict and resubmit the
request."

I think it's suitably vague, whereas 405 is meant for when the HTTP
method used is not appropriate, which is not the problem here IMO.

Also, 405 is indicated to be cacheable by default which is probably
not what we want here.

-Bertrand

> [2]
> https://github.com/apache/sling-org-apache-sling-servlets-post/blob/master/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java#L237


Re: [jira] [Created] (SLING-10000) Switch to Jakarta APIs

2020-12-14 Thread Oliver Lietz
On Saturday, December 12, 2020 9:30:48 AM CET Nicolas Peltier wrote:
> On behalf of sling community (if i may), Congrats Oli for winning the Sling
> 1th JIRA ticket contest! Thanks to you we are now in the 5 digits
> projects!

Credits belong to my kids who called me out of bed in the middle of that night 
for a bottle and holding hands. I just had to dump some tasks from brain to 
JIRA before going back to sleep.

Looking forward to master the next challenge (100,000)... 8)

Thanks!
O.


> Le sam. 12 déc. 2020 à 05:08, Oliver Lietz (Jira)  a
> 
> écrit :
> > Oliver Lietz created SLING-1:
> > 
> > 
> >  Summary: Switch to Jakarta APIs
> >  
> >  Key: SLING-1
> >  URL: https://issues.apache.org/jira/browse/SLING-1
> >  
> >  Project: Sling
> >   
> >   Issue Type: Task
> >   Components: API
> >   
> > Reporter: Oliver Lietz
> > 
> > Java EE APIs are switching from {{javax}} to {{jakarta}}.
> > 
> > 
> > 
> > --
> > This message was sent by Atlassian Jira
> > (v8.3.4#803005)






Re: [jira] [Created] (SLING-10000) Switch to Jakarta APIs

2020-12-14 Thread Robert Munteanu
On Sat, 2020-12-12 at 09:30 +0100, Nicolas Peltier wrote:
> On behalf of sling community (if i may), Congrats Oli for winning the
> Sling
> 1th JIRA ticket contest! Thanks to you we are now in the 5 digits
> projects!

Onwards to 16384 I guess :-)

Robert



[GitHub] [sling-org-apache-sling-resourceresolver] sonarcloud[bot] commented on pull request #36: Sling 9535 : update for thread safety

2020-12-14 Thread GitBox


sonarcloud[bot] commented on pull request #36:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/36#issuecomment-744383686


   SonarCloud Quality Gate failed.
   
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=36=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=36=false=BUG)
 [1 
Bug](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=36=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=36=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=36=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=36=false=VULNERABILITY)
  
   [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver=36=false=SECURITY_HOTSPOT)
 [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver=36=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver=36=false=SECURITY_HOTSPOT)
  
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=36=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=36=false=CODE_SMELL)
 [1 Code 
Smell](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=36=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=36=new_coverage=list)
 [90.2% 
Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=36=new_coverage=list)
  
   [](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=36=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=36=new_duplicated_lines_density=list)
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[Jenkins] Sling » Modules » sling-org-apache-sling-launchpad-testing » master #260 is BROKEN

2020-12-14 Thread Apache Jenkins Server
quot;, arch: "amd64", family: "unix"
[INFO] [jenkins-event-spy] Generate 
/home/jenkins/jenkins-agent/workspace/e-sling-launchpad-testing_master@tmp/withMavenea964174/maven-spy-20201214-113633-807394880844930517680.log.tmp
 ...
[INFO] Scanning for projects...
[INFO] 
[INFO] < org.apache.sling:org.apache.sling.launchpad.testing >-
[INFO] Building Apache Sling Launchpad Testing 12-SNAPSHOT
[INFO] [ jar ]-
[INFO] Downloading from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.integration-tests/12-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.integration-tests/12-SNAPSHOT/maven-metadata.xml
 (1.0 kB at 987 B/s)
[INFO] Downloading from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.integration-tests/12-SNAPSHOT/org.apache.sling.launchpad.integration-tests-12-20201209.061342-240.pom
[INFO] Downloaded from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.integration-tests/12-SNAPSHOT/org.apache.sling.launchpad.integration-tests-12-20201209.061342-240.pom
 (14 kB at 21 kB/s)
[INFO] Downloading from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-services/12-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-services/12-SNAPSHOT/maven-metadata.xml
 (1.0 kB at 1.7 kB/s)
[INFO] Downloading from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-services/12-SNAPSHOT/org.apache.sling.launchpad.test-services-12-20201212.192436-122.pom
[INFO] Downloaded from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-services/12-SNAPSHOT/org.apache.sling.launchpad.test-services-12-20201212.192436-122.pom
 (9.8 kB at 22 kB/s)
[INFO] Downloading from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-fragment/12-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-fragment/12-SNAPSHOT/maven-metadata.xml
 (1.0 kB at 1.9 kB/s)
[INFO] Downloading from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-fragment/12-SNAPSHOT/org.apache.sling.launchpad.test-fragment-12-20201211.031836-114.pom
[INFO] Downloaded from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-fragment/12-SNAPSHOT/org.apache.sling.launchpad.test-fragment-12-20201211.031836-114.pom
 (2.9 kB at 7.4 kB/s)
[INFO] Downloading from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.integration-tests/12-SNAPSHOT/org.apache.sling.launchpad.integration-tests-12-20201209.061342-240.jar
[INFO] Downloading from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-services/12-SNAPSHOT/org.apache.sling.launchpad.test-services-12-20201212.192436-122.jar
[INFO] Downloading from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-fragment/12-SNAPSHOT/org.apache.sling.launchpad.test-fragment-12-20201211.031836-114.jar
[INFO] Downloaded from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-fragment/12-SNAPSHOT/org.apache.sling.launchpad.test-fragment-12-20201211.031836-114.jar
 (9.2 kB at 18 kB/s)
[INFO] Downloaded from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.test-services/12-SNAPSHOT/org.apache.sling.launchpad.test-services-12-20201212.192436-122.jar
 (180 kB at 178 kB/s)
[INFO] Downloaded from Nexus: 
http://repository.apache.org/snapshots/org/apache/sling/org.apache.sling.launchpad.integration-tests/12-SNAPSHOT/org.apache.sling.launchpad.integration-tests-12-20201209.061342-240.jar
 (533 kB at 439 kB/s)
[INFO] 
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ 
org.apache.sling.launchpad.testing ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-property-values) @ 
org.apache.sling.launchpad.testing ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-java) @ 
org.apache.sling.launchpad.testing ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (ban-maven-scr-plugin) @ 
org.apache.sling.launchpad.testing ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (process-resource-bundles) 
@ org.apache.sling.launchpad.testing ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ 
org.apache.sling.launchpad.testing ---
[INFO] 
[INFO] --- slingfeature-maven-plugin:1.3.6:aggregate-features 
(aggregate

[GitHub] [sling-org-apache-sling-resourceresolver] akankshajain18 opened a new pull request #36: Sling 9535 : update for thread safety

2020-12-14 Thread GitBox


akankshajain18 opened a new pull request #36:
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/36


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-resourceresolver] akankshajain18 closed pull request #34: Sling 9535 dummy

2020-12-14 Thread GitBox


akankshajain18 closed pull request #34:
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/34


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-servlets-post] sonarcloud[bot] commented on pull request #7: SLING-9896 make exception handling more granular

2020-12-14 Thread GitBox


sonarcloud[bot] commented on pull request #7:
URL: 
https://github.com/apache/sling-org-apache-sling-servlets-post/pull/7#issuecomment-744355075


   SonarCloud Quality Gate failed.
   
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-post=7=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-post=7=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-post=7=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-post=7=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-post=7=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-post=7=false=VULNERABILITY)
  
   [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-servlets-post=7=false=SECURITY_HOTSPOT)
 [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-servlets-post=7=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-servlets-post=7=false=SECURITY_HOTSPOT)
  
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-post=7=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-post=7=false=CODE_SMELL)
 [5 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-post=7=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-servlets-post=7=new_coverage=list)
 [0.0% 
Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-servlets-post=7=new_coverage=list)
  
   [](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-servlets-post=7=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-servlets-post=7=new_duplicated_lines_density=list)
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Updated] (SLING-10003) Allow to mock findResources in MockResourceResolver

2020-12-14 Thread Konrad Windszus (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-10003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus updated SLING-10003:

Affects Version/s: (was: Testing ResourceResolver Mock 1.1.28)

> Allow to mock findResources in MockResourceResolver
> ---
>
> Key: SLING-10003
> URL: https://issues.apache.org/jira/browse/SLING-10003
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Reporter: Konrad Windszus
>Priority: Major
> Fix For: Testing ResourceResolver Mock 1.1.28
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently there is no easy way to override the method 
> [MockResourceResolver.findResources().|https://github.com/apache/sling-org-apache-sling-testing-resourceresolver-mock/blob/6ef6bd69ce1679b06d6b4d52b1b170dce51d102c/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolver.java#L455]
> There should be a way to override that without relying on other mock 
> frameworks like Mockito.
> One way could be to add a static method 
> {{MockResourceResolver.registerFindResourcesFunction(ResourceResolver 
> resolver, BiFunction 
> findResourcesFunction)}} which allows to easily override the default 
> implementation (which always throws an UnsupportedOperationException) for the 
> given resolver (in case this is a MockResourceResolver). The registration 
> should only affect the given resource resolver as usually there is different 
> functions necessary per test method.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (SLING-10003) Allow to mock findResources in MockResourceResolver

2020-12-14 Thread Konrad Windszus (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-10003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus updated SLING-10003:

Fix Version/s: Testing ResourceResolver Mock 1.1.28

> Allow to mock findResources in MockResourceResolver
> ---
>
> Key: SLING-10003
> URL: https://issues.apache.org/jira/browse/SLING-10003
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Affects Versions: Testing ResourceResolver Mock 1.1.28
>Reporter: Konrad Windszus
>Priority: Major
> Fix For: Testing ResourceResolver Mock 1.1.28
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently there is no easy way to override the method 
> [MockResourceResolver.findResources().|https://github.com/apache/sling-org-apache-sling-testing-resourceresolver-mock/blob/6ef6bd69ce1679b06d6b4d52b1b170dce51d102c/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolver.java#L455]
> There should be a way to override that without relying on other mock 
> frameworks like Mockito.
> One way could be to add a static method 
> {{MockResourceResolver.registerFindResourcesFunction(ResourceResolver 
> resolver, BiFunction 
> findResourcesFunction)}} which allows to easily override the default 
> implementation (which always throws an UnsupportedOperationException) for the 
> given resolver (in case this is a MockResourceResolver). The registration 
> should only affect the given resource resolver as usually there is different 
> functions necessary per test method.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [sling-org-apache-sling-testing-resourceresolver-mock] kwin opened a new pull request #1: SLING-10003 allow to mock findResources

2020-12-14 Thread GitBox


kwin opened a new pull request #1:
URL: 
https://github.com/apache/sling-org-apache-sling-testing-resourceresolver-mock/pull/1


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-servlets-post] joerghoh commented on pull request #6: SLING-9896 handle PersistenceExceptions explicitly and throw a 405

2020-12-14 Thread GitBox


joerghoh commented on pull request #6:
URL: 
https://github.com/apache/sling-org-apache-sling-servlets-post/pull/6#issuecomment-744330843


   I raised #7 and try to implement @enapps-enorman's proposal, but without 
adding more extension points to the Post Servlet.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-servlets-post] joerghoh closed pull request #6: SLING-9896 handle PersistenceExceptions explicitly and throw a 405

2020-12-14 Thread GitBox


joerghoh closed pull request #6:
URL: https://github.com/apache/sling-org-apache-sling-servlets-post/pull/6


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-servlets-post] joerghoh opened a new pull request #7: SLING-9896 make exception handling more granular

2020-12-14 Thread GitBox


joerghoh opened a new pull request #7:
URL: https://github.com/apache/sling-org-apache-sling-servlets-post/pull/7


   This PR is similar to #6 and tries to split the possible reasons of 
exceptions into 2 buckets:
   * Exceptions caused in incorrect/invalid input, where it does not make sense 
to repeat the request with the same set of parameters (matched to HTTP status 
422 "Unprocessable entity")
   * Exceptions caused in an incorrect state of the repo (e.g. where the node 
is locked or checked-out), where it could make sense to repeat the same request 
with the same parameters (matched to HTTP status 409 "Conflict")
   
   But as many JCR operations also throw the generic RepositoryException which 
we cannot map to either of it. For these I would still propose to throw a 
statuscode 405 (as proposed in #6).
   
   An additional vector to consider is security: If we try to expose too 
detailed reasons why an operation failed an attacker can draw conclusions from 
it.
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Created] (SLING-10003) Allow to mock findResources in MockResourceResolver

2020-12-14 Thread Konrad Windszus (Jira)
Konrad Windszus created SLING-10003:
---

 Summary: Allow to mock findResources in MockResourceResolver
 Key: SLING-10003
 URL: https://issues.apache.org/jira/browse/SLING-10003
 Project: Sling
  Issue Type: Improvement
  Components: Testing
Affects Versions: Testing ResourceResolver Mock 1.1.28
Reporter: Konrad Windszus


Currently there is no easy way to override the method 
[MockResourceResolver.findResources().|https://github.com/apache/sling-org-apache-sling-testing-resourceresolver-mock/blob/6ef6bd69ce1679b06d6b4d52b1b170dce51d102c/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolver.java#L455]

There should be a way to override that without relying on other mock frameworks 
like Mockito.

One way could be to add a static method 
{{MockResourceResolver.registerFindResourcesFunction(ResourceResolver resolver, 
BiFunction findResourcesFunction)}} which 
allows to easily override the default implementation (which always throws an 
UnsupportedOperationException) for the given resolver (in case this is a 
MockResourceResolver). The registration should only affect the given resource 
resolver as usually there is different functions necessary per test method.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)