MetacardFactory { public Metacard createMetacard(String id) { Metacard metacard = new MetacardImpl(metacardType); metacard.setAttribute(new AttributeImpl(Media.TYPE, MIME_TYPE.toString())); metacard.setAttribute(new AttributeImpl(Metacard.CONTENT_TYPE, MIME_TYPE.toString())); LOGGER.trace( "Setting the metacard attribute [{}, {}], [{}, {}]", Media.TYPE, MIME_TYPE, Metacard.CONTENT_TYPE, MIME_TYPE); if (id != null) { metacard.setAttribute(new AttributeImpl(Core.ID, id)); } return metacard; }  Metacard createMetacard(String id); void setMetacardType(MetacardType metacardType); @Override String toString(); static final MimeType MIME_TYPE; }
@Test public void testCreateMetacardNullId() { Metacard metacard = metacardFactory.createMetacard(null); validateMetacard(metacard); }