@Test public void testValues() throws Exception { String resolvedPath = "/_resources/test"; String nativeLinkKey = "Attachment:38"; String[] params = new String[3]; params[0] = "param1"; params[1] = "param2"; params[2] = "param3"; CreateAttachmentUrlInstruction instruction = new CreateAttachmentUrlInstruction(); instruction.setNativeLinkKey(nativeLinkKey); instruction.setParams(params); instruction.setRequestedMenuItemKey("1"); String result = instruction.serialize(); CreateAttachmentUrlInstruction instruction2 = new CreateAttachmentUrlInstruction(); instruction2.deserialize(result); assertTrue(instruction.equals(instruction2)); assertTrue(Arrays.equals(instruction.getParams(), instruction2.getParams())); assertEquals(instruction.getNativeLinkKey(), instruction2.getNativeLinkKey()); assertEquals(instruction.getRequestedMenuItemKey(), instruction2.getRequestedMenuItemKey()); }
@Test public void testTestTest() throws Exception { CreateAttachmentUrlInstruction instruction = new CreateAttachmentUrlInstruction(); instruction.deserialize("rO0ABXcdAAI5OQAAAAIACGRvd25sb2FkAAR0cnVlAAMzMjg="); LOG.info(instruction.getNativeLinkKey()); }
@Test public void testDefault() throws Exception { CreateAttachmentUrlInstruction i1 = new CreateAttachmentUrlInstruction(); CreateAttachmentUrlInstruction i2 = new CreateAttachmentUrlInstruction(); String result = i1.serialize(); assertNotNull(result); i2.deserialize(result); assertTrue(i1.equals(i2)); }