Skip to content

Commit

Permalink
Merge branch 'work/using-react-with-bootstrap4'
Browse files Browse the repository at this point in the history
  • Loading branch information
steinarb committed Jun 17, 2024
2 parents be4454d + b5dd9b6 commit 7d255b7
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,61 +129,51 @@ public Account addAccount(User user) {

@Override
public List<SumYear> earningsSumOverYear(String username) {
// TODO Auto-generated method stub
return null;
}

@Override
public List<SumYearMonth> earningsSumOverMonth(String username) {
// TODO Auto-generated method stub
return null;
}

@Override
public List<Bonus> getActiveBonuses() {
// TODO Auto-generated method stub
return null;
}

@Override
public List<Bonus> getAllBonuses() {
// TODO Auto-generated method stub
return null;
}

@Override
public List<Bonus> createBonus(Bonus newBonus) {
// TODO Auto-generated method stub
return null;
}

@Override
public List<Bonus> modifyBonus(Bonus updatedBonus) {
// TODO Auto-generated method stub
return null;
}

@Override
public List<Bonus> deleteBonus(Bonus removedBonus) {
// TODO Auto-generated method stub
return null;
}

@Override
public Locale defaultLocale() {
// TODO Auto-generated method stub
return null;
}

@Override
public List<LocaleBean> availableLocales() {
// TODO Auto-generated method stub
return null;
}

@Override
public Map<String, String> displayTexts(Locale locale) {
// TODO Auto-generated method stub
return null;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void testInsertInitialDataInDatabaseFailToCreateLiquibase() throws Exception {
}

@Test
void testCreateUkelonnLiquibaseDefault() throws Exception {
void testCreateUkelonnLiquibaseDefault() {
var runner = new ProductionLiquibaseRunner();
var logservice = new MockLogService();
runner.setLogService(logservice);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
class TestLiquibaseRunnerTest {

@Test
void testPrepareDatabase() throws SQLException, DatabaseException {
void testPrepareDatabase() throws Exception {
var dataSourceFactory = new DerbyDataSourceFactory();
var derbyMemoryCredentials = createDerbyMemoryCredentials("ukelonn_pure", "no");
var datasource = dataSourceFactory.createDataSource(derbyMemoryCredentials);
Expand Down
28 changes: 14 additions & 14 deletions ukelonn.web.frontend/src/main/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions ukelonn.web.security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Import-Package>*,org.apache.shiro.web.filter.authc</Import-Package> <!-- import of package containing PassThruAuthenticationFilter for the Shiro INI parser -->
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.shiro.realm.Realm;
import org.apache.shiro.session.mgt.eis.SessionDAO;
import org.apache.shiro.web.env.IniWebEnvironment;
import org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.apache.shiro.web.servlet.AbstractShiroFilter;
import org.apache.shiro.web.session.mgt.DefaultWebSessionManager;
Expand Down Expand Up @@ -66,8 +65,8 @@ public void setSession(SessionDAO session) {

@Activate
public void activate() {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); // Set class loader that can find PassThruAuthenticationFilter for the Shiro INI parser
var environment = new IniWebEnvironment();
environment.getObjects().put("authc", new PassThruAuthenticationFilter());
environment.setIni(INI_FILE);
environment.setServletContext(getServletContext());
environment.init();
Expand Down
1 change: 1 addition & 0 deletions ukelonn.web.security/src/main/resources/shiro.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[main]
shiro.loginUrl = /login
authc = org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter
authc.loginUrl = /login
shiro.unauthorizedUrl = /unauthorized

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AccountResourceTest extends ServletTestBase {
}

@Test
void testGetAccount() throws Exception {
void testGetAccount() {
// Create the request and response for the Shiro login
var request = mock(HttpServletRequest.class);
var session = mock(HttpSession.class);
Expand Down Expand Up @@ -77,7 +77,7 @@ void testGetAccount() throws Exception {
* @throws Exception
*/
@Test
void testGetAccountOtherUsername() throws Exception {
void testGetAccountOtherUsername() {
// Create the request and response for the Shiro login
var request = mock(HttpServletRequest.class);
var session = mock(HttpSession.class);
Expand Down Expand Up @@ -111,7 +111,7 @@ void testGetAccountOtherUsername() throws Exception {
* @throws Exception
*/
@Test
void testGetAccountWhenLoggedInAsAdministrator() throws Exception {
void testGetAccountWhenLoggedInAsAdministrator() {
// Create the request and response for the Shiro login
var request = mock(HttpServletRequest.class);
var session = mock(HttpSession.class);
Expand Down Expand Up @@ -142,7 +142,7 @@ void testGetAccountWhenLoggedInAsAdministrator() throws Exception {
}

@Test
void testGetAccountNoUsername() throws Exception {
void testGetAccountNoUsername() {
// Create the request and response for the Shiro login
var request = mock(HttpServletRequest.class);
var session = mock(HttpSession.class);
Expand All @@ -166,7 +166,7 @@ void testGetAccountNoUsername() throws Exception {
}

@Test
void testGetAccountUsernameNotPresentInDatabase() throws Exception {
void testGetAccountUsernameNotPresentInDatabase() {
// Create the request and response for the Shiro login
var request = mock(HttpServletRequest.class);
var session = mock(HttpSession.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class AccountsTest {

@Test
void testGetAccounts() throws Exception {
void testGetAccounts() {
// Create the object to be tested
var resource = new Accounts();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class JobResourceTest extends ServletTestBase {
}

@Test
void testRegisterJob() throws Exception {
void testRegisterJob() {
// Create the request
var account = getJadAccount();
var originalBalance = account.balance();
Expand Down Expand Up @@ -101,7 +101,7 @@ void testRegisterJob() throws Exception {
* @throws Exception
*/
@Test
void testRegisterJobOtherUsername() throws Exception {
void testRegisterJobOtherUsername() {
// Create the request
var account = getJodAccount();
var jobTypes = getJobtypes();
Expand Down Expand Up @@ -143,7 +143,7 @@ void testRegisterJobOtherUsername() throws Exception {
* @throws Exception
*/
@Test
void testRegisterJobtWhenLoggedInAsAdministrator() throws Exception {
void testRegisterJobtWhenLoggedInAsAdministrator() {
// Create the request
var account = getJadAccount();
var originalBalance = account.balance();
Expand Down Expand Up @@ -186,7 +186,7 @@ void testRegisterJobtWhenLoggedInAsAdministrator() throws Exception {
}

@Test
void testRegisterJobNoUsername() throws Exception {
void testRegisterJobNoUsername() {
// Create the request
var account = Account.with().build();
var jobTypes = getJobtypes();
Expand Down Expand Up @@ -230,7 +230,7 @@ void testRegisterJobNoUsername() throws Exception {
* @throws Exception
*/
@Test
void testRegisterJobInternalServerError() throws Exception {
void testRegisterJobInternalServerError() {
// Create the request
var account = Account.with().build();
var jobTypes = getJobtypes();
Expand Down

0 comments on commit 7d255b7

Please sign in to comment.