/** Test of buildJson method, of class FizzBuzzWs. */ @Test public void testBuildJson_String() { System.out.println("buildJson"); String value = "5"; FizzBuzzWs instance = new FizzBuzzWs(); String expResult = "{ \"result\": \"5\" }"; String result = instance.buildJson(value); assertEquals(expResult, result); }
/** Test of buildJson method, of class FizzBuzzWs. */ @Test public void testBuildJson_ArrayList() { System.out.println("buildJson"); ArrayList<String> values = new ArrayList<>(); FizzBuzzWs instance = new FizzBuzzWs(); for (int i = 1; i < 6; ++i) { values.add(Integer.toString(i)); } String expResult = "{\n\t\"results\": [ \"1\", \"2\", \"3\", \"4\", \"5\" ]\n}"; String result = instance.buildJson(values); assertEquals(expResult, result); }