Skip to content

Commit

Permalink
Update to Spring Boot 2.6.0, Remove edison-oauth, Fix circular depend…
Browse files Browse the repository at this point in the history
…ency in example-jobs, remove some deprecations

Co-authored-by: Matthias Geißendörfer <[email protected]>
Co-authored-by: Marco Geweke <[email protected]>
  • Loading branch information
MediaMarco and mgeissen committed Nov 26, 2021
1 parent bec7fee commit aab415f
Show file tree
Hide file tree
Showing 34 changed files with 30 additions and 1,433 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,23 @@

import de.otto.edison.configuration.EdisonApplicationProperties;
import de.otto.edison.navigation.NavBar;
import org.springframework.boot.actuate.endpoint.http.ActuatorMediaType;
import org.springframework.boot.actuate.logging.LoggersEndpoint;
import org.springframework.boot.actuate.logging.LoggersEndpoint.LoggerLevels;
import org.springframework.boot.logging.LogLevel;
import org.springframework.http.HttpEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.StringJoiner;
import java.util.StringTokenizer;
import java.util.*;

import static de.otto.edison.navigation.NavBarItem.navBarItem;
import static de.otto.edison.util.UrlHelper.baseUriOf;
import static java.util.stream.Collectors.toList;
import static org.springframework.boot.logging.LogLevel.valueOf;
import static org.springframework.http.MediaType.ALL_VALUE;
import static org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED_VALUE;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import static org.springframework.http.MediaType.TEXT_HTML_VALUE;
import static org.springframework.http.MediaType.*;
import static org.springframework.http.ResponseEntity.notFound;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;
Expand Down Expand Up @@ -61,7 +48,8 @@ public LoggersHtmlEndpoint(final LoggersEndpoint loggersEndpoint,
value = "${edison.application.management.base-path:/internal}/loggers",
produces = {
TEXT_HTML_VALUE,
ALL_VALUE},
ALL_VALUE
},
method = GET)
public ModelAndView get(final HttpServletRequest request) {
return new ModelAndView("loggers", new HashMap<String,Object>() {{
Expand All @@ -72,9 +60,7 @@ public ModelAndView get(final HttpServletRequest request) {

@RequestMapping(
value = "${edison.application.management.base-path:/internal}/loggers",
produces = {
ActuatorMediaType.V2_JSON,
APPLICATION_JSON_VALUE},
produces = APPLICATION_JSON_VALUE,
method = GET)
@ResponseBody
public Object get() {
Expand All @@ -84,9 +70,7 @@ public Object get() {

@RequestMapping(
value = "${edison.application.management.base-path:/internal}/loggers/{name:.*}",
produces = {
ActuatorMediaType.V2_JSON,
APPLICATION_JSON_VALUE},
produces = APPLICATION_JSON_VALUE,
method = GET)
@ResponseBody
public Object get(@PathVariable String name) {
Expand All @@ -109,12 +93,8 @@ public RedirectView post(@ModelAttribute("name") String name,

@RequestMapping(
value = "${edison.application.management.base-path:/internal}/loggers/{name:.*}",
consumes = {
ActuatorMediaType.V2_JSON,
APPLICATION_JSON_VALUE},
produces = {
ActuatorMediaType.V2_JSON,
APPLICATION_JSON_VALUE},
consumes = APPLICATION_JSON_VALUE,
produces = APPLICATION_JSON_VALUE,
method = POST)
@ResponseBody
public Object post(@PathVariable String name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@
import static java.time.ZoneId.systemDefault;
import static java.util.Arrays.asList;
import static java.util.UUID.randomUUID;
import static org.assertj.core.util.Lists.emptyList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.*;

public class InMemJobRepositoryTest {

Expand All @@ -46,7 +44,7 @@ public void setUp() throws Exception {
}


private Clock clock = systemDefaultZone();
private final Clock clock = systemDefaultZone();

@Test
public void shouldFindJobInfoByUri() {
Expand Down Expand Up @@ -308,7 +306,7 @@ public void shouldClearJobInfos() throws Exception {
repository.deleteAll();

//Then
assertThat(repository.findAll(), is(emptyList()));
assertThat(repository.findAll(), is(empty()));
}

private JobInfo jobInfo(final String jobId, final String type) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.otto.edison.jobs.repository.dynamo;

import de.otto.edison.jobs.domain.JobMeta;
import org.hamcrest.MatcherAssert;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -22,8 +21,8 @@
import static de.otto.edison.jobs.repository.dynamo.DynamoJobMetaRepository.JOB_TYPE_KEY;
import static de.otto.edison.jobs.repository.dynamo.DynamoJobMetaRepository.KEY_DISABLED;
import static java.util.Collections.emptySet;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;

@Testcontainers
public class DynamoJobMetaRepositoryTest {
Expand Down Expand Up @@ -294,6 +293,6 @@ void shouldDeleteAll() {
dynamoJobMetaRepository.deleteAll();

//then
MatcherAssert.assertThat(dynamoJobMetaRepository.findAllJobTypes(), is(emptySet()));
assertThat(dynamoJobMetaRepository.findAllJobTypes(), is(emptySet()));
}
}
79 changes: 0 additions & 79 deletions edison-oauth/README.md

This file was deleted.

61 changes: 0 additions & 61 deletions edison-oauth/build.gradle

This file was deleted.

This file was deleted.

Loading

0 comments on commit aab415f

Please sign in to comment.