1
1
/*
2
- * Copyright 2002-2016 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -62,7 +62,6 @@ public class StaticMessageSourceTests extends AbstractApplicationContextTests {
62
62
@ Test
63
63
@ Override
64
64
public void count () {
65
- // These are only checked for current Ctx (not parent ctx)
66
65
assertCount (15 );
67
66
}
68
67
@@ -109,8 +108,8 @@ public void getMessageWithMessageAlreadyLookedFor() {
109
108
110
109
// Now msg better be as expected
111
110
assertTrue ("2nd search within MsgFormat cache returned expected message for Locale.US" ,
112
- sac .getMessage ("message.format.example1" , arguments , Locale .US ).indexOf (
113
- "there was \" a disturbance in the Force\" on planet 7." ) != - 1 );
111
+ sac .getMessage ("message.format.example1" , arguments , Locale .US ).
112
+ contains ( "there was \" a disturbance in the Force\" on planet 7." ));
114
113
115
114
Object [] newArguments = {
116
115
new Integer (8 ), new Date (System .currentTimeMillis ()),
@@ -119,8 +118,8 @@ public void getMessageWithMessageAlreadyLookedFor() {
119
118
120
119
// Now msg better be as expected even with different args
121
120
assertTrue ("2nd search within MsgFormat cache with different args returned expected message for Locale.US" ,
122
- sac .getMessage ("message.format.example1" , newArguments , Locale .US )
123
- . indexOf ("there was \" a disturbance in the Force\" on planet 8." ) != - 1 );
121
+ sac .getMessage ("message.format.example1" , newArguments , Locale .US ).
122
+ contains ("there was \" a disturbance in the Force\" on planet 8." ));
124
123
}
125
124
126
125
/**
@@ -142,13 +141,13 @@ public void getMessageWithNoDefaultPassedInAndFoundInMsgCatalog() {
142
141
minutes of the time might not be the same.
143
142
*/
144
143
assertTrue ("msg from staticMsgSource for Locale.US substituting args for placeholders is as expected" ,
145
- sac .getMessage ("message.format.example1" , arguments , Locale .US )
146
- . indexOf ("there was \" a disturbance in the Force\" on planet 7." ) != - 1 );
144
+ sac .getMessage ("message.format.example1" , arguments , Locale .US ).
145
+ contains ("there was \" a disturbance in the Force\" on planet 7." ));
147
146
148
147
// Try with Locale.UK
149
148
assertTrue ("msg from staticMsgSource for Locale.UK substituting args for placeholders is as expected" ,
150
- sac .getMessage ("message.format.example1" , arguments , Locale .UK )
151
- . indexOf ("there was \" a disturbance in the Force\" on station number 7." ) != - 1 );
149
+ sac .getMessage ("message.format.example1" , arguments , Locale .UK ).
150
+ contains ("there was \" a disturbance in the Force\" on station number 7." ));
152
151
153
152
// Try with Locale.US - Use a different test msg that requires no args
154
153
assertTrue ("msg from staticMsgSource for Locale.US that requires no args is as expected" ,
0 commit comments