Skip to content

Commit

Permalink
updated test case and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Manu Chaudhary authored and Manu Chaudhary committed Mar 16, 2020
1 parent 20390d3 commit 01450c5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ Table of contents -

## Installation

## For Gradle:
Step 1. Add it in your root `build.gradle` at the end of repositories:
### Requirements

- Java 1.8 or later

### Gradle users
Step 1. Add the JitPack repository to your build file
```
allprojects {
repositories {
Expand All @@ -33,33 +37,31 @@ allprojects {
Step 2. Add the dependency on project's `build.gradle`:
```
dependencies {
implementation 'com.github.imagekit-developer:imagekit-java:v1.0.0'
implementation 'com.github.imagekit-developer:imagekit-java:1.0.0'
}
```
### For Maven:
Step 1. Add the JitPack repository to your build file:
### Maven users
Step 1. Add the JitPack repository to your build file
```
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
```
Step 2. Add the dependency in POM file:
```
<dependency>
<groupId>com.github.imagekit-developer</groupId>
<artifactId>imagekit-java</artifactId>
<version>v1.0.0</version>
<version>1.0.0</version>
</dependency>
```



## Initialization

Step 1. Create a `config.properties` file inside `src/main/resources` of your project. And put essential values of keys [UrlEndpoint, PrivateKey, PublicKey], no need to use any quote(',") in values.
Step 1. Create a `config.properties` file inside `src/main/resources` of your project. And put essential values of keys [UrlEndpoint, PrivateKey, PublicKey], no need to use quote(`'` or `"`) in values.

```editorconfig
# Put essential values of keys [UrlEndpoint, PrivateKey, PublicKey]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ public void signUrl_tests_expire_zero() {
assertThat("41b3075c40bc84147eb71b8b49ae7fbf349d0f00",is(signature));

}

@Test
public void signUrl_tests_without_slash_expire_zero() {
String url="https://test-domain.com/test-endpoint/tr:w-100/test-signed-url.png";
String signature = UrlGen.signUrl("private_key_test", url, "https://test-domain.com/test-endpoint", 0);
assertThat("41b3075c40bc84147eb71b8b49ae7fbf349d0f00",is(signature));

}
}

0 comments on commit 01450c5

Please sign in to comment.