@Test public final void testWithObjNull() { String content = "content"; EntityType destinationType = EntityType.PERSON; String destinationId = "username1"; context.checking(new Expectations() { { oneOf(verbPopulator).populate(with(any(ActivityDTO.class))); } }); ActivityDTO result = sut.getActivityDTO(content, destinationType, destinationId, verbPopulator, null); Assert.assertEquals(content, result.getBaseObjectProperties().get("content")); Assert.assertEquals(destinationType, result.getDestinationStream().getType()); Assert.assertEquals(destinationId, result.getDestinationStream().getUniqueIdentifier()); context.assertIsSatisfied(); }
public ActivityDTO getActivityDTO(final String inContent, final EntityType inDestinationType, final String inDestinationUniqueId, final ActivityDTOPopulatorStrategy verbPopulator, final ActivityDTOPopulatorStrategy objectPopulator) { ActivityDTO activity = new ActivityDTO(); HashMap<String, String> props = new HashMap<String, String>(); activity.setBaseObjectProperties(props); activity.getBaseObjectProperties().put("content", inContent); StreamEntityDTO destination = new StreamEntityDTO(); destination.setUniqueIdentifier(inDestinationUniqueId); destination.setType(inDestinationType); activity.setDestinationStream(destination); if (verbPopulator != null) { verbPopulator.populate(activity); } if (objectPopulator != null) { objectPopulator.populate(activity); } return activity; }
ActivityDTOPopulator { public ActivityDTO getActivityDTO(final String inContent, final EntityType inDestinationType, final String inDestinationUniqueId, final ActivityDTOPopulatorStrategy verbPopulator, final ActivityDTOPopulatorStrategy objectPopulator) { ActivityDTO activity = new ActivityDTO(); HashMap<String, String> props = new HashMap<String, String>(); activity.setBaseObjectProperties(props); activity.getBaseObjectProperties().put("content", inContent); StreamEntityDTO destination = new StreamEntityDTO(); destination.setUniqueIdentifier(inDestinationUniqueId); destination.setType(inDestinationType); activity.setDestinationStream(destination); if (verbPopulator != null) { verbPopulator.populate(activity); } if (objectPopulator != null) { objectPopulator.populate(activity); } return activity; } }
ActivityDTOPopulator { public ActivityDTO getActivityDTO(final String inContent, final EntityType inDestinationType, final String inDestinationUniqueId, final ActivityDTOPopulatorStrategy verbPopulator, final ActivityDTOPopulatorStrategy objectPopulator) { ActivityDTO activity = new ActivityDTO(); HashMap<String, String> props = new HashMap<String, String>(); activity.setBaseObjectProperties(props); activity.getBaseObjectProperties().put("content", inContent); StreamEntityDTO destination = new StreamEntityDTO(); destination.setUniqueIdentifier(inDestinationUniqueId); destination.setType(inDestinationType); activity.setDestinationStream(destination); if (verbPopulator != null) { verbPopulator.populate(activity); } if (objectPopulator != null) { objectPopulator.populate(activity); } return activity; }  }
ActivityDTOPopulator { public ActivityDTO getActivityDTO(final String inContent, final EntityType inDestinationType, final String inDestinationUniqueId, final ActivityDTOPopulatorStrategy verbPopulator, final ActivityDTOPopulatorStrategy objectPopulator) { ActivityDTO activity = new ActivityDTO(); HashMap<String, String> props = new HashMap<String, String>(); activity.setBaseObjectProperties(props); activity.getBaseObjectProperties().put("content", inContent); StreamEntityDTO destination = new StreamEntityDTO(); destination.setUniqueIdentifier(inDestinationUniqueId); destination.setType(inDestinationType); activity.setDestinationStream(destination); if (verbPopulator != null) { verbPopulator.populate(activity); } if (objectPopulator != null) { objectPopulator.populate(activity); } return activity; }  ActivityDTO getActivityDTO(final String inContent, final EntityType inDestinationType,
            final String inDestinationUniqueId, final ActivityDTOPopulatorStrategy verbPopulator,
            final ActivityDTOPopulatorStrategy objectPopulator); }
ActivityDTOPopulator { public ActivityDTO getActivityDTO(final String inContent, final EntityType inDestinationType, final String inDestinationUniqueId, final ActivityDTOPopulatorStrategy verbPopulator, final ActivityDTOPopulatorStrategy objectPopulator) { ActivityDTO activity = new ActivityDTO(); HashMap<String, String> props = new HashMap<String, String>(); activity.setBaseObjectProperties(props); activity.getBaseObjectProperties().put("content", inContent); StreamEntityDTO destination = new StreamEntityDTO(); destination.setUniqueIdentifier(inDestinationUniqueId); destination.setType(inDestinationType); activity.setDestinationStream(destination); if (verbPopulator != null) { verbPopulator.populate(activity); } if (objectPopulator != null) { objectPopulator.populate(activity); } return activity; }  ActivityDTO getActivityDTO(final String inContent, final EntityType inDestinationType,
            final String inDestinationUniqueId, final ActivityDTOPopulatorStrategy verbPopulator,
            final ActivityDTOPopulatorStrategy objectPopulator);  }