@@ -4084,7 +4084,7 @@ public void shouldTransformStringToBase64() {
4084
4084
);
4085
4085
}
4086
4086
4087
- @ Test
4087
+ @ Test // checkstyle-disable-line JavaNCSS
4088
4088
public void shouldCreateVariableFromLiteralValue () {
4089
4089
MetafixTestHelpers .assertFix (streamReceiver , Arrays .asList (
4090
4090
"to_var('data.title','testVar')" ,
@@ -4098,11 +4098,26 @@ public void shouldCreateVariableFromLiteralValue() {
4098
4098
i .endRecord ();
4099
4099
i .startRecord ("2" );
4100
4100
i .startEntity ("data" );
4101
- i .literal ("title" , "second-test" );
4101
+ i .literal ("title" , "test1" );
4102
+ i .literal ("title" , "test2" );
4103
+ i .endEntity ();
4104
+ i .endRecord ();
4105
+ i .startRecord ("3" );
4106
+ i .startEntity ("data" );
4107
+ i .startEntity ("title" );
4108
+ i .literal ("key" , "value" );
4109
+ i .endEntity ();
4110
+ i .endEntity ();
4111
+ i .endRecord ();
4112
+ i .startRecord ("4" );
4113
+ i .endRecord ();
4114
+ i .startRecord ("5" );
4115
+ i .startEntity ("data" );
4116
+ i .literal ("title" , "final-test" );
4102
4117
i .endEntity ();
4103
4118
i .endRecord ();
4104
4119
},
4105
- o -> {
4120
+ ( o , f ) -> {
4106
4121
o .get ().startRecord ("1" );
4107
4122
o .get ().startEntity ("data" );
4108
4123
o .get ().literal ("title" , "test" );
@@ -4111,9 +4126,26 @@ public void shouldCreateVariableFromLiteralValue() {
4111
4126
o .get ().endRecord ();
4112
4127
o .get ().startRecord ("2" );
4113
4128
o .get ().startEntity ("data" );
4114
- o .get ().literal ("title" , "second-test" );
4129
+ o .get ().literal ("title" , "test1" );
4130
+ o .get ().literal ("title" , "test2" );
4131
+ o .get ().endEntity ();
4132
+ o .get ().literal ("testResult" , "This is a [test1, test2]" );
4133
+ o .get ().endRecord ();
4134
+ o .get ().startRecord ("3" );
4135
+ o .get ().startEntity ("data" );
4136
+ o .get ().startEntity ("title" );
4137
+ o .get ().literal ("key" , "value" );
4138
+ f .apply (2 ).endEntity ();
4139
+ o .get ().literal ("testResult" , "This is a {key=value}" );
4140
+ o .get ().endRecord ();
4141
+ o .get ().startRecord ("4" );
4142
+ o .get ().literal ("testResult" , "This is a " );
4143
+ o .get ().endRecord ();
4144
+ o .get ().startRecord ("5" );
4145
+ o .get ().startEntity ("data" );
4146
+ o .get ().literal ("title" , "final-test" );
4115
4147
o .get ().endEntity ();
4116
- o .get ().literal ("testResult" , "This is a second -test" );
4148
+ o .get ().literal ("testResult" , "This is a final -test" );
4117
4149
o .get ().endRecord ();
4118
4150
}
4119
4151
);
0 commit comments