java.lang.AssertionError: Response content expected: but was:









up vote
-1
down vote

favorite












@RunWith(MockitoJUnitRunner.class)
public class VersionResourceImplTest

@Configuration
public static class MockConfig
@Bean
public Properties myProp()
Properties properties = new Properties();
properties.setProperty("ra.bank.app.version", "TestVersion");
return properties;



@Value("#myProp['ra.bank.app.version']")
private String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);





This is my test file. It is giving the following error



java.lang.AssertionError: Response content expected:<TestVersion> but was:<>
at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:54)
at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:81)
at org.springframework.test.web.servlet.result.ContentResultMatchers$5.match(ContentResultMatchers.java:149)
at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:171)
at com.db.creditrisk.rating.analysis.bank.ui.facade.v2.common.ws.VersionResourceImplTest.shouldReturnCorrectVersion(VersionResourceImplTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)









share|improve this question























  • I think you should use @Value("$ra.bank.app.version") private String applicationVersion;
    – GauravRai1512
    Nov 10 at 4:56










  • property file is not getting injected in my case...can you suggest something for this?
    – Supriya
    Nov 10 at 6:53










  • you don't have to create object for properties. you can use application.properties and there you can specify version details and then @value("$ra.bank.app.version") will work.
    – GauravRai1512
    Nov 10 at 7:24










  • yes I removed the properties object...and added test.properties -ra.bank.app.version=TestVersion with this value but still getting null
    – Supriya
    Nov 10 at 7:40










  • i have provided you one solution in answer tab can you please check again and do let me know if it works.
    – GauravRai1512
    Nov 10 at 7:43














up vote
-1
down vote

favorite












@RunWith(MockitoJUnitRunner.class)
public class VersionResourceImplTest

@Configuration
public static class MockConfig
@Bean
public Properties myProp()
Properties properties = new Properties();
properties.setProperty("ra.bank.app.version", "TestVersion");
return properties;



@Value("#myProp['ra.bank.app.version']")
private String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);





This is my test file. It is giving the following error



java.lang.AssertionError: Response content expected:<TestVersion> but was:<>
at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:54)
at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:81)
at org.springframework.test.web.servlet.result.ContentResultMatchers$5.match(ContentResultMatchers.java:149)
at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:171)
at com.db.creditrisk.rating.analysis.bank.ui.facade.v2.common.ws.VersionResourceImplTest.shouldReturnCorrectVersion(VersionResourceImplTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)









share|improve this question























  • I think you should use @Value("$ra.bank.app.version") private String applicationVersion;
    – GauravRai1512
    Nov 10 at 4:56










  • property file is not getting injected in my case...can you suggest something for this?
    – Supriya
    Nov 10 at 6:53










  • you don't have to create object for properties. you can use application.properties and there you can specify version details and then @value("$ra.bank.app.version") will work.
    – GauravRai1512
    Nov 10 at 7:24










  • yes I removed the properties object...and added test.properties -ra.bank.app.version=TestVersion with this value but still getting null
    – Supriya
    Nov 10 at 7:40










  • i have provided you one solution in answer tab can you please check again and do let me know if it works.
    – GauravRai1512
    Nov 10 at 7:43












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











@RunWith(MockitoJUnitRunner.class)
public class VersionResourceImplTest

@Configuration
public static class MockConfig
@Bean
public Properties myProp()
Properties properties = new Properties();
properties.setProperty("ra.bank.app.version", "TestVersion");
return properties;



@Value("#myProp['ra.bank.app.version']")
private String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);





This is my test file. It is giving the following error



java.lang.AssertionError: Response content expected:<TestVersion> but was:<>
at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:54)
at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:81)
at org.springframework.test.web.servlet.result.ContentResultMatchers$5.match(ContentResultMatchers.java:149)
at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:171)
at com.db.creditrisk.rating.analysis.bank.ui.facade.v2.common.ws.VersionResourceImplTest.shouldReturnCorrectVersion(VersionResourceImplTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)









share|improve this question















@RunWith(MockitoJUnitRunner.class)
public class VersionResourceImplTest

@Configuration
public static class MockConfig
@Bean
public Properties myProp()
Properties properties = new Properties();
properties.setProperty("ra.bank.app.version", "TestVersion");
return properties;



@Value("#myProp['ra.bank.app.version']")
private String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);





This is my test file. It is giving the following error



java.lang.AssertionError: Response content expected:<TestVersion> but was:<>
at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:54)
at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:81)
at org.springframework.test.web.servlet.result.ContentResultMatchers$5.match(ContentResultMatchers.java:149)
at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:171)
at com.db.creditrisk.rating.analysis.bank.ui.facade.v2.common.ws.VersionResourceImplTest.shouldReturnCorrectVersion(VersionResourceImplTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)






spring-boot junit junit4






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 5:18









Alien

4,22521023




4,22521023










asked Nov 10 at 4:29









Supriya

12




12











  • I think you should use @Value("$ra.bank.app.version") private String applicationVersion;
    – GauravRai1512
    Nov 10 at 4:56










  • property file is not getting injected in my case...can you suggest something for this?
    – Supriya
    Nov 10 at 6:53










  • you don't have to create object for properties. you can use application.properties and there you can specify version details and then @value("$ra.bank.app.version") will work.
    – GauravRai1512
    Nov 10 at 7:24










  • yes I removed the properties object...and added test.properties -ra.bank.app.version=TestVersion with this value but still getting null
    – Supriya
    Nov 10 at 7:40










  • i have provided you one solution in answer tab can you please check again and do let me know if it works.
    – GauravRai1512
    Nov 10 at 7:43
















  • I think you should use @Value("$ra.bank.app.version") private String applicationVersion;
    – GauravRai1512
    Nov 10 at 4:56










  • property file is not getting injected in my case...can you suggest something for this?
    – Supriya
    Nov 10 at 6:53










  • you don't have to create object for properties. you can use application.properties and there you can specify version details and then @value("$ra.bank.app.version") will work.
    – GauravRai1512
    Nov 10 at 7:24










  • yes I removed the properties object...and added test.properties -ra.bank.app.version=TestVersion with this value but still getting null
    – Supriya
    Nov 10 at 7:40










  • i have provided you one solution in answer tab can you please check again and do let me know if it works.
    – GauravRai1512
    Nov 10 at 7:43















I think you should use @Value("$ra.bank.app.version") private String applicationVersion;
– GauravRai1512
Nov 10 at 4:56




I think you should use @Value("$ra.bank.app.version") private String applicationVersion;
– GauravRai1512
Nov 10 at 4:56












property file is not getting injected in my case...can you suggest something for this?
– Supriya
Nov 10 at 6:53




property file is not getting injected in my case...can you suggest something for this?
– Supriya
Nov 10 at 6:53












you don't have to create object for properties. you can use application.properties and there you can specify version details and then @value("$ra.bank.app.version") will work.
– GauravRai1512
Nov 10 at 7:24




you don't have to create object for properties. you can use application.properties and there you can specify version details and then @value("$ra.bank.app.version") will work.
– GauravRai1512
Nov 10 at 7:24












yes I removed the properties object...and added test.properties -ra.bank.app.version=TestVersion with this value but still getting null
– Supriya
Nov 10 at 7:40




yes I removed the properties object...and added test.properties -ra.bank.app.version=TestVersion with this value but still getting null
– Supriya
Nov 10 at 7:40












i have provided you one solution in answer tab can you please check again and do let me know if it works.
– GauravRai1512
Nov 10 at 7:43




i have provided you one solution in answer tab can you please check again and do let me know if it works.
– GauravRai1512
Nov 10 at 7:43












2 Answers
2






active

oldest

votes

















up vote
0
down vote













For app.version=version2 in properties file we read it using @Value annotation like below.



@Value("$app.version")
private String appVersion;


So things to troubleshoot for your issue are.



1.Ensure that the property file is present in your classpath.



@PropertySource("classpath:application-test.properties")


OR



@TestPropertySource("classpath:application-test.properties")


2.Print the value before assert statement to know whether @Value is really injecting value or not.



3.Change @Value("#myProp['ra.bank.app.version']") to @Value("$ra.bank.app.version")






share|improve this answer




















  • i did that but now I am getting the following error- VersionResourceImplTest.testVersion:43 expected:<TestVersion> but was:<null>
    – Supriya
    Nov 10 at 6:26











  • Check point 2 .. system.out.print before assert statement and check what value you get
    – Alien
    Nov 10 at 6:34










  • I am getting null there
    – Supriya
    Nov 10 at 6:44










  • property file is not getting injected as I am getting null value
    – Supriya
    Nov 10 at 6:45










  • @Supriya why don't you use application.properties of spring-boot which i have explained above.
    – GauravRai1512
    Nov 10 at 7:25

















up vote
0
down vote













Please try to use below code and let me know if it's works.



 @RunWith(MockitoJUnitRunner.class)
@ContextConfiguration(classes = VersionResourceImplTest.myProp.class)
@TestPropertySource(properties =
"ra.bank.app.version=TestVersion",
)
public class VersionResourceImplTest {

@Value("$ra.bank.app.version")
private String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);


@Configuration
public static class myProp
@Bean
public static PropertySourcesPlaceholderConfigurer propertiesResolver()
return new PropertySourcesPlaceholderConfigurer();






or you can also use below approach as well.



@SpringBootTest
@SpringBootConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource(properties =
"ra.bank.app.version=TestVersion"
)
public class FooTest

@Value("$ra.bank.app.version")
String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);








share|improve this answer






















  • I tried both ways...With ist approach I get null only ..means values are not getting picked from property file and in second approach I get failed to load applicationContext error
    – Supriya
    Nov 10 at 8:07










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235996%2fjava-lang-assertionerror-response-content-expectedtestversion-but-was%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













For app.version=version2 in properties file we read it using @Value annotation like below.



@Value("$app.version")
private String appVersion;


So things to troubleshoot for your issue are.



1.Ensure that the property file is present in your classpath.



@PropertySource("classpath:application-test.properties")


OR



@TestPropertySource("classpath:application-test.properties")


2.Print the value before assert statement to know whether @Value is really injecting value or not.



3.Change @Value("#myProp['ra.bank.app.version']") to @Value("$ra.bank.app.version")






share|improve this answer




















  • i did that but now I am getting the following error- VersionResourceImplTest.testVersion:43 expected:<TestVersion> but was:<null>
    – Supriya
    Nov 10 at 6:26











  • Check point 2 .. system.out.print before assert statement and check what value you get
    – Alien
    Nov 10 at 6:34










  • I am getting null there
    – Supriya
    Nov 10 at 6:44










  • property file is not getting injected as I am getting null value
    – Supriya
    Nov 10 at 6:45










  • @Supriya why don't you use application.properties of spring-boot which i have explained above.
    – GauravRai1512
    Nov 10 at 7:25














up vote
0
down vote













For app.version=version2 in properties file we read it using @Value annotation like below.



@Value("$app.version")
private String appVersion;


So things to troubleshoot for your issue are.



1.Ensure that the property file is present in your classpath.



@PropertySource("classpath:application-test.properties")


OR



@TestPropertySource("classpath:application-test.properties")


2.Print the value before assert statement to know whether @Value is really injecting value or not.



3.Change @Value("#myProp['ra.bank.app.version']") to @Value("$ra.bank.app.version")






share|improve this answer




















  • i did that but now I am getting the following error- VersionResourceImplTest.testVersion:43 expected:<TestVersion> but was:<null>
    – Supriya
    Nov 10 at 6:26











  • Check point 2 .. system.out.print before assert statement and check what value you get
    – Alien
    Nov 10 at 6:34










  • I am getting null there
    – Supriya
    Nov 10 at 6:44










  • property file is not getting injected as I am getting null value
    – Supriya
    Nov 10 at 6:45










  • @Supriya why don't you use application.properties of spring-boot which i have explained above.
    – GauravRai1512
    Nov 10 at 7:25












up vote
0
down vote










up vote
0
down vote









For app.version=version2 in properties file we read it using @Value annotation like below.



@Value("$app.version")
private String appVersion;


So things to troubleshoot for your issue are.



1.Ensure that the property file is present in your classpath.



@PropertySource("classpath:application-test.properties")


OR



@TestPropertySource("classpath:application-test.properties")


2.Print the value before assert statement to know whether @Value is really injecting value or not.



3.Change @Value("#myProp['ra.bank.app.version']") to @Value("$ra.bank.app.version")






share|improve this answer












For app.version=version2 in properties file we read it using @Value annotation like below.



@Value("$app.version")
private String appVersion;


So things to troubleshoot for your issue are.



1.Ensure that the property file is present in your classpath.



@PropertySource("classpath:application-test.properties")


OR



@TestPropertySource("classpath:application-test.properties")


2.Print the value before assert statement to know whether @Value is really injecting value or not.



3.Change @Value("#myProp['ra.bank.app.version']") to @Value("$ra.bank.app.version")







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 at 5:32









Alien

4,22521023




4,22521023











  • i did that but now I am getting the following error- VersionResourceImplTest.testVersion:43 expected:<TestVersion> but was:<null>
    – Supriya
    Nov 10 at 6:26











  • Check point 2 .. system.out.print before assert statement and check what value you get
    – Alien
    Nov 10 at 6:34










  • I am getting null there
    – Supriya
    Nov 10 at 6:44










  • property file is not getting injected as I am getting null value
    – Supriya
    Nov 10 at 6:45










  • @Supriya why don't you use application.properties of spring-boot which i have explained above.
    – GauravRai1512
    Nov 10 at 7:25
















  • i did that but now I am getting the following error- VersionResourceImplTest.testVersion:43 expected:<TestVersion> but was:<null>
    – Supriya
    Nov 10 at 6:26











  • Check point 2 .. system.out.print before assert statement and check what value you get
    – Alien
    Nov 10 at 6:34










  • I am getting null there
    – Supriya
    Nov 10 at 6:44










  • property file is not getting injected as I am getting null value
    – Supriya
    Nov 10 at 6:45










  • @Supriya why don't you use application.properties of spring-boot which i have explained above.
    – GauravRai1512
    Nov 10 at 7:25















i did that but now I am getting the following error- VersionResourceImplTest.testVersion:43 expected:<TestVersion> but was:<null>
– Supriya
Nov 10 at 6:26





i did that but now I am getting the following error- VersionResourceImplTest.testVersion:43 expected:<TestVersion> but was:<null>
– Supriya
Nov 10 at 6:26













Check point 2 .. system.out.print before assert statement and check what value you get
– Alien
Nov 10 at 6:34




Check point 2 .. system.out.print before assert statement and check what value you get
– Alien
Nov 10 at 6:34












I am getting null there
– Supriya
Nov 10 at 6:44




I am getting null there
– Supriya
Nov 10 at 6:44












property file is not getting injected as I am getting null value
– Supriya
Nov 10 at 6:45




property file is not getting injected as I am getting null value
– Supriya
Nov 10 at 6:45












@Supriya why don't you use application.properties of spring-boot which i have explained above.
– GauravRai1512
Nov 10 at 7:25




@Supriya why don't you use application.properties of spring-boot which i have explained above.
– GauravRai1512
Nov 10 at 7:25












up vote
0
down vote













Please try to use below code and let me know if it's works.



 @RunWith(MockitoJUnitRunner.class)
@ContextConfiguration(classes = VersionResourceImplTest.myProp.class)
@TestPropertySource(properties =
"ra.bank.app.version=TestVersion",
)
public class VersionResourceImplTest {

@Value("$ra.bank.app.version")
private String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);


@Configuration
public static class myProp
@Bean
public static PropertySourcesPlaceholderConfigurer propertiesResolver()
return new PropertySourcesPlaceholderConfigurer();






or you can also use below approach as well.



@SpringBootTest
@SpringBootConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource(properties =
"ra.bank.app.version=TestVersion"
)
public class FooTest

@Value("$ra.bank.app.version")
String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);








share|improve this answer






















  • I tried both ways...With ist approach I get null only ..means values are not getting picked from property file and in second approach I get failed to load applicationContext error
    – Supriya
    Nov 10 at 8:07














up vote
0
down vote













Please try to use below code and let me know if it's works.



 @RunWith(MockitoJUnitRunner.class)
@ContextConfiguration(classes = VersionResourceImplTest.myProp.class)
@TestPropertySource(properties =
"ra.bank.app.version=TestVersion",
)
public class VersionResourceImplTest {

@Value("$ra.bank.app.version")
private String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);


@Configuration
public static class myProp
@Bean
public static PropertySourcesPlaceholderConfigurer propertiesResolver()
return new PropertySourcesPlaceholderConfigurer();






or you can also use below approach as well.



@SpringBootTest
@SpringBootConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource(properties =
"ra.bank.app.version=TestVersion"
)
public class FooTest

@Value("$ra.bank.app.version")
String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);








share|improve this answer






















  • I tried both ways...With ist approach I get null only ..means values are not getting picked from property file and in second approach I get failed to load applicationContext error
    – Supriya
    Nov 10 at 8:07












up vote
0
down vote










up vote
0
down vote









Please try to use below code and let me know if it's works.



 @RunWith(MockitoJUnitRunner.class)
@ContextConfiguration(classes = VersionResourceImplTest.myProp.class)
@TestPropertySource(properties =
"ra.bank.app.version=TestVersion",
)
public class VersionResourceImplTest {

@Value("$ra.bank.app.version")
private String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);


@Configuration
public static class myProp
@Bean
public static PropertySourcesPlaceholderConfigurer propertiesResolver()
return new PropertySourcesPlaceholderConfigurer();






or you can also use below approach as well.



@SpringBootTest
@SpringBootConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource(properties =
"ra.bank.app.version=TestVersion"
)
public class FooTest

@Value("$ra.bank.app.version")
String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);








share|improve this answer














Please try to use below code and let me know if it's works.



 @RunWith(MockitoJUnitRunner.class)
@ContextConfiguration(classes = VersionResourceImplTest.myProp.class)
@TestPropertySource(properties =
"ra.bank.app.version=TestVersion",
)
public class VersionResourceImplTest {

@Value("$ra.bank.app.version")
private String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);


@Configuration
public static class myProp
@Bean
public static PropertySourcesPlaceholderConfigurer propertiesResolver()
return new PropertySourcesPlaceholderConfigurer();






or you can also use below approach as well.



@SpringBootTest
@SpringBootConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource(properties =
"ra.bank.app.version=TestVersion"
)
public class FooTest

@Value("$ra.bank.app.version")
String applicationVersion;

@Test
public void testVersion()
Assert.assertEquals("TestVersion", applicationVersion);









share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 10 at 7:51

























answered Nov 10 at 7:42









GauravRai1512

59211




59211











  • I tried both ways...With ist approach I get null only ..means values are not getting picked from property file and in second approach I get failed to load applicationContext error
    – Supriya
    Nov 10 at 8:07
















  • I tried both ways...With ist approach I get null only ..means values are not getting picked from property file and in second approach I get failed to load applicationContext error
    – Supriya
    Nov 10 at 8:07















I tried both ways...With ist approach I get null only ..means values are not getting picked from property file and in second approach I get failed to load applicationContext error
– Supriya
Nov 10 at 8:07




I tried both ways...With ist approach I get null only ..means values are not getting picked from property file and in second approach I get failed to load applicationContext error
– Supriya
Nov 10 at 8:07

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235996%2fjava-lang-assertionerror-response-content-expectedtestversion-but-was%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo