use of se.inera.intyg.webcert.web.web.controller.api.dto.WebUserFeaturesRequest in project webcert by sklintyg.
the class UserApiControllerTest method testUserFeaturesDisableDisabled.
@Test
public void testUserFeaturesDisableDisabled() {
// Given
final WebUserFeaturesRequest webUserFeaturesRequest = new WebUserFeaturesRequest();
webUserFeaturesRequest.setJsLoggning(false);
final HashMap<String, Feature> features = new HashMap<>();
when(webCertUser.getFeatures()).thenReturn(features);
// When
userApiController.userFeatures(webUserFeaturesRequest);
// Then
Mockito.verify(webCertUser, times(1)).setFeatures(captor.capture());
assertFalse(captor.getValue().containsKey(AuthoritiesConstants.FEATURE_JS_LOGGNING));
}
use of se.inera.intyg.webcert.web.web.controller.api.dto.WebUserFeaturesRequest in project webcert by sklintyg.
the class UserApiControllerTest method testUserFeaturesDisableEnabled.
@Test
public void testUserFeaturesDisableEnabled() {
// Given
final WebUserFeaturesRequest webUserFeaturesRequest = new WebUserFeaturesRequest();
webUserFeaturesRequest.setJsLoggning(false);
final HashMap<String, Feature> features = new HashMap<>();
Feature f1 = new Feature();
f1.setName(AuthoritiesConstants.FEATURE_JS_LOGGNING);
features.put(f1.getName(), f1);
when(webCertUser.getFeatures()).thenReturn(features);
// When
userApiController.userFeatures(webUserFeaturesRequest);
// Then
Mockito.verify(webCertUser, times(1)).setFeatures(captor.capture());
assertFalse(captor.getValue().containsKey(AuthoritiesConstants.FEATURE_JS_LOGGNING));
}
use of se.inera.intyg.webcert.web.web.controller.api.dto.WebUserFeaturesRequest in project webcert by sklintyg.
the class UserApiControllerTest method testUserFeaturesEnableEnabled.
@Test
public void testUserFeaturesEnableEnabled() {
// Given
final WebUserFeaturesRequest webUserFeaturesRequest = new WebUserFeaturesRequest();
webUserFeaturesRequest.setJsLoggning(true);
final HashMap<String, Feature> features = new HashMap<>();
Feature f1 = new Feature();
f1.setName(AuthoritiesConstants.FEATURE_JS_LOGGNING);
features.put(f1.getName(), f1);
when(webCertUser.getFeatures()).thenReturn(features);
// When
userApiController.userFeatures(webUserFeaturesRequest);
// Then
Mockito.verify(webCertUser, times(1)).setFeatures(captor.capture());
assertTrue(captor.getValue().containsKey(AuthoritiesConstants.FEATURE_JS_LOGGNING));
}
use of se.inera.intyg.webcert.web.web.controller.api.dto.WebUserFeaturesRequest in project webcert by sklintyg.
the class UserApiControllerTest method testUserFeaturesEnableDisabled.
@Test
public void testUserFeaturesEnableDisabled() {
// Given
final WebUserFeaturesRequest webUserFeaturesRequest = new WebUserFeaturesRequest();
webUserFeaturesRequest.setJsLoggning(true);
final HashMap<String, Feature> features = new HashMap<>();
when(webCertUser.getFeatures()).thenReturn(features);
// When
userApiController.userFeatures(webUserFeaturesRequest);
// Then
Mockito.verify(webCertUser, times(1)).setFeatures(captor.capture());
assertTrue(captor.getValue().containsKey(AuthoritiesConstants.FEATURE_JS_LOGGNING));
}
Aggregations