Skip to content

Commit bfeed7d

Browse files
committed
refactor: make use of StringUtils.isNotEmpty
1 parent 9d24f30 commit bfeed7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/valkey/src/main/java/org/testcontainers/valkey/ValkeyContainer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ public void start() {
147147
command.add("--requirepass");
148148
command.add(password);
149149

150-
if (username != null && !username.isEmpty()) {
150+
if (StringUtils.isNotEmpty(username)) {
151151
command.add("--user " + username + " on >" + password + " ~* +@all");
152152
}
153153
}
154154

155-
if (persistenceVolume != null && !persistenceVolume.isEmpty()) {
155+
if (StringUtils.isNotEmpty(persistenceVolume)) {
156156
command.addAll(Arrays.asList("--appendonly", "yes"));
157157
withFileSystemBind(persistenceVolume, "/data");
158158
}
@@ -168,7 +168,7 @@ public void start() {
168168
command.addAll(Arrays.asList("--loglevel", logLevel.getLevel()));
169169
}
170170

171-
if (initialImportScriptFile != null && !initialImportScriptFile.isEmpty()) {
171+
if (StringUtils.isNotEmpty(initialImportScriptFile)) {
172172
withCopyToContainer(MountableFile.forHostPath(initialImportScriptFile),
173173
"/tmp/import.valkey");
174174
withCopyToContainer(MountableFile.forClasspathResource("import.sh"), "/tmp/import.sh");

0 commit comments

Comments
 (0)