Skip to content

Commit

Permalink
Tweak BaseTestCase class
Browse files Browse the repository at this point in the history
Now the interceptor registry is initialized via a protected method, thus
its type can be changed by overriding the method.

Change-Id: I146280f50517ec52d9f92c1f1fe19869b46538c7
Reviewed-on: https://bellevue-ci.eng.vmware.com:8080/46575
Closures-Verified: jenkins <[email protected]>
Upgrade-Verified: jenkins <[email protected]>
PG-Verified: jenkins <[email protected]>
Bellevue-Verified: jenkins <[email protected]>
CS-Verified: jenkins <[email protected]>
Reviewed-by: Sergio Sanchez <[email protected]>
  • Loading branch information
shadjiiski committed Oct 16, 2018
1 parent 85972ed commit 87274ae
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 VMware, Inc. All Rights Reserved.
* Copyright (c) 2016-2018 VMware, Inc. All Rights Reserved.
*
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except in compliance with the License.
Expand Down Expand Up @@ -204,7 +204,7 @@ protected VerificationHost createHost(String[] args) throws Throwable {

protected VerificationHost createHost(ServiceHost.Arguments args, String[] additionalArgs)
throws Throwable {
OperationInterceptorRegistry interceptors = new OperationInterceptorRegistry();
OperationInterceptorRegistry interceptors = createInterceptorRegistry();
registerInterceptors(interceptors);

CustomizationVerificationHost customizationHost = new CustomizationVerificationHost(
Expand Down Expand Up @@ -233,7 +233,7 @@ protected Map.Entry<VerificationHost, ServerX509TrustManager> createHostWithTrus
long reloadTime) throws Throwable {
ServiceHost.Arguments args = getHostArguments();

OperationInterceptorRegistry interceptors = new OperationInterceptorRegistry();
OperationInterceptorRegistry interceptors = createInterceptorRegistry();
registerInterceptors(interceptors);

VerificationHost h = VerificationHost.initialize(
Expand Down Expand Up @@ -280,6 +280,10 @@ protected long getMaintenanceIntervalMillis() {
return MAINTENANCE_INTERVAL_MILLIS;
}

protected OperationInterceptorRegistry createInterceptorRegistry() {
return new OperationInterceptorRegistry();
}

protected void registerInterceptors(OperationInterceptorRegistry registry) {
}

Expand Down

0 comments on commit 87274ae

Please sign in to comment.