JAVA-1526: Delete moved articles from spring-boot-properties

This commit is contained in:
Krzysztof Woyke
2020-05-20 15:58:43 +02:00
parent 304a6fb6cc
commit 7c0fa2dbcf
12 changed files with 0 additions and 380 deletions
@@ -1,40 +0,0 @@
package com.baeldung.value;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit4.SpringRunner;
import static junit.framework.TestCase.assertEquals;
import static org.mockito.Mockito.when;
@RunWith(SpringRunner.class)
public class ClassNotManagedBySpringIntegrationTest {
@MockBean
private InitializerBean initializerBean;
@Before
public void init() {
when(initializerBean.initClass())
.thenReturn(new ClassNotManagedBySpring("This is only sample value", "Another configured value"));
}
@Test
public void givenInitializerBean_whenInvokedInitClass_shouldInitialize() throws Exception {
//given
ClassNotManagedBySpring classNotManagedBySpring = initializerBean.initClass();
//when
String initializedValue = classNotManagedBySpring.getCustomVariable();
String anotherCustomVariable = classNotManagedBySpring.getAnotherCustomVariable();
//then
assertEquals("This is only sample value", initializedValue);
assertEquals("Another configured value", anotherCustomVariable);
}
}
@@ -1,22 +0,0 @@
package com.baeldung.value;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = CollectionProvider.class)
public class CollectionProviderIntegrationTest {
@Autowired
private CollectionProvider collectionProvider;
@Test
public void givenPropertyFileWhenSetterInjectionUsedThenValueInjected() {
assertThat(collectionProvider.getValues()).contains("A", "B", "C");
}
}
@@ -1,22 +0,0 @@
package com.baeldung.value;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = PriorityProvider.class)
public class PriorityProviderIntegrationTest {
@Autowired
private PriorityProvider priorityProvider;
@Test
public void givenPropertyFileWhenConstructorInjectionUsedThenValueInjected() {
assertThat(priorityProvider.getPriority()).isEqualTo("high");
}
}