ProjectConfigParamParserTest: Convert to use Google Truth

Change-Id: I9964477709fb11c9eb1016a8ceab3c35e50b7dd9
This commit is contained in:
David Pursehouse
2015-06-03 14:22:36 +09:00
parent dc1547642c
commit e30f028b5b
2 changed files with 6 additions and 9 deletions

View File

@@ -51,8 +51,7 @@ java_test(
':sshd',
'//gerrit-extension-api:api',
'//gerrit-server:server',
'//lib:guava',
'//lib:junit',
'//lib:truth',
'//lib/mina:sshd',
],
source_under_test = [':sshd'],

View File

@@ -14,9 +14,7 @@
package com.google.gerrit.sshd.commands;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue;
@@ -40,8 +38,8 @@ public class ProjectConfigParamParserTest {
Map<String, Map<String, ConfigValue>> r =
cmd.parsePluginConfigValues(Collections.singletonList(in));
ConfigValue configValue = r.get("a").get("b");
assertEquals("c", configValue.value);
assertNull(configValue.values);
assertThat(configValue.value).isEqualTo("c");
assertThat(configValue.values).isNull();
}
@Test
@@ -50,7 +48,7 @@ public class ProjectConfigParamParserTest {
Map<String, Map<String, ConfigValue>> r =
cmd.parsePluginConfigValues(Collections.singletonList(in));
ConfigValue configValue = r.get("a").get("b");
assertArrayEquals(new String[] {"c", "d", "e"}, configValue.values.toArray());
assertNull(configValue.value);
assertThat(configValue.values).containsExactly("c", "d", "e").inOrder();
assertThat(configValue.value).isNull();
}
}