public void testEmptyMapReturnsNull() { assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.<String, String> of()), null); }
public void testComplete() throws IOException { Map<String, String> input = new ListOfKeyValuesDelimitedByBlankLinesToListOfMaps().apply( Strings2.toStringAndClose(MapToServerInfoTest.class.getResourceAsStream("/servers.txt"))).get(0); assertEquals(MAP_TO_DRIVE.apply(input), ONE); }
public void testNew() throws IOException { Map<String, String> input = new ListOfKeyValuesDelimitedByBlankLinesToListOfMaps().apply( Strings2.toStringAndClose(MapToServerInfoTest.class.getResourceAsStream("/new_server.txt"))).get(0); assertEquals(MAP_TO_DRIVE.apply(input), NEW); } }
public void testBasics() { ServerInfo expects = new ServerInfo.Builder().name("foo").uuid("hello").vnc(new VNC("auto", null, false)) .cpu(1000).mem(2048).metrics(new ServerMetrics.Builder().build()).build(); assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.of("name", "foo", "server", "hello", "vnc:ip", "auto", "cpu", "1000", "mem", "2048")), expects); }