@Test public void addsAMustSatisfySpecificationFacetIfAnnotated() { context.checking(new Expectations() { { oneOf(mockFacetedMethodParameter).addFacet(with(anInstanceOf(MustSatisfySpecificationFacetForMustSatisfyAnnotationOnParameter.class))); } }); facetFactory.processParamsMustSatisfy(new ProcessParameterContext(Customer.class, changeLastNameMethodWith, 0, null, mockFacetedMethodParameter)); }
@Test public void doesNotAddsAMustSatisfySpecificationFacetIfNotAnnotated() { context.checking(new Expectations() { { never(mockFacetedMethodParameter).addFacet(with(anInstanceOf(MustSatisfySpecificationFacetForMustSatisfyAnnotationOnParameter.class))); } }); facetFactory.processParamsMustSatisfy(new ProcessParameterContext(Customer.class, changeLastNameMethodWithout, 0, null, mockFacetedMethodParameter)); }
@Test public void addsAMustSatisfySpecificationFacetIfAnnotated() { final MustSatisfySpecificationOnParameterFacetFactory facetFactory = new MustSatisfySpecificationOnParameterFacetFactory(); mockery.checking(new Expectations() { { one(mockFacetedMethodParameter).addFacet(with(anInstanceOf(MustSatisfySpecificationOnParameterFacet.class))); } }); facetFactory.processParams(new ProcessParameterContext(changeLastNameMethodWith, 0, mockFacetedMethodParameter)); }
@Test public void doesNotAddsAMustSatisfySpecificationFacetIfNotAnnotated() { final MustSatisfySpecificationOnParameterFacetFactory facetFactory = new MustSatisfySpecificationOnParameterFacetFactory(); mockery.checking(new Expectations() { { never(mockFacetedMethodParameter).addFacet(with(anInstanceOf(MustSatisfySpecificationOnParameterFacet.class))); } }); facetFactory.processParams(new ProcessParameterContext(changeLastNameMethodWithout, 0, mockFacetedMethodParameter)); }