Skip to content

Commit

Permalink
other(release): 1.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
rbioteau committed Feb 2, 2023
1 parent 7b3c7c6 commit 3951625
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "bonita-connector-rest",
"version": "1.0.10"
"version": "1.0.11"
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>org.bonitasoft.connectors</groupId>
<artifactId>bonita-connector-rest</artifactId>
<version>1.0.11-SNAPSHOT</version>
<version>1.0.11</version>

<name>Bonita Rest Connector</name>
<description>Rest Connector for Bonita</description>
Expand Down
42 changes: 32 additions & 10 deletions src/test/java/org/bonitasoft/connectors/rest/RESTConnectorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Map;

import org.apache.http.HttpStatus;
import org.apache.http.auth.AUTH;
import org.bonitasoft.connectors.rest.model.AuthorizationType;
import org.bonitasoft.engine.connector.ConnectorException;
import org.bonitasoft.engine.exception.BonitaException;
Expand Down Expand Up @@ -902,9 +903,16 @@ public void notEmptyBody() throws BonitaException {
*/
@Test
public void basicAuthWithUsernameAndPassword() throws BonitaException {
stubFor(get(urlEqualTo("/"))
.withHeader(WM_AUTHORIZATION, containing(BASIC_RULE))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));
stubFor(
get(urlEqualTo("/"))
.willReturn(aResponse()
.withHeader(AUTH.WWW_AUTH, "Basic")
.withStatus(HttpStatus.SC_UNAUTHORIZED)));

stubFor(
get(urlEqualTo("/"))
.withHeader(WM_AUTHORIZATION, containing(BASIC_RULE))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));
checkResultIsPresent(
executeConnector(buildBasicAuthorizationParametersSet(USERNAME, PASSWORD, EMPTY, EMPTY, Boolean.TRUE)));
}
Expand All @@ -917,9 +925,16 @@ public void basicAuthWithUsernameAndPassword() throws BonitaException {
*/
@Test
public void basicAuthWithUsernamePasswordAndLocalhost() throws BonitaException {
stubFor(get(urlEqualTo("/"))
.withHeader(WM_AUTHORIZATION, containing(BASIC_RULE))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));
stubFor(
get(urlEqualTo("/"))
.willReturn(aResponse()
.withHeader(AUTH.WWW_AUTH, "Basic")
.withStatus(HttpStatus.SC_UNAUTHORIZED)));

stubFor(
get(urlEqualTo("/"))
.withHeader(WM_AUTHORIZATION, containing(BASIC_RULE))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));

checkResultIsPresent(
executeConnector(buildBasicAuthorizationParametersSet(USERNAME, PASSWORD, HOST, EMPTY, Boolean.TRUE)));
Expand All @@ -933,10 +948,17 @@ public void basicAuthWithUsernamePasswordAndLocalhost() throws BonitaException {
*/
@Test
public void basicAuthWithUsernamePasswordAndRealm() throws BonitaException {
stubFor(get(urlEqualTo("/"))
.withHeader(WM_AUTHORIZATION, containing(BASIC_RULE))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));

stubFor(
get(urlEqualTo("/"))
.willReturn(aResponse()
.withHeader(AUTH.WWW_AUTH, "Basic")
.withStatus(HttpStatus.SC_UNAUTHORIZED)));

stubFor(
get(urlEqualTo("/"))
.withHeader(WM_AUTHORIZATION, containing(BASIC_RULE))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));

checkResultIsPresent(
executeConnector(buildBasicAuthorizationParametersSet(USERNAME, PASSWORD, EMPTY, REALM, Boolean.TRUE)));
}
Expand Down

0 comments on commit 3951625

Please sign in to comment.