BAEL-4321 move to new module and use BDD for test names
This commit is contained in:
parent
e23d7f8efb
commit
dbe203e40a
@ -1,13 +0,0 @@
|
||||
package yamltopojo.demo;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class DemoApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
@ -7,7 +7,7 @@ import yamltopojo.demo.service.SizeConverterService;
|
||||
@RequestMapping(value = "/")
|
||||
public class TshirtSizeController {
|
||||
|
||||
private SizeConverterService service;
|
||||
private final SizeConverterService service;
|
||||
|
||||
public TshirtSizeController(SizeConverterService service) {
|
||||
this.service = service;
|
@ -7,7 +7,7 @@ import yamltopojo.demo.config.TshirtSizeConfig;
|
||||
@Service
|
||||
public class SizeConverterImpl implements SizeConverterService {
|
||||
|
||||
private TshirtSizeConfig tshirtSizeConfig;
|
||||
private final TshirtSizeConfig tshirtSizeConfig;
|
||||
|
||||
public SizeConverterImpl(TshirtSizeConfig tshirtSizeConfig) {
|
||||
this.tshirtSizeConfig = tshirtSizeConfig;
|
||||
@ -17,6 +17,6 @@ public class SizeConverterImpl implements SizeConverterService {
|
||||
if(countryCode == null) {
|
||||
return tshirtSizeConfig.getSimpleMapping().get(label);
|
||||
}
|
||||
return tshirtSizeConfig.getComplexMapping().get(label).get(countryCode);
|
||||
return tshirtSizeConfig.getComplexMapping().get(label).get(countryCode.toLowerCase());
|
||||
}
|
||||
}
|
@ -20,14 +20,14 @@ class TshirtSizeControllerTest {
|
||||
private TshirtSizeController tested;
|
||||
|
||||
@Test
|
||||
void convertSize() {
|
||||
void givenSizeConverter_whenLabelIsSandCountryCodeIsFr_thenReturnCorrectSize() {
|
||||
|
||||
// Given
|
||||
String label = "S";
|
||||
String countryCode = "fr";
|
||||
int result = 36;
|
||||
|
||||
//
|
||||
// When
|
||||
when(service.convertSize(label, countryCode)).thenReturn(result);
|
||||
int actual = tested.convertSize(label, countryCode);
|
||||
|
Loading…
x
Reference in New Issue
Block a user