Skip to content

Commit

Permalink
smaller corrections from manual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mwdb committed Jan 23, 2019
1 parent 0c03f8f commit 9efd11d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions samples/sap-java-buildpack-api-usage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ Use the [xs-security.json](./xs-security.json) to define the authentication sett
sap-java-buildpack-api-usage$ cf create-service xsuaa application xsuaa-authentication -c xs-security.json
```
## Configuration the manifest
The [manifest](./manifest.yml) contains hosts and paths that need to be adopted.
The [vars](../vars.yml) contains hosts and paths that need to be adopted.

## Deploy the application
Deploy the application using cf push. It will expect 1 GB of free memory quota.

```shell
sap-java-buildpack-api-usage$ cf push
sap-java-buildpack-api-usage$ cf push --vars-file ../vars.yml
```

## Access the application
Expand Down
10 changes: 7 additions & 3 deletions samples/sap-java-buildpack-api-usage/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ applications:
- name: sap-java-buildpack-api-usage
instances: 1
memory: 896M
host: sap-java-buildpack-api-usage
routes:
- route: sap-java-buildpack-api-usage-((ID)).((LANDSCAPE_APPS_DOMAIN))

host:
path: target/sap-java-buildpack-api-usage.war
buildpack: sap_java_buildpack
services:
Expand All @@ -17,14 +20,15 @@ applications:
path: approuter
buildpack: nodejs_buildpack
memory: 128M
host: approuter-sap-java-buildpack-api-usage
routes:
- route: approuter-sap-java-buildpack-api-usage-((ID)).((LANDSCAPE_APPS_DOMAIN))
services:
- xsuaa-authentication
env:
destinations: >
[
{"name":"sap-java-buildpack-api-usage-destination",
"url":"https://sap-java-buildpack-api-usage.cfapps.eu10.hana.ondemand.com",
"url":"https://sap-java-buildpack-api-usage-((ID)).((LANDSCAPE_APPS_DOMAIN))",
"forwardAuthToken": true}
]
...
2 changes: 1 addition & 1 deletion samples/sap-java-buildpack-api-usage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</build>
<dependencies>
<dependency>
<groupId>com.sap.cloud.security.xssec</groupId>
<groupId>com.sap.cloud.security.xsuaa</groupId>
<artifactId>api</artifactId>
<version>1.2.0</version>
<scope>provided</scope>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import org.junit.Before;
import org.junit.Test;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class XsuaaMockWebServerTest {
private XsuaaMockWebServer xsuaaMockServer;

Expand All @@ -15,9 +18,12 @@ public void setUp() {
}

@Test
public void getPropertyShouldStartMockServerAndReturnUrl() {
public void getPropertyShouldStartMockServerAndReturnUrl() throws UnknownHostException {
InetAddress address = InetAddress.getLocalHost();
String url = (String) xsuaaMockServer.getProperty(XsuaaMockWebServer.MOCK_XSUAA_PROPERTY_SOURCE_NAME);
url = url.toLowerCase();
url = url.replace("127.0.0.1", "localhost");
url = url.replace(address.getCanonicalHostName().toLowerCase(),"localhost");
Assert.assertThat(url, startsWith("http://localhost"));
}
}

0 comments on commit 9efd11d

Please sign in to comment.