@Test public void testExportNoAttributes() { reportExporter.export(new Object(), false, "TestingObject", ImmutableMap.of()); assertEquals(registry.getReportedBeans(), ImmutableList.of()); }
public void export(Object object, boolean applicationPrefix, String namePrefix, Map<String, String> tags) { ReportedBean reportedBean = ReportedBean.forTarget(object, bucketIdProvider); if (!reportedBean.getAttributes().isEmpty()) { try { registry.register(object, reportedBean, applicationPrefix, namePrefix, tags); } catch (InstanceAlreadyExistsException e) { throw new ReportException(Reason.INSTANCE_ALREADY_EXISTS, e.getMessage()); } } }
ReportExporter { public void export(Object object, boolean applicationPrefix, String namePrefix, Map<String, String> tags) { ReportedBean reportedBean = ReportedBean.forTarget(object, bucketIdProvider); if (!reportedBean.getAttributes().isEmpty()) { try { registry.register(object, reportedBean, applicationPrefix, namePrefix, tags); } catch (InstanceAlreadyExistsException e) { throw new ReportException(Reason.INSTANCE_ALREADY_EXISTS, e.getMessage()); } } } }
ReportExporter { public void export(Object object, boolean applicationPrefix, String namePrefix, Map<String, String> tags) { ReportedBean reportedBean = ReportedBean.forTarget(object, bucketIdProvider); if (!reportedBean.getAttributes().isEmpty()) { try { registry.register(object, reportedBean, applicationPrefix, namePrefix, tags); } catch (InstanceAlreadyExistsException e) { throw new ReportException(Reason.INSTANCE_ALREADY_EXISTS, e.getMessage()); } } } @Inject  ReportExporter(ReportedBeanRegistry registry, BucketIdProvider bucketIdProvider); }
ReportExporter { public void export(Object object, boolean applicationPrefix, String namePrefix, Map<String, String> tags) { ReportedBean reportedBean = ReportedBean.forTarget(object, bucketIdProvider); if (!reportedBean.getAttributes().isEmpty()) { try { registry.register(object, reportedBean, applicationPrefix, namePrefix, tags); } catch (InstanceAlreadyExistsException e) { throw new ReportException(Reason.INSTANCE_ALREADY_EXISTS, e.getMessage()); } } } @Inject  ReportExporter(ReportedBeanRegistry registry, BucketIdProvider bucketIdProvider); void export(Object object, boolean applicationPrefix, String namePrefix, Map<String, String> tags); void unexportObject(Object object); @Deprecated void export(String name, Object object); @Deprecated void export(ObjectName objectName, Object object); @Deprecated void unexport(String name); @Deprecated void unexport(ObjectName objectName); }
ReportExporter { public void export(Object object, boolean applicationPrefix, String namePrefix, Map<String, String> tags) { ReportedBean reportedBean = ReportedBean.forTarget(object, bucketIdProvider); if (!reportedBean.getAttributes().isEmpty()) { try { registry.register(object, reportedBean, applicationPrefix, namePrefix, tags); } catch (InstanceAlreadyExistsException e) { throw new ReportException(Reason.INSTANCE_ALREADY_EXISTS, e.getMessage()); } } } @Inject  ReportExporter(ReportedBeanRegistry registry, BucketIdProvider bucketIdProvider); void export(Object object, boolean applicationPrefix, String namePrefix, Map<String, String> tags); void unexportObject(Object object); @Deprecated void export(String name, Object object); @Deprecated void export(ObjectName objectName, Object object); @Deprecated void unexport(String name); @Deprecated void unexport(ObjectName objectName);  }