@Test public void test() { String[] strs = {"and", "dan"}; Anagrams a = new Anagrams(); List<String> result = new ArrayList<String>(Arrays.asList(strs)); AssertUtil.assertArrayCommonEquals(result, a.anagrams(strs)); }
@Test public void test4() { String[] strs = {"tea", "cat", "abc", "tac", "eds", "cat", "egddfs", "eat"}; String[] ret = {"tea", "cat", "cat", "tac", "eat"}; Anagrams a = new Anagrams(); List<String> result = new ArrayList<String>(Arrays.asList(ret)); AssertUtil.assertArrayCommonEquals(result, a.anagrams(strs)); }
@Override public void expected(Object o) { assertTrue(o instanceof PersonNetwork); PersonNetwork other = (PersonNetwork) o; AssertUtil.assertEquals("homeNetwork", homeNetwork, other.isHomeNetwork()); if (network != null) { network.expected(other.getNetwork()); } }
@Test(description = "Add an Android device.") public void testEnrollment() throws Exception { JsonObject enrollmentData = PayloadGenerator.getJsonPayload( Constants.AndroidEnrollment.ENROLLMENT_PAYLOAD_FILE_NAME, Constants.HTTP_METHOD_POST); enrollmentData.addProperty(Constants.DEVICE_IDENTIFIER_KEY, Constants.DEVICE_ID); MDMResponse response = client.post(Constants.AndroidEnrollment.ENROLLMENT_ENDPOINT, enrollmentData.toString()); Assert.assertEquals(HttpStatus.SC_OK, response.getStatus()); AssertUtil.jsonPayloadCompare( PayloadGenerator.getJsonPayload( Constants.AndroidEnrollment.ENROLLMENT_RESPONSE_PAYLOAD_FILE_NAME, Constants.HTTP_METHOD_POST) .toString(), response.getBody(), true); }