Skip to content

Commit

Permalink
replace unit test cases from undertow to jetty,remove powermock (Athe…
Browse files Browse the repository at this point in the history
…nZ#909)

Co-authored-by: Henry Avetisyan <[email protected]>
  • Loading branch information
havetisyan and Henry Avetisyan authored Mar 12, 2020
1 parent ba3c0cd commit 1355a53
Show file tree
Hide file tree
Showing 11 changed files with 340 additions and 440 deletions.
33 changes: 7 additions & 26 deletions clients/java/zms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,41 +113,22 @@
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>2.0.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-testng</artifactId>
<version>2.0.5</version>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
<version>2.0.29.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-servlet</artifactId>
<version>2.0.29.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>${jersey.version}</version>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-undertow</artifactId>
<artifactId>resteasy-client</artifactId>
<version>4.5.2.Final</version>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ String lookupZMSUrl() {
return url;
}

ClientBuilder getClientBuilder() {
return ClientBuilder.newBuilder();
}

/**
* Initialize the client for class constructors
*
Expand Down Expand Up @@ -368,7 +372,7 @@ private void initClient(String url, SSLContext sslContext) {
sslContext = createSSLContext();
}

ClientBuilder builder = ClientBuilder.newBuilder();
ClientBuilder builder = getClientBuilder();
if (sslContext != null) {
builder = builder.sslContext(sslContext);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2020 Verizon Media
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yahoo.athenz.zms;

import javax.ws.rs.client.ClientBuilder;

public class ZMSClientExt extends ZMSClient {

private static ClientBuilder clientBuilder;

public ZMSClientExt(String baseUri) {
super(baseUri);
}

public static void setClientBuilder(ClientBuilder builder) {
clientBuilder = builder;
}

@Override
ClientBuilder getClientBuilder() {
return (clientBuilder == null) ? ClientBuilder.newBuilder() : clientBuilder;
}
}
Loading

0 comments on commit 1355a53

Please sign in to comment.