Project

General

Profile

« Previous | Next » 

Revision 8204

test for configured target url template on metadata using the default #view url. https://projects.ecoinformatics.org/ecoinfo/issues/6092

View differences:

test/edu/ucsb/nceas/metacat/dataone/RegisterDOITest.java
46 46

  
47 47
import edu.ucsb.nceas.ezid.EZIDService;
48 48
import edu.ucsb.nceas.ezid.profile.DataCiteProfile;
49
import edu.ucsb.nceas.ezid.profile.InternalProfile;
49 50
import edu.ucsb.nceas.metacat.properties.PropertyService;
50 51

  
51 52
/**
......
177 178
			// add the actual object for the newly-minted DOI
178 179
			SystemMetadata sysmeta = null;
179 180
			InputStream object = null;
181
			boolean isMetadata = false;
180 182
			if (inputStream != null) {
181 183
				sysmeta = createSystemMetadata(guid, session.getSubject(), null);
182 184
				object = inputStream;
183 185
		        sysmeta.setFormatId(ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.1.0").getFormatId());
186
		        isMetadata = true;
184 187
			} else {
185 188
				object = new ByteArrayInputStream("test".getBytes("UTF-8"));
186 189
				sysmeta = createSystemMetadata(guid, session.getSubject(), object);
......
194 197
			assertNotNull(metadata);
195 198
			assertTrue(metadata.containsKey(DataCiteProfile.TITLE.toString()));
196 199
			
200
			// check that the target URI was updated
201
			if (isMetadata) {
202
				String registeredTarget = metadata.get(InternalProfile.TARGET.toString());
203
				assertTrue(registeredTarget.endsWith("/#view/" + pid.getValue()));
204
			}
205
			
197 206
			System.out.println("tested with DOI: " + pid.getValue());
198 207
			
199 208
		} catch (Exception e) {

Also available in: Unified diff