Move "testing" string into BadgeConfiguration
This commit is contained in:
parent
17e8b77e88
commit
3172b571c6
|
@ -14,6 +14,8 @@ import javax.validation.constraints.NotEmpty;
|
|||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public class BadgeConfiguration {
|
||||
public static final String CATEGORY_TESTING = "testing";
|
||||
|
||||
private final String id;
|
||||
private final URL imageUrl;
|
||||
private final String category;
|
||||
|
@ -43,4 +45,8 @@ public class BadgeConfiguration {
|
|||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public boolean isTestBadge() {
|
||||
return CATEGORY_TESTING.equals(category);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -477,7 +477,7 @@ public class ProfileController {
|
|||
// This is for testing badges and allows them to be added to an account at any time with an expiration of 1 day
|
||||
// in the future.
|
||||
BadgeConfiguration badgeConfiguration = badgeConfigurationMap.get(badgeId);
|
||||
if (badgeConfiguration != null && "testing".equals(badgeConfiguration.getCategory())) {
|
||||
if (badgeConfiguration != null && badgeConfiguration.isTestBadge()) {
|
||||
result.put(badgeId, new AccountBadge(badgeId, clock.instant().plus(Duration.ofDays(1)), true));
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue