Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<groupId>com.github.switcherapi</groupId>
<artifactId>switcher-client</artifactId>
<packaging>jar</packaging>
<version>2.2.1</version>
<version>2.2.2</version>

<name>Switcher Client</name>
<description>Switcher Client SDK for working with Switcher API</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
import com.github.switcherapi.client.service.remote.ClientRemote;
import com.github.switcherapi.client.utils.SnapshotLoader;
import com.github.switcherapi.client.utils.SwitcherUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Objects;

public abstract class SwitcherExecutorImpl implements SwitcherExecutor {

private static final Logger logger = LoggerFactory.getLogger(SwitcherExecutorImpl.class);
Expand Down Expand Up @@ -40,7 +39,7 @@ protected Domain initializeSnapshotFromAPI(ClientRemote clientRemote)
final Snapshot snapshot = clientRemote.resolveSnapshot();
final String snapshotLocation = switcherProperties.getValue(ContextKey.SNAPSHOT_LOCATION);

if (Objects.nonNull(snapshotLocation)) {
if (StringUtils.isNotBlank(snapshotLocation)) {
SnapshotLoader.saveSnapshot(snapshot, snapshotLocation, environment);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ void shouldUpdateSnapshot_remote_inMemory() {
.apiKey("[API_KEY]")
.environment("generated_mock_default_5")
.local(true)
.snapshotLocation("")
.snapshotAutoLoad(true)
.snapshotAutoUpdateInterval("1m"));

Expand All @@ -182,6 +183,7 @@ void shouldUpdateSnapshot_remote_inMemory() {
//test
CountDownHelper.wait(2);
assertEquals(2, Switchers.getSnapshotVersion());
assertTrue(Files.notExists(Paths.get("/generated_mock_default_5.json")));
}

@Test
Expand Down
Loading