@Test public void test() { context.checking(new Expectations() { { allowing(actionContext).getPrincipal(); will(returnValue(actionContextPrincipal)); allowing(actionContextPrincipal).getId(); will(returnValue(PERSON_ID)); oneOf(mapper).execute(PERSON_ID); will(returnValue(ppp)); oneOf(themeCssUrlTransfomer).transform(ppp); will(returnValue(null)); oneOf(ppp).setThemeCssFile(null); } }); assertEquals(ppp, sut.execute(actionContext)); context.assertIsSatisfied(); }
@Override public PersonPagePropertiesDTO execute(final PrincipalActionContext inActionContext) { long start = System.currentTimeMillis(); PersonPagePropertiesDTO result = personPagePropertiesByIdMapper.execute(inActionContext.getPrincipal().getId()); long startCssPathGen = System.currentTimeMillis(); result.setThemeCssFile(personPagePropertiesDTOToCssUrlTransformer.transform(result)); long end = System.currentTimeMillis(); log.debug("Set theme css path time: " + (end - startCssPathGen) + "(ms)"); log.debug("Get personPageProperties from DB/Cache: " + (end - start) + "(ms)"); return result; }
GetPersonPagePropertiesExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public PersonPagePropertiesDTO execute(final PrincipalActionContext inActionContext) { long start = System.currentTimeMillis(); PersonPagePropertiesDTO result = personPagePropertiesByIdMapper.execute(inActionContext.getPrincipal().getId()); long startCssPathGen = System.currentTimeMillis(); result.setThemeCssFile(personPagePropertiesDTOToCssUrlTransformer.transform(result)); long end = System.currentTimeMillis(); log.debug("Set theme css path time: " + (end - startCssPathGen) + "(ms)"); log.debug("Get personPageProperties from DB/Cache: " + (end - start) + "(ms)"); return result; } }
GetPersonPagePropertiesExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public PersonPagePropertiesDTO execute(final PrincipalActionContext inActionContext) { long start = System.currentTimeMillis(); PersonPagePropertiesDTO result = personPagePropertiesByIdMapper.execute(inActionContext.getPrincipal().getId()); long startCssPathGen = System.currentTimeMillis(); result.setThemeCssFile(personPagePropertiesDTOToCssUrlTransformer.transform(result)); long end = System.currentTimeMillis(); log.debug("Set theme css path time: " + (end - startCssPathGen) + "(ms)"); log.debug("Get personPageProperties from DB/Cache: " + (end - start) + "(ms)"); return result; } GetPersonPagePropertiesExecution(
            final DomainMapper<Long, PersonPagePropertiesDTO> inPersonPagePropertiesByIdMapper,
            final Transformer<PersonPagePropertiesDTO, String> inThemeCssUrlTransfomer); }
GetPersonPagePropertiesExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public PersonPagePropertiesDTO execute(final PrincipalActionContext inActionContext) { long start = System.currentTimeMillis(); PersonPagePropertiesDTO result = personPagePropertiesByIdMapper.execute(inActionContext.getPrincipal().getId()); long startCssPathGen = System.currentTimeMillis(); result.setThemeCssFile(personPagePropertiesDTOToCssUrlTransformer.transform(result)); long end = System.currentTimeMillis(); log.debug("Set theme css path time: " + (end - startCssPathGen) + "(ms)"); log.debug("Get personPageProperties from DB/Cache: " + (end - start) + "(ms)"); return result; } GetPersonPagePropertiesExecution(
            final DomainMapper<Long, PersonPagePropertiesDTO> inPersonPagePropertiesByIdMapper,
            final Transformer<PersonPagePropertiesDTO, String> inThemeCssUrlTransfomer); @Override PersonPagePropertiesDTO execute(final PrincipalActionContext inActionContext); }
GetPersonPagePropertiesExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public PersonPagePropertiesDTO execute(final PrincipalActionContext inActionContext) { long start = System.currentTimeMillis(); PersonPagePropertiesDTO result = personPagePropertiesByIdMapper.execute(inActionContext.getPrincipal().getId()); long startCssPathGen = System.currentTimeMillis(); result.setThemeCssFile(personPagePropertiesDTOToCssUrlTransformer.transform(result)); long end = System.currentTimeMillis(); log.debug("Set theme css path time: " + (end - startCssPathGen) + "(ms)"); log.debug("Get personPageProperties from DB/Cache: " + (end - start) + "(ms)"); return result; } GetPersonPagePropertiesExecution(
            final DomainMapper<Long, PersonPagePropertiesDTO> inPersonPagePropertiesByIdMapper,
            final Transformer<PersonPagePropertiesDTO, String> inThemeCssUrlTransfomer); @Override PersonPagePropertiesDTO execute(final PrincipalActionContext inActionContext);  }