Fix broken test logic

This commit is contained in:
Andrii Shvaika 2022-11-08 11:56:14 +02:00
parent 9def5a30c6
commit 7ce3af709b
2 changed files with 7 additions and 7 deletions

View File

@ -375,7 +375,7 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest {
} }
protected void login(String username, String password) throws Exception { protected void login(String username, String password) throws Exception {
logout(); resetTokens();
JsonNode tokenInfo = readResponse(doPost("/api/auth/login", new LoginRequest(username, password)).andExpect(status().isOk()), JsonNode.class); JsonNode tokenInfo = readResponse(doPost("/api/auth/login", new LoginRequest(username, password)).andExpect(status().isOk()), JsonNode.class);
validateAndSetJwtToken(tokenInfo, username); validateAndSetJwtToken(tokenInfo, username);
} }

View File

@ -63,15 +63,15 @@ public abstract class BaseRestApiLimitsTest extends AbstractControllerTest {
public void before() throws Exception { public void before() throws Exception {
loginSysAdmin(); loginSysAdmin();
tenantProfile = getDefaultTenantProfile(); tenantProfile = getDefaultTenantProfile();
logout(); resetTokens();
} }
@After @After
public void after() throws Exception { public void after() throws Exception {
logout(); resetTokens();
loginSysAdmin(); loginSysAdmin();
saveTenantProfileWitConfiguration(tenantProfile, new DefaultTenantProfileConfiguration()); saveTenantProfileWitConfiguration(tenantProfile, new DefaultTenantProfileConfiguration());
logout(); resetTokens();
service.shutdown(); service.shutdown();
} }
@ -85,7 +85,7 @@ public abstract class BaseRestApiLimitsTest extends AbstractControllerTest {
saveTenantProfileWitConfiguration(tenantProfile, configurationWithCustomerRestLimits); saveTenantProfileWitConfiguration(tenantProfile, configurationWithCustomerRestLimits);
logout(); resetTokens();
loginCustomerUser(); loginCustomerUser();
@ -105,7 +105,7 @@ public abstract class BaseRestApiLimitsTest extends AbstractControllerTest {
saveTenantProfileWitConfiguration(tenantProfile, configurationWithTenantRestLimits); saveTenantProfileWitConfiguration(tenantProfile, configurationWithTenantRestLimits);
logout(); resetTokens();
loginCustomerUser(); loginCustomerUser();
@ -125,7 +125,7 @@ public abstract class BaseRestApiLimitsTest extends AbstractControllerTest {
saveTenantProfileWitConfiguration(tenantProfile, configurationWithTenantRestLimits); saveTenantProfileWitConfiguration(tenantProfile, configurationWithTenantRestLimits);
logout(); resetTokens();
loginTenantAdmin(); loginTenantAdmin();