ProjectConfigParamParserTest: Convert to use Google Truth
Change-Id: I9964477709fb11c9eb1016a8ceab3c35e50b7dd9
This commit is contained in:
@@ -51,8 +51,7 @@ java_test(
|
|||||||
':sshd',
|
':sshd',
|
||||||
'//gerrit-extension-api:api',
|
'//gerrit-extension-api:api',
|
||||||
'//gerrit-server:server',
|
'//gerrit-server:server',
|
||||||
'//lib:guava',
|
'//lib:truth',
|
||||||
'//lib:junit',
|
|
||||||
'//lib/mina:sshd',
|
'//lib/mina:sshd',
|
||||||
],
|
],
|
||||||
source_under_test = [':sshd'],
|
source_under_test = [':sshd'],
|
||||||
|
@@ -14,9 +14,7 @@
|
|||||||
|
|
||||||
package com.google.gerrit.sshd.commands;
|
package com.google.gerrit.sshd.commands;
|
||||||
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
import com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue;
|
import com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue;
|
||||||
|
|
||||||
@@ -40,8 +38,8 @@ public class ProjectConfigParamParserTest {
|
|||||||
Map<String, Map<String, ConfigValue>> r =
|
Map<String, Map<String, ConfigValue>> r =
|
||||||
cmd.parsePluginConfigValues(Collections.singletonList(in));
|
cmd.parsePluginConfigValues(Collections.singletonList(in));
|
||||||
ConfigValue configValue = r.get("a").get("b");
|
ConfigValue configValue = r.get("a").get("b");
|
||||||
assertEquals("c", configValue.value);
|
assertThat(configValue.value).isEqualTo("c");
|
||||||
assertNull(configValue.values);
|
assertThat(configValue.values).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -50,7 +48,7 @@ public class ProjectConfigParamParserTest {
|
|||||||
Map<String, Map<String, ConfigValue>> r =
|
Map<String, Map<String, ConfigValue>> r =
|
||||||
cmd.parsePluginConfigValues(Collections.singletonList(in));
|
cmd.parsePluginConfigValues(Collections.singletonList(in));
|
||||||
ConfigValue configValue = r.get("a").get("b");
|
ConfigValue configValue = r.get("a").get("b");
|
||||||
assertArrayEquals(new String[] {"c", "d", "e"}, configValue.values.toArray());
|
assertThat(configValue.values).containsExactly("c", "d", "e").inOrder();
|
||||||
assertNull(configValue.value);
|
assertThat(configValue.value).isNull();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user