@Override public void test() { TestUtil.test(() -> { return findConfigurationEntries(input, createDao()); }, expectation, getClass(), new JsonSerializationOptions(true, false)); } }
@Override public void test() { TestUtil.test(() -> { return findConfigurationEntriesGuid(input, createDao()); }, expectation, getClass(), new JsonSerializationOptions(true, false)); } }
protected void testCreate(DeploymentDescriptor mtad, Map<String, ResolvedConfigurationReference> resolvedResources, String spaceId, Expectation expectation) { TestUtil.test(() -> { return new ConfigurationSubscriptionFactory().create(mtad, resolvedResources, spaceId); }, expectation, getClass()); }
@Override protected void testCreate(DeploymentDescriptor mtad, Map<String, ResolvedConfigurationReference> resolvedResources, String spaceId, Expectation expectation) { TestUtil.test(() -> { return new ConfigurationSubscriptionFactory().create(mtad, resolvedResources, spaceId); }, expectation, getClass()); }
@Test public void testFromOperations() { TestUtil.test(() -> Health.fromOperations(operations), expectation, getClass()); }
@Test public void testAttemptToCorrect() throws Exception { TestUtil.test(() -> validator.attemptToCorrect(domain), expectation, getClass()); }
@Test public void testGetServices() { TestUtil.test(new Callable<List<CloudServiceExtended>>() { @Override public List<CloudServiceExtended> call() throws Exception { return servicesBuilder.build(resourcesCalculator.calculateContentForBuilding(deploymentDescriptor.getResources2())); } }, expectedServices, getClass(), new TestUtil.JsonSerializationOptions(false, true)); }
@Test public void testGetSpace() throws Exception { String response = TestUtil.getResourceAsString("get-space-response.json", getClass()); Map<String, Object> urlVariables = new HashMap<>(); urlVariables.put("id", "1"); when(restTemplate.getForObject(GET_SPACE_ENDPOINT, String.class, urlVariables)).thenReturn(response); TestUtil.test(() -> spaceGetter.getSpace(client, "1"), new Expectation(Expectation.Type.RESOURCE, "expected-cloud-space-00.json"), getClass()); }
@Override public void test() { TestUtil.test(() -> { return dao.find(findConfigurationEntries(input, dao).get(0) .getId()); }, expectation, getClass(), new JsonSerializationOptions(true, false)); }
@Override protected void test() throws Exception { TestUtil.test(() -> { return dao.update(findConfigurationEntries(input, dao).get(0) .getId(), input.configurationEntry); }, expectation, getClass(), new JsonSerializationOptions(true, false)); }
@Test public void testBuild() { ConfigurationEntriesCloudModelBuilder builder = new ConfigurationEntriesCloudModelBuilder(orgName, spaceName, ""); TestUtil.test(() -> builder.build(deploymentDescriptor), expectation, getClass()); }
@Override protected void test() throws Exception { TestUtil.test(() -> dao.update(findOne(input, dao).getId(), input.subscription), expectation, getClass(), new JsonSerializationOptions(true, false)); }
@Override protected void test() throws Exception { TestUtil.test(() -> dao.remove(findOne(input, dao).getId()), expectation, getClass(), new JsonSerializationOptions(true, false)); }
@Test public void testResolve() { ConfigurationReferencesResolver referencesResolver = getConfigurationResolver(descriptor); TestUtil.test(() -> { referencesResolver.resolve(descriptor); return descriptor; }, expectation, getClass()); }
@Test public void testDetectFirstDeployedApplicationColor() { TestUtil.test(() -> new ApplicationColorDetector().detectFirstDeployedApplicationColor(deployedMta), expectations[1], getClass()); }
@Test public void testResolve() { DeploymentDescriptor descriptor = new DescriptorParser().parseDeploymentDescriptorYaml(getClass().getResourceAsStream("mtad.yaml")); PartialDescriptorReferenceResolver resolver = new PartialDescriptorReferenceResolver(descriptor, Arrays.asList("plugins")); TestUtil.test(() -> { return resolver.resolve(); }, new Expectation(Expectation.Type.RESOURCE, "resolved-mtad.json"), getClass()); }
@ParameterizedTest @MethodSource public void testDetectAllApplications(String appsResourceLocation, Expectation expectation) throws IOException { List<CloudApplication> apps = parseApps(appsResourceLocation); TestUtil.test(() -> new DeployedComponentsDetector().detectAllDeployedComponents(apps), expectation, getClass()); }
@Override public void test() { TestUtil.test(() -> { ConfigurationEntry entry = findConfigurationEntries(input, dao).get(0); dao.remove(entry.getId()); assertTrue(!dao.exists(entry.getId())); }, expectation); }
@Test public void testExpand() throws Exception { Map<String, Object> properties = JsonUtil.convertJsonToMap(TestUtil.getResourceAsString(propertiesLocation, getClass())); PropertiesExpander expander = new PropertiesExpander(originalDependencyName, newDependencyNames); TestUtil.test(() -> expander.expand(properties), expectation, getClass()); assertEquals(expandedProperties, expander.getExpandedProperties()); }
@Test public void testToJson() throws Exception { Object object = JsonUtil.fromJson(TestUtil.getResourceAsString(objectLocation, getClass()), clasz); test(() -> { return new SecureSerializationFacade().setFormattedOutput(true) .setSensitiveElementNames(sensitiveElementNames) .toJson(object); }, expectation, getClass()); }