private static List<FacetedMethodParameter> getParameters(final Method actionMethod) { final Class<?>[] parameterTypes = actionMethod.getParameterTypes(); final List<FacetedMethodParameter> actionParams = Lists.newArrayList(); for (final Class<?> parameterType : parameterTypes) { actionParams.add(new FacetedMethodParameter(parameterType)); } return Collections.unmodifiableList(actionParams); }
@Override protected void setUp() throws Exception { Logger.getRootLogger().setLevel(Level.OFF); super.setUp(); BasicConfigurator.configure(); reflector = new ProgrammableReflector(); facetHolder = new FacetHolderImpl(); facetedMethod = FacetedMethod.createProperty(Customer.class, "firstName"); facetedMethodParameter = new FacetedMethodParameter(String.class); methodRemover = new ProgrammableMethodRemover(); }
Identifier.propertyOrCollectionIdentifier(Customer.class, "firstName")); facetedMethod = FacetedMethod.createForProperty(Customer.class, "firstName"); facetedMethodParameter = new FacetedMethodParameter( FeatureType.ACTION_PARAMETER_SCALAR, facetedMethod.getOwningType(), facetedMethod.getMethod(), String.class );
@Before public void setUpFacetedMethodAndParameter() throws Exception { context.checking(new Expectations() {{ allowing(mockServicesInjector).getDeploymentCategoryProvider(); will(returnValue(mockDeploymentCategoryProvider)); allowing(mockServicesInjector).lookupService(DeploymentCategoryProvider.class); will(returnValue(mockDeploymentCategoryProvider)); allowing(mockDeploymentCategoryProvider).getDeploymentCategory(); will(returnValue(DeploymentCategory.PRODUCTION)); allowing(mockServicesInjector).getConfigurationServiceInternal(); will(returnValue(mockConfiguration)); allowing(mockServicesInjector).getPersistenceSessionServiceInternal(); will(returnValue(mockPersistenceSessionServiceInternal)); allowing(mockServicesInjector).lookupService(TranslationService.class); will(returnValue(mockTranslationService)); allowing(mockServicesInjector).getAuthenticationSessionProvider(); will(returnValue(mockAuthenticationSessionProvider)); allowing(mockServicesInjector).lookupService(AuthenticationSessionProvider.class); will(returnValue(mockAuthenticationSessionProvider)); allowing(mockServicesInjector).getSpecificationLoader(); will(returnValue(mockSpecificationLoader)); }}); facetHolder = new AbstractFacetFactoryTest.IdentifiedHolderImpl(Identifier.propertyOrCollectionIdentifier(Customer.class, "firstName")); facetedMethod = FacetedMethod.createForProperty(AbstractFacetFactoryTest.Customer.class, "firstName"); facetedMethodParameter = new FacetedMethodParameter(FeatureType.ACTION_PARAMETER_SCALAR, facetedMethod.getOwningType(), facetedMethod.getMethod(), String.class ); }