Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
GerhardPx committed Apr 17, 2024
1 parent 6fa9777 commit 69c117f
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void handleError(@NonNull final ClientHttpResponse response) throws WlsEx
throw createdException;
}

public TechnischeWlsException createFalseObjectReferenceException (String Id,final Throwable cause){
public TechnischeWlsException createFalseObjectReferenceException(String Id, final Throwable cause) {
return TechnischeWlsException
.withCode(ExceptionKonstanten.CODE_ALLGEMEIN_UNBEKANNT)
.inService(Id).withCause(cause)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public boolean tokenUserBezirkIdMatches(String bezirkId, Authentication auth) {
return false;
}
}

private String getBezirkID(final Authentication auth) {
val details = (Map) auth.getDetails();
return (String) details.get(WAHLBEZIRK_ID);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package de.muenchen.wls.common.security.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
Expand All @@ -7,6 +8,7 @@

import java.io.Serializable;
import java.util.Objects;

@Data
@NoArgsConstructor
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@

class BezirkIDPermissionEvaluatorImplTest {

private final BezirkIDPermissionEvaluatorImpl unitUnderTest= new BezirkIDPermissionEvaluatorImpl();
private final BezirkIDPermissionEvaluatorImpl unitUnderTest = new BezirkIDPermissionEvaluatorImpl();

@Nested
class TestTokenUserBezirkIdMatches {


@RegisterExtension
public LoggerExtension loggerExtension = new LoggerExtension();

@Test
void warnOnAuthenticationIsNull() {
unitUnderTest.tokenUserBezirkIdMatches("1234",null);
unitUnderTest.tokenUserBezirkIdMatches("1234", null);
Assertions.assertThat(loggerExtension.getFormattedMessages().contains("No authentication object for bezirkId=1234")).isTrue();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ void returnsString() {
val unitUnderTest = new BezirkIDUndWaehlerverzeichnisNummer();
unitUnderTest.setWaehlerverzeichnisNummer(Long.valueOf("1"));
unitUnderTest.setWahlbezirkID("2");
Assertions.assertThat(unitUnderTest.toString()).isEqualTo("BezirkIDUndWaehlerverzeichnisNummer{" + "wahlbezirkID='" + 2 + '\'' +", waehlerverzeichnisNummer=" + 1 +'}');
Assertions.assertThat(unitUnderTest.toString())
.isEqualTo("BezirkIDUndWaehlerverzeichnisNummer{" + "wahlbezirkID='" + 2 + '\'' + ", waehlerverzeichnisNummer=" + 1 + '}');
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ void returnsString() {
val unitUnderTest = new BezirkUndWahlID();
unitUnderTest.setWahlID("1");
unitUnderTest.setWahlbezirkID("2");
Assertions.assertThat(unitUnderTest.toString()).isEqualTo("de.muenchen.wls.common.security.domain.BezirkUndWahlID{" + "wahlID='" + 1 + '\'' +", wahlbezirkID='" + 2 + '\'' +'}');
Assertions.assertThat(unitUnderTest.toString())
.isEqualTo("de.muenchen.wls.common.security.domain.BezirkUndWahlID{" + "wahlID='" + 1 + '\'' + ", wahlbezirkID='" + 2 + '\'' + '}');
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package de.muenchen.wls.common.security;

import de.muenchen.wls.common.security.testultils.LoggerExtension;
import lombok.val;
import org.assertj.core.api.Assertions;
Expand All @@ -15,7 +16,7 @@

class DummyBezirkIdPermissionEvaluatorImplTest {

private final DummyBezirkIdPermissionEvaluatorImpl unitUnderTest= new DummyBezirkIdPermissionEvaluatorImpl();
private final DummyBezirkIdPermissionEvaluatorImpl unitUnderTest = new DummyBezirkIdPermissionEvaluatorImpl();

@Nested
class TestLoggingEvents {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;


class EncryptionBuilderTest {

@RegisterExtension
Expand Down Expand Up @@ -60,11 +59,11 @@ void throwBadPadding() throws NoSuchPaddingException, NoSuchAlgorithmException,
random.nextBytes(aByte);
val unitUnderTest = new EncryptionBuilder(aByte);
try {
unitUnderTest.encryptValue("376526723AFDAB3D");
unitUnderTest.encryptValue("376526723AFDAB3D");
} catch (Exception e) {
Assertions.assertThat(loggerExtension.getFormattedMessages().size()).isEqualTo(1);
}
}
}

}
}

0 comments on commit 69c117f

Please sign in to comment.