use of com.openshift.restclient.model.IResource in project jbosstools-openshift by jbosstools.
the class ServerResourceViewModelWithServiceTest method shouldReturnNullResourceIfResourcesNotLoaded.
@Test
public void shouldReturnNullResourceIfResourcesNotLoaded() {
// given
ServerResourceViewModel model = new ServerResourceViewModel(null);
// when
IResource resource = model.getResource();
// then
assertThat(resource).isNull();
}
use of com.openshift.restclient.model.IResource in project jbosstools-openshift by jbosstools.
the class ServerResourceViewModelWithDeploymentConfigTest method shouldReturnNullServiceIfNoConnectionIsSet.
@Test
public void shouldReturnNullServiceIfNoConnectionIsSet() {
// given
ServerResourceViewModel model = new ServerResourceViewModel(null);
model.loadResources();
// when
IResource resource = model.getResource();
// then
assertThat(resource).isNull();
}
use of com.openshift.restclient.model.IResource in project jbosstools-openshift by jbosstools.
the class ServerResourceViewModelWithReplicationControllerTest method shouldReturnNullResourceIfResourcesNotLoaded.
@Test
public void shouldReturnNullResourceIfResourcesNotLoaded() {
// given
ServerResourceViewModel model = new ServerResourceViewModel(null);
// when
IResource resource = model.getResource();
// then
assertThat(resource).isNull();
}
use of com.openshift.restclient.model.IResource in project jbosstools-openshift by jbosstools.
the class ServerResourceViewModelWithReplicationControllerTest method shouldReturn1stServiceInListIfInitializedServiceIsNotInListOfAllReplicationControllers.
@Test
public void shouldReturn1stServiceInListIfInitializedServiceIsNotInListOfAllReplicationControllers() {
// given
IReplicationController otherReplicationController = ResourceMocks.createResource(IReplicationController.class, ResourceKind.REPLICATION_CONTROLLER);
ServerResourceViewModel model = new ServerResourceViewModel(otherReplicationController, connection);
model.loadResources();
// when
IResource service = model.getResource();
// then
assertThat(service).isEqualTo(ResourceMocks.PROJECT2_SERVICES[0]);
}
use of com.openshift.restclient.model.IResource in project jbosstools-openshift by jbosstools.
the class ServerResourceViewModelWithDeploymentConfigTest method shouldReturn1stServiceInListIfInitializedServiceIsNotInListOfAllDeploymentConfigs.
@Test
public void shouldReturn1stServiceInListIfInitializedServiceIsNotInListOfAllDeploymentConfigs() {
// given
IDeploymentConfig otherDeploymentConfig = ResourceMocks.createResource(IDeploymentConfig.class, ResourceKind.DEPLOYMENT_CONFIG);
ServerResourceViewModel model = new ServerResourceViewModel(otherDeploymentConfig, connection);
model.loadResources();
// when
IResource service = model.getResource();
// then
assertThat(service).isEqualTo(ResourceMocks.PROJECT2_SERVICES[0]);
}
Aggregations