Skip to content
This repository was archived by the owner on Dec 23, 2017. It is now read-only.

Commit 44f0e1a

Browse files
committed
Rename createOptOut() to setOptOutState()
1 parent 54f4964 commit 44f0e1a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/main/java/org/graylog/plugins/usagestatistics/UsageStatsOptOutResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ public UsageStatsOptOutState getOptOutState() {
6666
@ApiResponse(code = 500, message = "Internal Server Error")
6767
})
6868
public void setOptOutState(@Valid @NotNull UsageStatsOptOutState optOutState) {
69-
usageStatsOptOutService.createOptOut(optOutState);
69+
usageStatsOptOutService.setOptOutState(optOutState);
7070
}
7171
}

src/main/java/org/graylog/plugins/usagestatistics/UsageStatsOptOutService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public UsageStatsOptOutState getOptOutState() {
6464
return clusterConfigService.getOrDefault(UsageStatsOptOutState.class, UsageStatsOptOutState.create(false));
6565
}
6666

67-
public void createOptOut(final UsageStatsOptOutState optOutState) {
67+
public void setOptOutState(final UsageStatsOptOutState optOutState) {
6868
if (optOutState == null) {
6969
return;
7070
}

src/test/java/org/graylog/plugins/usagestatistics/UsageStatsOptOutServiceTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void testGetOptOutState() throws Exception {
9797
public void testCreateOptOut() throws Exception {
9898
webserver.enqueue(OPT_OUT_RESPONSE);
9999

100-
optOutService.createOptOut(UsageStatsOptOutState.create(true));
100+
optOutService.setOptOutState(UsageStatsOptOutState.create(true));
101101

102102
assertThat(webserver.getRequestCount()).isEqualTo(1);
103103

@@ -117,7 +117,7 @@ public void testCreateOptOutWithOptIn() throws Exception {
117117

118118
webserver.enqueue(OPT_OUT_RESPONSE);
119119

120-
optOutService.createOptOut(UsageStatsOptOutState.create(false));
120+
optOutService.setOptOutState(UsageStatsOptOutState.create(false));
121121

122122
assertThat(webserver.getRequestCount()).isEqualTo(0);
123123
assertThat(clusterConfigService.get(UsageStatsOptOutState.class)).isEqualTo(UsageStatsOptOutState.create(false));
@@ -127,7 +127,7 @@ public void testCreateOptOutWithOptIn() throws Exception {
127127
public void testCreateOptOutWithNullParam() throws Exception {
128128
webserver.enqueue(OPT_OUT_RESPONSE);
129129

130-
optOutService.createOptOut(null);
130+
optOutService.setOptOutState(null);
131131

132132
assertThat(webserver.getRequestCount()).isEqualTo(0);
133133
assertThat(clusterConfigService.get(UsageStatsOptOutState.class)).isNull();
@@ -137,7 +137,7 @@ public void testCreateOptOutWithNullParam() throws Exception {
137137
public void testCreateOptOutWithNullClusterId() throws Exception {
138138
clusterConfigService.remove(ClusterId.class);
139139

140-
optOutService.createOptOut(UsageStatsOptOutState.create(true));
140+
optOutService.setOptOutState(UsageStatsOptOutState.create(true));
141141

142142
assertThat(webserver.getRequestCount()).isEqualTo(0);
143143
}

0 commit comments

Comments
 (0)