Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

Commit

Permalink
Removing ip caching
Browse files Browse the repository at this point in the history
  • Loading branch information
rottebds committed Aug 17, 2017
1 parent 824f996 commit f471607
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 23 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>

<artifactId>phone-home-api</artifactId>
<version>3.0.1-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>

<name>Phone Home API</name>
<url>http://maven.apache.org</url>
Expand All @@ -18,7 +18,7 @@
<dependency>
<groupId>com.blackducksoftware.integration</groupId>
<artifactId>hub-common-rest</artifactId>
<version>2.1.3</version>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ public class PhoneHomeRequestBody implements Serializable {
private final String regId;
private final String source;
private final Map<String, String> infoMap;
private final boolean bypassIpCaching;

public PhoneHomeRequestBody(final String hubIdentifier, final PhoneHomeSource source, final Map<String, String> infoMap, final boolean bypassIpCaching) {
public PhoneHomeRequestBody(final String hubIdentifier, final PhoneHomeSource source, final Map<String, String> infoMap) {
final String sourceString = source.getName();
this.regId = Objects.requireNonNull(hubIdentifier);
this.source = Objects.requireNonNull(sourceString);
this.infoMap = Objects.requireNonNull(infoMap);
this.bypassIpCaching = bypassIpCaching;
}

public String getRegId() {
Expand All @@ -57,8 +55,4 @@ public Map<String, String> getInfoMap() {
return infoMap;
}

public boolean getBypassIpCaching(){
return bypassIpCaching;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public class PhoneHomeRequestBodyBuilder extends AbstractBuilder<PhoneHomeReques
private String thirdPartyVersion;
private String pluginVersion;
private PhoneHomeSource source;
private boolean bypassDailyIpCaching;
private final Map<String, String> metaDataMap = new HashMap<>();

@Override
Expand All @@ -64,7 +63,7 @@ public PhoneHomeRequestBody buildObject() {
infoMap.put(PhoneHomeRequestFieldEnum.THIRDPARTYNAME.getKey(), thirdPartyName.getName());
infoMap.put(PhoneHomeRequestFieldEnum.THIRDPARTYVERSION.getKey(), thirdPartyVersion);
infoMap.put(PhoneHomeRequestFieldEnum.PLUGINVERSION.getKey(), pluginVersion);
final PhoneHomeRequestBody info = new PhoneHomeRequestBody(hubIdentifier, source, infoMap, bypassDailyIpCaching);
final PhoneHomeRequestBody info = new PhoneHomeRequestBody(hubIdentifier, source, infoMap);
return info;
}

Expand Down Expand Up @@ -161,12 +160,4 @@ public void setSource(final PhoneHomeSource source) {
this.source = source;
}

public boolean getBypassDailyIpCaching() {
return bypassDailyIpCaching;
}

public void setBypassDailyIpCaching(final boolean bypassDailyIpCaching) {
this.bypassDailyIpCaching = bypassDailyIpCaching;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void callHomeInvalidUrl() throws Exception {
final String regId = "regId";
final PhoneHomeSource source = PhoneHomeSource.INTEGRATIONS;
final Map<String, String> infoMap = new HashMap<>();
final PhoneHomeRequestBody phoneHomeRequest = new PhoneHomeRequestBody(regId, source, infoMap, false);
final PhoneHomeRequestBody phoneHomeRequest = new PhoneHomeRequestBody(regId, source, infoMap);

phClient.postPhoneHomeRequest(phoneHomeRequest);
}
Expand All @@ -100,7 +100,7 @@ public void callHomeValidUrl() throws Exception {
final String regId = "regId";
final PhoneHomeSource source = PhoneHomeSource.INTEGRATIONS;
final Map<String, String> infoMap = new HashMap<>();
final PhoneHomeRequestBody phoneHomeRequest = new PhoneHomeRequestBody(regId, source, infoMap, false);
final PhoneHomeRequestBody phoneHomeRequest = new PhoneHomeRequestBody(regId, source, infoMap);

phClient.postPhoneHomeRequest(phoneHomeRequest);
}
Expand Down Expand Up @@ -192,7 +192,6 @@ public void validatePhoneHomeRequestBuilding() throws Exception{
phoneHomeRequestBuilder.setThirdPartyName(ThirdPartyName.JENKINS);
phoneHomeRequestBuilder.setThirdPartyVersion("thirdPartyVersion");
phoneHomeRequestBuilder.setSource(PhoneHomeSource.INTEGRATIONS);
phoneHomeRequestBuilder.setBypassDailyIpCaching(true);
phoneHomeRequestBuilder.addToMetaDataMap("some", "metadata");
final Map<String, String> builderInfoMap = phoneHomeRequestBuilder.getMetaDataMap();
builderInfoMap.put(PhoneHomeRequestFieldEnum.BLACKDUCKNAME.getKey(), phoneHomeRequestBuilder.getBlackDuckName().getName());
Expand All @@ -205,7 +204,6 @@ public void validatePhoneHomeRequestBuilding() throws Exception{

assertTrue(phoneHomeRequestBuilder.getRegistrationId().equals(phoneHomeRequest.getRegId()));
assertTrue(phoneHomeRequestBuilder.getSource().getName().equals(phoneHomeRequest.getSource()));
assertTrue(phoneHomeRequestBuilder.getBypassDailyIpCaching() == (phoneHomeRequest.getBypassIpCaching()));
assertTrue(builderInfoMap.equals((phoneHomeRequest.getInfoMap())));

phoneHomeRequestBuilder.setRegistrationId(null);
Expand Down

0 comments on commit f471607

Please sign in to comment.