Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Commit 649638d

Browse files
committed
Adjustments after merge of #173
* Adding fmt-maven-plugin to format code on Google Java Format. * Correcting warnings from Grunt / JSHint. * Adding, and using, enum, RENDER_FOR, in PrnfbRenderer.
1 parent 96f3584 commit 649638d

File tree

75 files changed

+8407
-7267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8407
-7267
lines changed

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,33 @@
33
Changelog of Pull Request Notifier for Bitbucket.
44

55
## Unreleased
6+
### GitHub [#173](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/pull/173) Add the ability to specify forms for buttons
7+
Adjustments after merge of
8+
9+
* Adding fmt-maven-plugin to format code on Google Java Format.
10+
* Correcting warnings from Grunt / JSHint.
11+
* Adding, and using, enum, RENDER_FOR, in PrnfbRenderer.
12+
13+
[95fcfc4f334fb1e](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/95fcfc4f334fb1e) Tomas Bjerre *2016-12-25 21:29:22*
14+
15+
### No issue
16+
Add interactive forms to buttons
17+
18+
This change adds the ability to specify a JSON-based form for a given
19+
button, which will get automatically rendered when the button is pressed.
20+
The submitted data is available as serialized JSON in the ${BUTTON_FORM_DATA}
21+
variable.
22+
23+
For the specification of what a form looks like and it's serialized result,
24+
look at README.md in the change.
25+
26+
[2a5c79347b713c8](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/2a5c79347b713c8) Itay Neeman *2016-12-24 20:55:47*
27+
28+
## 2.43
629
### GitHub [#169](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/169) What about pull request description ?
730
Removing PULL_REQUEST_DESCRIPTION from EVERYTHING_URL
831

9-
[c616c4c575be53a](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/c616c4c575be53a) Tomas Bjerre *2016-12-15 21:18:37*
32+
[5af97f531cae647](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/5af97f531cae647) Tomas Bjerre *2016-12-15 21:19:12*
1033

1134
## 2.42
1235
### GitHub [#169](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/169) What about pull request description ?

pom.xml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ Changelog of Pull Request Notifier for Bitbucket.
207207
<enableQuickReload>true</enableQuickReload>
208208
<pluginArtifacts>
209209
<pluginArtifact>
210-
<groupId>com.atlassian.labs.plugins</groupId>
211-
<artifactId>quickreload</artifactId>
212-
<version>${quick.reload.version}</version>
210+
<groupId>com.atlassian.labs.plugins</groupId>
211+
<artifactId>quickreload</artifactId>
212+
<version>${quick.reload.version}</version>
213213
</pluginArtifact>
214214
</pluginArtifacts>
215215
<products>
@@ -244,6 +244,18 @@ Changelog of Pull Request Notifier for Bitbucket.
244244
</includes>
245245
</configuration>
246246
</plugin>
247+
<plugin>
248+
<groupId>com.coveo</groupId>
249+
<artifactId>fmt-maven-plugin</artifactId>
250+
<version>1.3.0</version>
251+
<executions>
252+
<execution>
253+
<goals>
254+
<goal>format</goal>
255+
</goals>
256+
</execution>
257+
</executions>
258+
</plugin>
247259
</plugins>
248260
<resources>
249261
<resource>
@@ -275,7 +287,7 @@ Changelog of Pull Request Notifier for Bitbucket.
275287
<properties>
276288
<bitbucket.version>4.11.1</bitbucket.version>
277289
<bitbucket.data.version>${bitbucket.version}</bitbucket.data.version>
278-
<quick.reload.version>2.0.0</quick.reload.version>
290+
<quick.reload.version>2.0.0</quick.reload.version>
279291
<amps.version>6.1.0</amps.version>
280292
</properties>
281-
</project>
293+
</project>

src/main/java/se/bjurr/prnfb/http/ClientKeyStore.java

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,40 @@
1919
*/
2020
public class ClientKeyStore {
2121

22-
private KeyStore keyStore = null;
23-
private char[] password = null;
24-
25-
public ClientKeyStore(PrnfbSettingsData settings) {
26-
if (settings.getKeyStore().isPresent()) {
27-
File keyStoreFile = new File(settings.getKeyStore().get());
28-
try {
29-
this.keyStore = getKeyStore(settings.getKeyStoreType());
30-
31-
if (settings.getKeyStorePassword().isPresent()) {
32-
this.password = settings.getKeyStorePassword().get().toCharArray();
22+
private KeyStore keyStore = null;
23+
private char[] password = null;
24+
25+
public ClientKeyStore(PrnfbSettingsData settings) {
26+
if (settings.getKeyStore().isPresent()) {
27+
File keyStoreFile = new File(settings.getKeyStore().get());
28+
try {
29+
this.keyStore = getKeyStore(settings.getKeyStoreType());
30+
31+
if (settings.getKeyStorePassword().isPresent()) {
32+
this.password = settings.getKeyStorePassword().get().toCharArray();
33+
}
34+
35+
this.keyStore.load(new FileInputStream(keyStoreFile), this.password);
36+
} catch (Exception e) {
37+
throw new RuntimeException(
38+
"Unable to build keystore from " + keyStoreFile.getAbsolutePath(), e);
39+
}
3340
}
34-
35-
this.keyStore.load(new FileInputStream(keyStoreFile), this.password);
36-
} catch (Exception e) {
37-
throw new RuntimeException("Unable to build keystore from " + keyStoreFile.getAbsolutePath(), e);
38-
}
3941
}
40-
}
4142

42-
public Optional<KeyStore> getKeyStore() {
43-
return fromNullable(this.keyStore);
44-
}
43+
public Optional<KeyStore> getKeyStore() {
44+
return fromNullable(this.keyStore);
45+
}
4546

46-
public char[] getPassword() {
47-
return this.password;
48-
}
47+
public char[] getPassword() {
48+
return this.password;
49+
}
4950

50-
private KeyStore getKeyStore(String keyStoreType) throws KeyStoreException {
51-
if (keyStoreType != null) {
52-
return KeyStore.getInstance(keyStoreType);
53-
} else {
54-
return KeyStore.getInstance(KeyStore.getDefaultType());
51+
private KeyStore getKeyStore(String keyStoreType) throws KeyStoreException {
52+
if (keyStoreType != null) {
53+
return KeyStore.getInstance(keyStoreType);
54+
} else {
55+
return KeyStore.getInstance(KeyStore.getDefaultType());
56+
}
5557
}
56-
}
57-
}
58+
}

src/main/java/se/bjurr/prnfb/http/HttpResponse.java

Lines changed: 66 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,74 +3,80 @@
33
import java.net.URI;
44

55
public class HttpResponse {
6-
private final String content;
6+
private final String content;
77

8-
private final int status;
8+
private final int status;
99

10-
private final URI uri;
10+
private final URI uri;
1111

12-
public HttpResponse(URI uri, int status, String content) {
13-
this.uri = uri;
14-
this.status = status;
15-
this.content = content;
16-
}
17-
18-
@Override
19-
public boolean equals(Object obj) {
20-
if (this == obj) {
21-
return true;
22-
}
23-
if (obj == null) {
24-
return false;
25-
}
26-
if (getClass() != obj.getClass()) {
27-
return false;
12+
public HttpResponse(URI uri, int status, String content) {
13+
this.uri = uri;
14+
this.status = status;
15+
this.content = content;
2816
}
29-
HttpResponse other = (HttpResponse) obj;
30-
if (this.content == null) {
31-
if (other.content != null) {
32-
return false;
33-
}
34-
} else if (!this.content.equals(other.content)) {
35-
return false;
36-
}
37-
if (this.status != other.status) {
38-
return false;
39-
}
40-
if (this.uri == null) {
41-
if (other.uri != null) {
42-
return false;
43-
}
44-
} else if (!this.uri.equals(other.uri)) {
45-
return false;
17+
18+
@Override
19+
public boolean equals(Object obj) {
20+
if (this == obj) {
21+
return true;
22+
}
23+
if (obj == null) {
24+
return false;
25+
}
26+
if (getClass() != obj.getClass()) {
27+
return false;
28+
}
29+
HttpResponse other = (HttpResponse) obj;
30+
if (this.content == null) {
31+
if (other.content != null) {
32+
return false;
33+
}
34+
} else if (!this.content.equals(other.content)) {
35+
return false;
36+
}
37+
if (this.status != other.status) {
38+
return false;
39+
}
40+
if (this.uri == null) {
41+
if (other.uri != null) {
42+
return false;
43+
}
44+
} else if (!this.uri.equals(other.uri)) {
45+
return false;
46+
}
47+
return true;
4648
}
47-
return true;
48-
}
4949

50-
public String getContent() {
51-
return this.content;
52-
}
50+
public String getContent() {
51+
return this.content;
52+
}
5353

54-
public int getStatus() {
55-
return this.status;
56-
}
54+
public int getStatus() {
55+
return this.status;
56+
}
5757

58-
public URI getUri() {
59-
return this.uri;
60-
}
58+
public URI getUri() {
59+
return this.uri;
60+
}
6161

62-
@Override
63-
public int hashCode() {
64-
final int prime = 31;
65-
int result = 1;
66-
result = prime * result + ((this.content == null) ? 0 : this.content.hashCode());
67-
result = prime * result + this.status;
68-
result = prime * result + ((this.uri == null) ? 0 : this.uri.hashCode());
69-
return result;
70-
}
62+
@Override
63+
public int hashCode() {
64+
final int prime = 31;
65+
int result = 1;
66+
result = prime * result + ((this.content == null) ? 0 : this.content.hashCode());
67+
result = prime * result + this.status;
68+
result = prime * result + ((this.uri == null) ? 0 : this.uri.hashCode());
69+
return result;
70+
}
7171

72-
@Override
73-
public String toString() {
74-
return "HttpResponse [content=" + this.content + ", status=" + this.status + ", uri=" + this.uri + "]";
75-
}
72+
@Override
73+
public String toString() {
74+
return "HttpResponse [content="
75+
+ this.content
76+
+ ", status="
77+
+ this.status
78+
+ ", uri="
79+
+ this.uri
80+
+ "]";
81+
}
7682
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package se.bjurr.prnfb.http;
22

33
public interface Invoker {
4-
HttpResponse invoke(UrlInvoker urlInvoker);
4+
HttpResponse invoke(UrlInvoker urlInvoker);
55
}

0 commit comments

Comments
 (0)