JAVA-1526: Delete moved articles from spring-boot-properties
This commit is contained in:
-40
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
-22
@@ -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");
|
||||
}
|
||||
}
|
||||
-22
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user