@Test public void getMetadata() { DocumentMetadata metadata = tradeshiftApiService.getDocumentMetadata(tenantId, DOCUMENT_ID); assertNotNull(metadata); assertNotNull(metadata.getDocumentId()); assertNotNull(metadata.getState()); assertNotNull(metadata.getDocumentType()); }
@Test public void getDocumentFiles() { DocumentFileList dfList = tradeshiftApiService.getDocumentFiles(tenantId, null, 100, 0, null, null, null); assertNotNull(dfList); assertTrue(dfList.getItemCount() > 0); assertTrue(dfList.getItems().size() > 0); assertTrue(dfList.getItemCount() >= dfList.getItems().size()); }
@Test public void getAppSettings() { AppSettings expectedAppSettings = new AppSettings(); AppSettings actualAppSettings = tradeshiftApiService.getAppSettings(tenantId); assertReflectionEquals( expectedAppSettings, actualAppSettings, new ReflectionComparatorMode[] {ReflectionComparatorMode.LENIENT_DATES}); }
@Test @Ignore public void getDispatch() { Dispatch dispatch = tradeshiftApiService.getLatestDispatch(tenantId, DOCUMENT_ID); assertNotNull(dispatch); assertNotNull(dispatch.getDispatchID()); assertNotNull(dispatch.getDispatchChannel()); assertNotNull(dispatch.getDispatchState()); assertNotNull(dispatch.getObjectId()); assertNotNull(dispatch.getSenderCompanyAccountId()); }
@Test public void getDocument() throws IOException { // TODO: pick up a DocumentID from a property file UUID documentId = DOCUMENT_ID; byte[] rawXml = tradeshiftApiService.getDocument(tenantId, documentId, null); assertNotNull(rawXml); // Save the pulled file. It will be used by DocumentServiceTest tests // TODO: take the resources path and test file names from a property file IOUtils.writeToFile( DocumentServiceTest.RESOURCES_PATH + "/" + DocumentServiceTest.TEST_UBL_FILE_NAME, rawXml, false); }