File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
testing-common/integration-tests/src Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,13 @@ public static int methodExit(@Advice.This KeyClass thiz) {
6868
6969 @ SuppressWarnings ("unused" )
7070 public static class GetApiUsageAdvice {
71+
72+ @ Advice .OnMethodEnter (skipOn = Advice .OnNonDefaultValue .class )
73+ public static boolean methodEnter () {
74+ // always skip original method body
75+ return true ;
76+ }
77+
7178 @ AssignReturned .ToReturned
7279 @ Advice .OnMethodExit
7380 public static int methodExit (@ Advice .This KeyClass thiz ) {
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ void instanceState(Class<KeyClass> keyClass) throws Exception {
140140 KeyClass instance2 = keyClass .getConstructor ().newInstance ();
141141
142142 // correct api usage stores state in map
143- instance1 .incrementContextCount ();
143+ assertThat ( instance1 .incrementContextCount ()). isEqualTo ( 1 );
144144
145145 assertThat (instance1 .incrementContextCount ()).isEqualTo (2 );
146146 assertThat (instance2 .incrementContextCount ()).isEqualTo (1 );
@@ -159,7 +159,10 @@ void modifyInstanceState(Class<KeyClass> keyClass) throws Exception {
159159 @ MethodSource ("provideKeyClassParameters" )
160160 void removeInstanceState (Class <KeyClass > keyClass ) throws Exception {
161161 KeyClass instance1 = keyClass .getConstructor ().newInstance ();
162+
162163 instance1 .putContextCount (10 );
164+ assertThat (instance1 .getContextCount ()).isEqualTo (10 );
165+
163166 instance1 .removeContextCount ();
164167
165168 assertThat (instance1 .getContextCount ()).isEqualTo (0 );
You can’t perform that action at this time.
0 commit comments