[BAEL-15990] - Moved properties articles

This commit is contained in:
amit2103
2019-08-11 18:30:21 +05:30
parent 32127cc5b5
commit 84364759d6
84 changed files with 55 additions and 516 deletions

View File

@@ -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);
}
}