[TEST] Mock getVersion on channel for ServerTransportFilterTests

Original commit: elastic/x-pack-elasticsearch@0b48c21eb0
This commit is contained in:
Tim Vernum 2017-05-19 10:15:49 +10:00
parent b92a2f6582
commit b689159077
1 changed files with 1 additions and 0 deletions

View File

@ -69,6 +69,7 @@ public class ServerTransportFilterTests extends ESTestCase {
authzService = mock(AuthorizationService.class); authzService = mock(AuthorizationService.class);
channel = mock(TransportChannel.class); channel = mock(TransportChannel.class);
when(channel.getProfileName()).thenReturn(TransportSettings.DEFAULT_PROFILE); when(channel.getProfileName()).thenReturn(TransportSettings.DEFAULT_PROFILE);
when(channel.getVersion()).thenReturn(Version.CURRENT);
failDestructiveOperations = randomBoolean(); failDestructiveOperations = randomBoolean();
Settings settings = Settings.builder() Settings settings = Settings.builder()
.put(DestructiveOperations.REQUIRES_NAME_SETTING.getKey(), failDestructiveOperations).build(); .put(DestructiveOperations.REQUIRES_NAME_SETTING.getKey(), failDestructiveOperations).build();