You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2018/07/27 12:22:57 UTC

[sling-whiteboard] branch master updated (6958702 -> 46339c9)

This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git.


    from 6958702  add link
     new 583e30d  cosmetics
     new fbfa703  Merge branch 'master' of github.com:apache/sling-whiteboard
     new 46339c9  Use function for auth

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/test/java/sling/postservlet/createcontent/basic-auth.js  | 6 ++++++
 .../java/sling/postservlet/createcontent/createContent.feature   | 9 +++++----
 2 files changed, 11 insertions(+), 4 deletions(-)
 create mode 100644 literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/basic-auth.js


[sling-whiteboard] 02/03: Merge branch 'master' of github.com:apache/sling-whiteboard

Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit fbfa703cc589170ba3fe43fc9b5344738506692b
Merge: 583e30d 6958702
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jul 27 14:21:44 2018 +0200

    Merge branch 'master' of github.com:apache/sling-whiteboard

 literate-http-testing/karate/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[sling-whiteboard] 03/03: Use function for auth

Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 46339c9d703ae44da8c407217b47ba153028e629
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jul 27 14:22:21 2018 +0200

    Use function for auth
---
 .../src/test/java/sling/postservlet/createcontent/basic-auth.js     | 6 ++++++
 .../test/java/sling/postservlet/createcontent/createContent.feature | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/basic-auth.js b/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/basic-auth.js
new file mode 100644
index 0000000..271725a
--- /dev/null
+++ b/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/basic-auth.js
@@ -0,0 +1,6 @@
+function(creds) {
+  var temp = creds.username + ':' + creds.password;
+  var Base64 = Java.type('java.util.Base64');
+  var encoded = Base64.getEncoder().encodeToString(temp.bytes);
+  return 'Basic ' + encoded;
+}
diff --git a/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/createContent.feature b/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/createContent.feature
index ab972c0..b0dc002 100644
--- a/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/createContent.feature
+++ b/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/createContent.feature
@@ -9,8 +9,9 @@ Background:
 
 * url 'http://localhost:8080'
 
-# Use admin:admin credentials for all requests
-* configure headers = { 'Authorization' : 'Basic YWRtaW46YWRtaW4=' }
+# Use admin credentials for all requests
+* def encodedAuth = call read('basic-auth.js') { username: 'admin', password: 'admin' }
+* configure headers = { 'Authorization' : #(encodedAuth) }
 
 # ------------------------------------------------------------------------
 Scenario: Check access to the Sling instance under test


[sling-whiteboard] 01/03: cosmetics

Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 583e30d1ecbee54b189e04a2a049754181d6ebb7
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jul 27 14:13:15 2018 +0200

    cosmetics
---
 .../test/java/sling/postservlet/createcontent/createContent.feature   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/createContent.feature b/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/createContent.feature
index 7dd5c04..ab972c0 100644
--- a/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/createContent.feature
+++ b/literate-http-testing/karate/src/test/java/sling/postservlet/createcontent/createContent.feature
@@ -38,5 +38,5 @@ Then status 201
 Given url newResourceURL + '.json'
 When method get
 Then status 200
-Then match response.title == testTitle
-Then match response.anotherField == testID
\ No newline at end of file
+And match response.title == testTitle
+And match response.anotherField == testID
\ No newline at end of file