Skip to content

Commit

Permalink
GH2883 Move ServiceInfo Model to common-service-core
Browse files Browse the repository at this point in the history
Signed-off-by: alexandr cumarav <[email protected]>
  • Loading branch information
cumarav committed Sep 4, 2023
1 parent 8cb1223 commit 93af4cb
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
* Copyright Contributors to the Zowe Project.
*/

package org.zowe.apiml.product.services;
package org.zowe.apiml.services;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.netflix.appinfo.InstanceInfo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.zowe.apiml.auth.Authentication;
import org.zowe.apiml.config.ApiInfo;
Expand All @@ -31,6 +33,8 @@ public class ServiceInfo {
private Apiml apiml;
private Map<String, Instances> instances;

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand All @@ -40,6 +44,8 @@ public static class Apiml {
private List<Authentication> authentication;
}

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand All @@ -55,6 +61,8 @@ public static class Instances {
private Map<String, String> customMetadata;
}

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand All @@ -64,6 +72,8 @@ public static class Service {
private String homePageUrl;
}

@NoArgsConstructor
@AllArgsConstructor
@Data
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.zowe.apiml.eurekaservice.client.util.EurekaMetadataParser;
import org.zowe.apiml.product.gateway.GatewayConfigProperties;
import org.zowe.apiml.product.routing.transform.TransformService;
import org.zowe.apiml.product.services.ServicesInfoService;

@Configuration
public class ServerInfoConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.zowe.apiml.product.services.ServiceInfo;
import org.zowe.apiml.product.services.ServicesInfoService;
import org.zowe.apiml.services.ServiceInfo;

import java.util.List;

import static org.zowe.apiml.product.services.ServicesInfoService.CURRENT_VERSION;
import static org.zowe.apiml.product.services.ServicesInfoService.VERSION_HEADER;
import static org.zowe.apiml.gateway.services.ServicesInfoService.CURRENT_VERSION;
import static org.zowe.apiml.gateway.services.ServicesInfoService.VERSION_HEADER;


@RestController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Copyright Contributors to the Zowe Project.
*/

package org.zowe.apiml.product.services;
package org.zowe.apiml.gateway.services;

import com.fasterxml.jackson.core.Version;
import com.netflix.appinfo.InstanceInfo;
Expand All @@ -26,6 +26,7 @@
import org.zowe.apiml.product.routing.ServiceType;
import org.zowe.apiml.product.routing.transform.TransformService;
import org.zowe.apiml.product.routing.transform.URLTransformationException;
import org.zowe.apiml.services.ServiceInfo;

import java.util.AbstractMap;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.http.HttpStatus;
import org.zowe.apiml.product.services.ServiceInfo;
import org.zowe.apiml.product.services.ServicesInfoService;
import org.zowe.apiml.services.ServiceInfo;

import java.util.Arrays;
import java.util.Collections;
Expand All @@ -26,8 +25,8 @@
import static org.hamcrest.core.Is.is;
import static org.mockito.Mockito.when;
import static org.zowe.apiml.gateway.services.ServicesInfoController.SERVICES_URL;
import static org.zowe.apiml.product.services.ServicesInfoService.CURRENT_VERSION;
import static org.zowe.apiml.product.services.ServicesInfoService.VERSION_HEADER;
import static org.zowe.apiml.gateway.services.ServicesInfoService.CURRENT_VERSION;
import static org.zowe.apiml.gateway.services.ServicesInfoService.VERSION_HEADER;

@ExtendWith(MockitoExtension.class)
class ServicesInfoControllerTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Copyright Contributors to the Zowe Project.
*/

package org.zowe.apiml.product.services;
package org.zowe.apiml.gateway.services;

import com.netflix.appinfo.InstanceInfo;
import com.netflix.discovery.EurekaClient;
Expand All @@ -27,6 +27,7 @@
import org.zowe.apiml.product.gateway.GatewayClient;
import org.zowe.apiml.product.gateway.GatewayConfigProperties;
import org.zowe.apiml.product.routing.transform.TransformService;
import org.zowe.apiml.services.ServiceInfo;

import java.util.Arrays;
import java.util.Collections;
Expand Down

0 comments on commit 93af4cb

Please sign in to comment.