@Test public void testRedefinitionStrategyIsNotRetransforming() throws Exception { Instrumentation instrumentation = mock(Instrumentation.class); when(instrumentation.isRedefineClassesSupported()).thenReturn(true); assertThat( AgentBuilder.RedefinitionStrategy.REDEFINITION.isRetransforming(instrumentation), is(false)); }
@Test(expected = IllegalArgumentException.class) public void testRedefinitionStrategyNotSupportedThrowsException() throws Exception { AgentBuilder.RedefinitionStrategy.REDEFINITION.isRetransforming(mock(Instrumentation.class)); }
@Test public void testRedefinitionStrategyIsEnabled() throws Exception { assertThat(AgentBuilder.RedefinitionStrategy.REDEFINITION.isEnabled(), is(true)); }