Skip to content

Commit

Permalink
Merge pull request #61 from DP-3T/develop
Browse files Browse the repository at this point in the history
Merge release candidate to master
  • Loading branch information
ubamrein committed Jul 28, 2020
2 parents 0314794 + d87548d commit b6598a3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@RequestMapping("/v1")
public class DPPPTConfigController {

private static final Version INITIAL_RELEASE_VERSIONS = new Version("1.0.5");
private static final Version CURRENT_RELEASE_VERSION = new Version("1.0.7");
private static final String IOS_VERSION_DE_WEEKLY_NOTIFCATION_INFO = "ios13.6";
private static final List<String> TESTFLIGHT_VERSIONS = List.of("ios-200619.2333.175",
"ios-200612.2347.141",
Expand Down Expand Up @@ -67,7 +67,7 @@ public DPPPTConfigController() {

// update message for various old builds
var appVersion = new Version(appversion);
if (!appVersion.isValid() || appVersion.isSmallerVersionThan(INITIAL_RELEASE_VERSIONS)) {
if (!appVersion.isValid() || appVersion.isSmallerVersionThan(CURRENT_RELEASE_VERSION)) {
config = generalUpdateRelease1(appVersion.isIOS());
}

Expand Down Expand Up @@ -104,6 +104,7 @@ private void setInfoTextForiOS136DE(ConfigResponse configResponse) {
infoBoxDe.setUrl(
"https://www.bag.admin.ch/bag/de/home/krankheiten/ausbrueche-epidemien-pandemien/aktuelle-ausbrueche-epidemien/novel-cov/faq-kontakte-downloads/haeufig-gestellte-fragen.html?faq-url=/de/categories/swisscovid-app");
infoBoxDe.setUrlTitle("Weitere Informationen");
infoBoxDe.setIsDismissible(true);
InfoBoxCollection infoBoxCollection = new InfoBoxCollection();
infoBoxCollection.setDeInfoBox(infoBoxDe);
configResponse.setInfoBox(infoBoxCollection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,62 @@

package org.dpppt.switzerland.backend.sdk.config.ws.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* @author bachmann
* created on 28.04.20
* @author bachmann created on 28.04.20
**/
@JsonIgnoreProperties(ignoreUnknown = true)
public class InfoBox {

private String title;
private String msg;
private String url;
private String urlTitle;
private String title;
private String msg;
private String url;
private String urlTitle;
private boolean isDismissible = false;

public String getInfoId() {
return Integer.toString(getTitle().hashCode() + getMsg().hashCode() + getUrl().hashCode()
+ getUrlTitle().hashCode() + Boolean.hashCode(getIsDismissible()));
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getTitle() {
return title;
}
public String getMsg() {
return msg;
}

public void setTitle(String title) {
this.title = title;
}
public void setMsg(String msg) {
this.msg = msg;
}

public String getMsg() {
return msg;
}
public String getUrl() {
return url;
}

public void setMsg(String msg) {
this.msg = msg;
}
public void setUrl(String url) {
this.url = url;
}

public String getUrl() {
return url;
}
public String getUrlTitle() {
return urlTitle;
}

public void setUrl(String url) {
this.url = url;
}
public void setUrlTitle(String urlTitle) {
this.urlTitle = urlTitle;
}

public String getUrlTitle() {
return urlTitle;
}
public boolean getIsDismissible() {
return isDismissible;
}

public void setUrlTitle(String urlTitle) {
this.urlTitle = urlTitle;
}
public void setIsDismissible(boolean isDismissible) {
this.isDismissible = isDismissible;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,16 @@ public void testForUpdateNote() throws Exception {
result = mockMvc.perform(
get("/v1/config").param("osversion", "ios12").param("appversion", "1.0.5").param("buildnr", "ios-2020.0145asdfa34"))
.andExpect(status().is2xxSuccessful()).andReturn().getResponse();
assertTestNoUpdate(result);
assertTestNormalUpdate(result);
result = mockMvc.perform(
get("/v1/config").param("osversion", "ios12").param("appversion", "ios-1.0.6").param("buildnr", "ios-2020.0145asdfa34"))
.andExpect(status().is2xxSuccessful()).andReturn().getResponse();
assertTestNoUpdate(result);
assertTestNormalUpdate(result);

result = mockMvc.perform(
get("/v1/config").param("osversion", "ios12").param("appversion", "ios-1.0.7").param("buildnr", "ios-2020.0145asdfa34"))
.andExpect(status().is2xxSuccessful()).andReturn().getResponse();
assertTestNoUpdate(result);
}
@Test
public void testForTestflight() throws Exception {
Expand All @@ -155,7 +160,7 @@ public void testForTestflight() throws Exception {
assertTestTestflightUpdate(result);
}
final MockHttpServletResponse result = mockMvc.perform(
get("/v1/config").param("osversion", "ios12").param("appversion", "1.0.5").param("buildnr", "ios-200521.2320.80"))
get("/v1/config").param("osversion", "ios12").param("appversion", "1.0.7").param("buildnr", "ios-200521.2320.80"))
.andExpect(status().is2xxSuccessful()).andReturn().getResponse();
assertTestNoUpdate(result);
}
Expand Down

0 comments on commit b6598a3

Please sign in to comment.