FUS: add option to send data to test server

This commit is contained in:
Svetlana.Zemlyanskaya
2019-04-14 07:39:45 +02:00
parent dfa6fe0b20
commit 823bf31091
2 changed files with 10 additions and 3 deletions
@@ -69,7 +69,7 @@ public class SendEventLogAction extends AnAction {
private static class EventLogTestSettingsService extends EventLogExternalSettingsService implements EventLogSettingsService {
private EventLogTestSettingsService() {
super(FUS_RECORDER);
super(FUS_RECORDER, true);
}
@Override
@@ -48,12 +48,19 @@ public class EventLogExternalSettingsService extends SettingsConnectionService i
}
public EventLogExternalSettingsService(@NotNull String recorderId) {
super(getConfigUrl(recorderId), null);
super(getConfigUrl(recorderId, false), null);
}
public EventLogExternalSettingsService(@NotNull String recorderId, boolean isTest) {
super(getConfigUrl(recorderId, isTest), null);
}
@NotNull
private static String getConfigUrl(@NotNull String recorderId) {
private static String getConfigUrl(@NotNull String recorderId, boolean isTest) {
final String templateUrl = ((ApplicationInfoImpl)ApplicationInfoImpl.getShadowInstance()).getEventLogSettingsUrl();
if (isTest) {
return String.format(templateUrl, "test/" + recorderId);
}
return String.format(templateUrl, recorderId);
}