Search in sources :

Example 21 with ConfigStoreException

use of com.mesosphere.sdk.state.ConfigStoreException in project dcos-commons by mesosphere.

the class ConfigQueriesTest method testGetTargetFailsTargetId.

@Test
public void testGetTargetFailsTargetId() throws ConfigStoreException {
    when(mockConfigStore.getTargetConfig()).thenThrow(new ConfigStoreException(Reason.STORAGE_ERROR, "hi"));
    Response response = ConfigQueries.getTarget(mockConfigStore);
    assertEquals(500, response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) ConfigStoreException(com.mesosphere.sdk.state.ConfigStoreException) Test(org.junit.Test)

Example 22 with ConfigStoreException

use of com.mesosphere.sdk.state.ConfigStoreException in project dcos-commons by mesosphere.

the class ConfigQueriesTest method testGetConfigIdsFails.

@Test
public void testGetConfigIdsFails() throws ConfigStoreException {
    when(mockConfigStore.list()).thenThrow(new ConfigStoreException(Reason.STORAGE_ERROR, "hello"));
    Response response = ConfigQueries.getConfigurationIds(mockConfigStore);
    assertEquals(500, response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) ConfigStoreException(com.mesosphere.sdk.state.ConfigStoreException) Test(org.junit.Test)

Aggregations

ConfigStoreException (com.mesosphere.sdk.state.ConfigStoreException)22 Test (org.junit.Test)11 Response (javax.ws.rs.core.Response)9 UUID (java.util.UUID)5 ServiceSpec (com.mesosphere.sdk.specification.ServiceSpec)3 RawServiceSpec (com.mesosphere.sdk.specification.yaml.RawServiceSpec)3 TaskException (com.mesosphere.sdk.offer.TaskException)2 TaskLabelReader (com.mesosphere.sdk.offer.taskdata.TaskLabelReader)2 TaskLabelWriter (com.mesosphere.sdk.offer.taskdata.TaskLabelWriter)2 DefaultServiceSpec (com.mesosphere.sdk.specification.DefaultServiceSpec)2 RawPlan (com.mesosphere.sdk.specification.yaml.RawPlan)2 ConfigStore (com.mesosphere.sdk.state.ConfigStore)2 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 ConfigurationUpdater (com.mesosphere.sdk.config.ConfigurationUpdater)1 DefaultConfigurationUpdater (com.mesosphere.sdk.config.DefaultConfigurationUpdater)1 ConfigValidationError (com.mesosphere.sdk.config.validate.ConfigValidationError)1 ConfigValidator (com.mesosphere.sdk.config.validate.ConfigValidator)1 AndRule (com.mesosphere.sdk.offer.evaluate.placement.AndRule)1 IsLocalRegionRule (com.mesosphere.sdk.offer.evaluate.placement.IsLocalRegionRule)1 PlacementRule (com.mesosphere.sdk.offer.evaluate.placement.PlacementRule)1