// Path: microservices-dashboard-server-core/src/test/java/be/ordina/msdashboard/applicationinstance/ApplicationInstanceMother.java
// public final class ApplicationInstanceMother {
// 
// 	private ApplicationInstanceMother() {
// 		throw new RuntimeException("Not allowed");
// 	}
// 
// 	public static ApplicationInstance instance(String id, String application) {
// 		return instance(id, application, URI.create("http://localhost:8080"));
// 	}
// 
// 	public static ApplicationInstance instance(String id, String application, URI baseUri) {
// 		return ApplicationInstance.Builder.forApplicationWithId(application, id).baseUri(baseUri).build();
// 	}
// 
// 	public static ApplicationInstance instance(String id, String application, URI baseUri, Links actuatorEndpoints) {
// 		ApplicationInstance applicationInstance = ApplicationInstance.Builder.forApplicationWithId(application, id)
// 				.baseUri(baseUri)
// 				.build();
// 		applicationInstance.updateActuatorEndpoints(actuatorEndpoints);
// 		return applicationInstance;
// 	}
// }
// 
// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/ApplicationInstanceService.java
// public class ApplicationInstanceService {
// 
// 	private final ApplicationInstanceRepository repository;
// 
// 	public ApplicationInstanceService(ApplicationInstanceRepository repository) {
// 		this.repository = repository;
// 	}
// 
// 	public Optional<String> getApplicationInstanceIdForServiceInstance(ServiceInstance serviceInstance) {
// 		return this.getById(serviceInstance.getInstanceId())
// 				.map(ApplicationInstance::getId);
// 	}
// 
// 	public Optional<ApplicationInstance> getById(String id) {
// 		return Optional.ofNullable(this.repository.getById(id));
// 	}
// 
// 	public List<ApplicationInstance> getApplicationInstances() {
// 		return this.repository.getAll();
// 	}
// 
// 	public String createApplicationInstance(CreateApplicationInstance command) {
// 		final ServiceInstance serviceInstance = command.getServiceInstance();
// 		ApplicationInstance applicationInstance = ApplicationInstance.Builder
// 				.forApplicationWithId(serviceInstance.getServiceId(), serviceInstance.getInstanceId())
// 				.baseUri(serviceInstance.getUri())
// 				.build();
// 		return this.repository.save(applicationInstance).getId();
// 	}
// 
// 	public void updateApplicationInstanceHealth(final UpdateApplicationInstanceHealth command) {
// 		this.getById(command.getId())
// 				.ifPresent(applicationInstance -> {
// 					applicationInstance.updateHealthStatus(command.getHealthStatus());
// 					this.repository.save(applicationInstance);
// 				});
// 	}
// 
// 	public void updateActuatorEndpoints(final UpdateActuatorEndpoints command) {
// 		this.getById(command.getId())
// 				.ifPresent(applicationInstance -> {
// 					applicationInstance.updateActuatorEndpoints(command.getActuatorEndpoints());
// 					this.repository.save(applicationInstance);
// 				});
// 	}
// 
// 	public void deleteApplicationInstance(final DeleteApplicationInstance command) {
// 		this.getById(command.getId())
// 				.ifPresent(applicationInstance -> {
// 					applicationInstance.delete();
// 					this.repository.save(applicationInstance);
// 				});
// 	}
// 
// }


import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.verify;
import static org.mockito.BDDMockito.verifyNoMoreInteractions;
import static org.mockito.BDDMockito.when;
import java.util.Optional;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import be.ordina.msdashboard.applicationinstance.ApplicationInstanceMother;
import be.ordina.msdashboard.applicationinstance.ApplicationInstanceService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
/*
 * Copyright 2015-2019 the original author or authors.
 *
 * 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 be.ordina.msdashboard.api;






/**
 * @author Tim Ysewyn
 */
@RunWith(MockitoJUnitRunner.class)
public class ApplicationInstanceControllerTests {

	@Mock
// Path: microservices-dashboard-server-core/src/test/java/be/ordina/msdashboard/applicationinstance/ApplicationInstanceMother.java
// public final class ApplicationInstanceMother {
// 
// 	private ApplicationInstanceMother() {
// 		throw new RuntimeException("Not allowed");
// 	}
// 
// 	public static ApplicationInstance instance(String id, String application) {
// 		return instance(id, application, URI.create("http://localhost:8080"));
// 	}
// 
// 	public static ApplicationInstance instance(String id, String application, URI baseUri) {
// 		return ApplicationInstance.Builder.forApplicationWithId(application, id).baseUri(baseUri).build();
// 	}
// 
// 	public static ApplicationInstance instance(String id, String application, URI baseUri, Links actuatorEndpoints) {
// 		ApplicationInstance applicationInstance = ApplicationInstance.Builder.forApplicationWithId(application, id)
// 				.baseUri(baseUri)
// 				.build();
// 		applicationInstance.updateActuatorEndpoints(actuatorEndpoints);
// 		return applicationInstance;
// 	}
// }
// 
// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/ApplicationInstanceService.java
// public class ApplicationInstanceService {
// 
// 	private final ApplicationInstanceRepository repository;
// 
// 	public ApplicationInstanceService(ApplicationInstanceRepository repository) {
// 		this.repository = repository;
// 	}
// 
// 	public Optional<String> getApplicationInstanceIdForServiceInstance(ServiceInstance serviceInstance) {
// 		return this.getById(serviceInstance.getInstanceId())
// 				.map(ApplicationInstance::getId);
// 	}
// 
// 	public Optional<ApplicationInstance> getById(String id) {
// 		return Optional.ofNullable(this.repository.getById(id));
// 	}
// 
// 	public List<ApplicationInstance> getApplicationInstances() {
// 		return this.repository.getAll();
// 	}
// 
// 	public String createApplicationInstance(CreateApplicationInstance command) {
// 		final ServiceInstance serviceInstance = command.getServiceInstance();
// 		ApplicationInstance applicationInstance = ApplicationInstance.Builder
// 				.forApplicationWithId(serviceInstance.getServiceId(), serviceInstance.getInstanceId())
// 				.baseUri(serviceInstance.getUri())
// 				.build();
// 		return this.repository.save(applicationInstance).getId();
// 	}
// 
// 	public void updateApplicationInstanceHealth(final UpdateApplicationInstanceHealth command) {
// 		this.getById(command.getId())
// 				.ifPresent(applicationInstance -> {
// 					applicationInstance.updateHealthStatus(command.getHealthStatus());
// 					this.repository.save(applicationInstance);
// 				});
// 	}
// 
// 	public void updateActuatorEndpoints(final UpdateActuatorEndpoints command) {
// 		this.getById(command.getId())
// 				.ifPresent(applicationInstance -> {
// 					applicationInstance.updateActuatorEndpoints(command.getActuatorEndpoints());
// 					this.repository.save(applicationInstance);
// 				});
// 	}
// 
// 	public void deleteApplicationInstance(final DeleteApplicationInstance command) {
// 		this.getById(command.getId())
// 				.ifPresent(applicationInstance -> {
// 					applicationInstance.delete();
// 					this.repository.save(applicationInstance);
// 				});
// 	}
// 
// }


// Path: microservices-dashboard-server-core/src/test/java/be/ordina/msdashboard/api/ApplicationInstanceControllerTests.java
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.verify;
import static org.mockito.BDDMockito.verifyNoMoreInteractions;
import static org.mockito.BDDMockito.when;
import java.util.Optional;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import be.ordina.msdashboard.applicationinstance.ApplicationInstanceMother;
import be.ordina.msdashboard.applicationinstance.ApplicationInstanceService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

/*
 * Copyright 2015-2019 the original author or authors.
 *
 * 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 be.ordina.msdashboard.api;






/**
 * @author Tim Ysewyn
 */
@RunWith(MockitoJUnitRunner.class)
public class ApplicationInstanceControllerTests {

	@Mock
	private ApplicationInstanceService service;