AspectUtils { public void beforeMethod(JoinPoint joinPoint) { CodeSignature codeSignature = (CodeSignature) joinPoint.getSignature(); String methodName = codeSignature.getName(); String[] parameterNames = codeSignature.getParameterNames(); Object[] parameterValues = joinPoint.getArgs(); StringBuilder builder = new StringBuilder(); builder.append(methodName).append('('); if (null != parameterNames && parameterNames.length > 0) logParamValues(builder, parameterNames, parameterValues); builder.append(") Started "); LoggerFactory.getLogger(joinPoint.getTarget().getClass()).info(builder.toString()); } AspectUtils();  AspectUtils(SimpleMarshaller marshaller); void beforeMethod(JoinPoint joinPoint); void afterMethod(JoinPoint joinPoint, Object result,
			long lengthMillis); StringBuilder logParamValues(StringBuilder logLine,
			String[] paramNames, Object[] paramValues); @SuppressWarnings("rawtypes") String toString(Object object); SimpleMarshaller getMarshaller(); void setMarshaller(SimpleMarshaller marshaller); String getObjectdetails(Object obj); String getInXMLFormat(Object object);  }
@Test public void testBeforeMethod() { JoinPoint jpMock = mock(JoinPoint.class); CodeSignature csMock = mock(CodeSignature.class); when(jpMock.getSignature()).thenReturn((CodeSignature)csMock); when(csMock.getName()).thenReturn("fakeName"); when(csMock.getParameterNames()).thenReturn(new String[]{"fake1","fake2"}); Object[] obj = new Object[]{new Object(), new Object()}; when(jpMock.getArgs()).thenReturn(obj); when(jpMock.getTarget()).thenReturn(new LoggingAspect()); sut.beforeMethod(jpMock); assertNotNull(sut.getMarshaller()); }